diff options
author | Julian Offenhäuser <offenhaeuser@protonmail.com> | 2022-11-27 00:11:43 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-09 22:38:40 +0000 |
commit | 0ff9f2b86584c0fa68f09d5bb81ebc067fe19f9d (patch) | |
tree | 3e0ea19842532a9cde4f45af626fd3065d8f3e11 /Userland/Libraries/LibGfx/Font | |
parent | 7c2976e006424ddaf28cd87dd8a27dd15ffd248d (diff) | |
download | serenity-0ff9f2b86584c0fa68f09d5bb81ebc067fe19f9d.zip |
LibGfx: Select a valid TTF cmap subtable for the Macintosh platform
While this subtable ID is supposed to be deprecated, it is used heavily
in PDF files.
It supports mapping one or two-byte values, with quite a large list of
encodings to tell you which one to expect.
For our use case, we ignore this encoding ID and just pick the first
subtable with this platform ID. Unsupported encodings will get caught
by Subtable::glyph_id_for_code_point() anyway.
Diffstat (limited to 'Userland/Libraries/LibGfx/Font')
-rw-r--r-- | Userland/Libraries/LibGfx/Font/OpenType/Font.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp index ec7365400b..981cecbdf2 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp +++ b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp @@ -510,6 +510,9 @@ ErrorOr<NonnullRefPtr<Font>> Font::try_load_from_offset(ReadonlyBytes buffer, u3 cmap.set_active_index(i); break; } + } else if (platform.value() == Cmap::Subtable::Platform::Macintosh) { + cmap.set_active_index(i); + break; } } |