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.
This commit is contained in:
parent
7c2976e006
commit
0ff9f2b865
Notes:
sideshowbarker
2024-07-17 08:43:11 +09:00
Author: https://github.com/janso3 Commit: https://github.com/SerenityOS/serenity/commit/0ff9f2b865 Pull-request: https://github.com/SerenityOS/serenity/pull/16932
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue