1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:17:35 +00:00

LibPDF: Implement most of the spec algorithm for picking TrueType glyphs

Non-CID-keyed fonts in PDFs have 8-bit codepoints which are mapped from
bytes to character names via encoding.

TrueType fonts don't index glyphs by name (Type1 fonts do), so the fix
(codified in the spec) was to make a list of all possible glyph names
and map those to (16-bit) unicode values, and then pass those into the
truetype cmap.

(As a fallback, we're supposed to look at the optional names in the
font's "post" table. That part isn't implemented here yet.)

(Note that this affects the behavior of fallback fonts for TrueType
fonts, but not yet fallback fonts for Type1 fonts, and neither the
behavior of the 14 built-in Type1 fonts (which we implement as
fallback fonts), since the TrueType fallback in Type1Font.cpp does
not use this algorithm yet. This will be fixed in a future patch.)
This commit is contained in:
Nico Weber 2023-11-17 09:28:41 -05:00 committed by Andreas Kling
parent 207717982c
commit 83128d093e
5 changed files with 4369 additions and 7 deletions

View file

@ -6,6 +6,7 @@ set(SOURCES
Encoding.cpp
Encryption.cpp
Filter.cpp
Fonts/AdobeGlyphList.cpp
Fonts/CFF.cpp
Fonts/PDFFont.cpp
Fonts/PS1FontProgram.cpp