Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CFF ¶
type CFF struct { // Charstrings contains the actual glyph definition. // It has a length of numGlyphs and is indexed by glyph ID. // See `LoadGlyph` for a way to intepret the glyph data. Charstrings [][]byte // contains filtered or unexported fields }
CFF represents a parsed CFF font, as found in the 'CFF ' Opentype table.
func Parse ¶
Parse parses a .cff font file. Although CFF enables multiple font or CIDFont programs to be bundled together in a single file, embedded CFF font file in PDF or in TrueType/OpenType fonts shall consist of exactly one font or CIDFont. Thus, this function returns an error if the file contains more than one font.
type CFF2 ¶
type CFF2 struct { // Charstrings contains the actual glyph definition. // It has a length of numGlyphs and is indexed by glyph ID. // See `LoadGlyph` for a way to intepret the glyph data. Charstrings [][]byte VarStore tables.ItemVarStore // optional // contains filtered or unexported fields }
CFF2 represents a parsed 'CFF2' Opentype table.
func ParseCFF2 ¶
ParseCFF2 parses 'src', which must be the content of a 'CFF2' Opentype table.
See also https://learn.microsoft.com/en-us/typography/opentype/spec/cff2
func (*CFF2) LoadGlyph ¶
func (f *CFF2) LoadGlyph(glyph tables.GlyphID, coords []tables.Coord) ([]ot.Segment, ps.PathBounds, error)
LoadGlyph parses the glyph charstring to compute segments and path bounds. It returns an error if the glyph is invalid or if decoding the charstring fails.
[coords] must either have the same length as the variations axis, or be empty, and be normalized
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package psinterpreter implement a Postscript interpreter required to parse .CFF files, and Type1 and Type2 Charstrings.
|
Package psinterpreter implement a Postscript interpreter required to parse .CFF files, and Type1 and Type2 Charstrings. |