1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00
serenity/Userland/Libraries/LibPDF/Fonts
Nico Weber 1c2b0feb7b LibPDF: Change how CFF optional width prefix is stored
Per 5177.Type2.pdf 3.1 "Type 2 Charstring Organization",
a glyph's charstring looks like:

    w? {hs* vs* cm* hm* mt subpath}? {mt subpath}* endchar

The `w?` is the width of the glyph, but it's optional. So all
possible commands after it (hstem* vstem* cntrmask hintmask
moveto endchar) check if there's an extra number at the start
and interpret it as a width, for the very first command we read.

This was done by having an `is_first_command` local bool that
got set to false after the first command. That didn't work with
subrs: If the first command was a call to a subr that just pushed
a bunch of numbers, then the second command after it is the actual
first command.

Instead, move that bool into the state. Set it to false the
first time we try to read a width, since that means we just read
a command that could've been prefixed by a width.
2023-11-14 10:10:34 +01:00
..
CFF.cpp LibPDF: Don't over-read in charset formats 1 and 2 2023-10-23 09:31:11 -04:00
CFF.h LibPDF: Support offset size 3 in CFF index reading 2023-10-23 09:31:11 -04:00
PDFFont.cpp LibPDF: Don't use unsanitized values in error messages 2023-10-26 11:05:32 +02:00
PDFFont.h LibPDF: Don't ignore word_spacing 2023-07-22 12:24:29 -04:00
PS1FontProgram.cpp LibPDF: Implement support for callgsubr in CFF font programs 2023-10-18 10:50:32 -04:00
PS1FontProgram.h LibPDF: Remove declarations for non-existent methods 2023-01-27 20:33:18 +00:00
SimpleFont.cpp LibPDF: Don't crash on fixed-width type 1 fonts that use /MissingWidth 2023-10-23 09:33:03 -04:00
SimpleFont.h LibPDF: Don't crash on fixed-width type 1 fonts that use /MissingWidth 2023-10-23 09:33:03 -04:00
TrueTypeFont.cpp LibPDF: Don't crash on fixed-width type 1 fonts that use /MissingWidth 2023-10-23 09:33:03 -04:00
TrueTypeFont.h LibPDF: Don't crash on fixed-width type 1 fonts that use /MissingWidth 2023-10-23 09:33:03 -04:00
Type0Font.cpp LibPDF: Tolerate indirect references in Type0 /W array 2023-10-26 10:58:45 +02:00
Type0Font.h LibPDF: Sketch out Type0 font support some more 2023-07-25 12:10:36 +02:00
Type1Font.cpp LibPDF: Don't crash on fixed-width type 1 fonts that use /MissingWidth 2023-10-23 09:33:03 -04:00
Type1Font.h AK: Rename GenericTraits to DefaultTraits 2023-11-09 10:05:51 -05:00
Type1FontProgram.cpp LibPDF: Change how CFF optional width prefix is stored 2023-11-14 10:10:34 +01:00
Type1FontProgram.h LibPDF: Change how CFF optional width prefix is stored 2023-11-14 10:10:34 +01:00