mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
![]() 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. |
||
---|---|---|
.. | ||
CFF.cpp | ||
CFF.h | ||
PDFFont.cpp | ||
PDFFont.h | ||
PS1FontProgram.cpp | ||
PS1FontProgram.h | ||
SimpleFont.cpp | ||
SimpleFont.h | ||
TrueTypeFont.cpp | ||
TrueTypeFont.h | ||
Type0Font.cpp | ||
Type0Font.h | ||
Type1Font.cpp | ||
Type1Font.h | ||
Type1FontProgram.cpp | ||
Type1FontProgram.h |