1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:37:47 +00:00

LibGfx/OpenType: Tweak Font::try_load_from_externally_owned_memory()

It now takes an Options object instead of passing several default
parameters.

No behavior change.
This commit is contained in:
Nico Weber 2024-02-20 11:12:09 -05:00 committed by Andreas Kling
parent 3b616b6af8
commit 41eca52b50
4 changed files with 19 additions and 12 deletions

View file

@ -183,7 +183,7 @@ PDFErrorOr<NonnullOwnPtr<CIDFontType2>> CIDFontType2::create(Document* document,
if (descriptor->contains(CommonNames::FontFile2)) {
auto font_file_stream = TRY(descriptor->get_stream(document, CommonNames::FontFile2));
float point_size = (font_size * POINTS_PER_INCH) / DEFAULT_DPI;
auto ttf_font = TRY(OpenType::Font::try_load_from_externally_owned_memory(font_file_stream->bytes(), 0, move(cid_to_gid_map)));
auto ttf_font = TRY(OpenType::Font::try_load_from_externally_owned_memory(font_file_stream->bytes(), { .external_cmap = move(cid_to_gid_map) }));
font = adopt_ref(*new Gfx::ScaledFont(*ttf_font, point_size, point_size));
}