for more information visit the package's GitHub page
Package contains the following modules:
This package is a parser for Compact Font Format (CFF) data. CFF is commonly used in opentype fonts. In opentype fonts, it is one of the ways to actually store the glyph data (the shape of the characters, as bezier curves).
The actual drawing instructions (moveto, lineto, curveto) are stored as type 2 charstrings.
Such a charstring is really a stream of bytes (8-bit chunks) which can be parsed into the drawing instructions.
The bytes are read and pushed onto a stack until an operator byte is encountered. The arguments and the operator can then be combined
into an Operation
.
Because the first 32 (0..31) numbers are used for operators, arguments cannot contain bytes representing those numbers. Therefore, the arguments are shifted out of that range. There are also ways to encode numbers that need more than 8 bits.
A large complication is that the decoding process is not linear:
HintMask
and CounterMask
operators can read bytes to the right of the operator, so splitting at operator bytes won't workA further minor annoyance in an elm context is that there are no separators. We only know the size (in bytes) of a charstring and its starting location. Thus we need to keep track carefully of the number of bytes that we've decoded to not step out of bounds.
Specs
Implementations