1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 23:27:42 +00:00
serenity/Userland/Libraries/LibPDF/Fonts
Nico Weber 83128d093e 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.)
2024-02-25 15:15:20 +01:00
..
AdobeGlyphList.cpp LibPDF: Implement most of the spec algorithm for picking TrueType glyphs 2024-02-25 15:15:20 +01:00
AdobeGlyphList.h LibPDF: Implement most of the spec algorithm for picking TrueType glyphs 2024-02-25 15:15:20 +01:00
CFF.cpp LibPDF: Give CFF Glyph 0 the name .notdef 2024-02-20 06:54:50 -05:00
CFF.h LibPDF/CFF: Compute per-glyph glyph width in CID-keyed fonts 2024-02-16 12:41:10 -05:00
PDFFont.cpp LibPDF: Read /Flags off font descriptors 2024-02-25 15:15:20 +01:00
PDFFont.h LibPDF: Read /Flags off font descriptors 2024-02-25 15:15:20 +01:00
PS1FontProgram.cpp Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
PS1FontProgram.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
SimpleFont.cpp LibPDF: Scale default glyph width by font size and x scale 2024-02-12 14:32:04 +00:00
SimpleFont.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
TrueTypeFont.cpp LibPDF: Implement most of the spec algorithm for picking TrueType glyphs 2024-02-25 15:15:20 +01:00
TrueTypeFont.h LibPDF: Implement most of the spec algorithm for picking TrueType glyphs 2024-02-25 15:15:20 +01:00
Type0Font.cpp LibPDF+LibGfx: Do not try to read "name" table for PDFs 2024-02-21 13:38:33 +01:00
Type0Font.h Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
Type1Font.cpp LibPDF/CFF: Store if a font program is CID-keyed 2024-02-15 12:32:31 +01:00
Type1Font.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00
Type1FontProgram.cpp LibPDF/CFF: Clear stack after "endchar" commands 2024-02-22 06:59:28 +01:00
Type1FontProgram.h LibPDF/CFF: Store if a font program is CID-keyed 2024-02-15 12:32:31 +01:00
Type3Font.cpp LibPDF: Add an initial implementation of type 3 glyph rendering 2023-11-17 19:47:53 +00:00
Type3Font.h LibPDF: Pass Renderer to SimpleFont::draw_glyph() 2023-11-17 19:47:53 +00:00