Documentation ¶
Overview ¶
Package cff provides a parser for the CFF font format defined at https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf.
Index ¶
- type Font
- func (f *Font) Cmap() (fonts.Cmap, fonts.CmapEncoding)
- func (f *Font) GlyphName(glyph fonts.GID) string
- func (f *Font) LoadGlyph(glyph fonts.GID) (Glyph, error)
- func (f *Font) LoadSummary() (fonts.FontSummary, error)
- func (f *Font) NumGlyphs() int
- func (f *Font) PoscriptName() string
- func (f *Font) PostscriptInfo() (fonts.PSInfo, bool)
- type Glyph
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Font ¶
type Font struct { Encoding *simpleencodings.Encoding FontMatrix []float32 fonts.PSInfo // contains filtered or unexported fields }
Font represents a parsed CFF font.
func Parse ¶
Parse parse 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. See Loader to read standalone .cff files
func (*Font) LoadGlyph ¶
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.
func (*Font) LoadSummary ¶
func (f *Font) LoadSummary() (fonts.FontSummary, error)
func (*Font) NumGlyphs ¶
NumGlyphs returns the number of glyphs in this font. It is also the maximum glyph index + 1.