Documentation ¶
Index ¶
- Constants
- type CFF
- type Font
- func (f *Font) Cmap() (fonts.Cmap, fonts.CmapEncoding)
- func (f *Font) GetRawIndexData(r io.ReadSeeker, index mainIndex) ([]byte, error)
- func (fnt *Font) GlyphName(g fonts.GID) string
- func (f *Font) IsCIDFont() bool
- func (f *Font) LoadGlyph(glyph fonts.GID) ([]fonts.Segment, ps.PathBounds, error)
- func (fnt *Font) NumGlyphs() int
- func (f *Font) Subset(codepoints []fonts.GID)
- func (f *Font) WriteSubset(w io.Writer) error
- type SID
Constants ¶
View Source
const ( NameIndex mainIndex = iota DictIndex StringIndex GlobalSubrIndex CharSet Encoding CharStringsIndex PrivateDict LocalSubrsIndex )
Index tables
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CFF ¶
type CFF struct { Major uint8 Minor uint8 HdrSize uint8 Fontindex int Font []*Font // contains filtered or unexported fields }
CFF represents a CFF font file
func (*CFF) GetRawIndexData ¶
func (c *CFF) GetRawIndexData(r io.ReadSeeker, index mainIndex) ([]byte, error)
GetRawIndexData returns a byte slice of the index
type Font ¶
type Font struct { CharStrings [][]byte // contains filtered or unexported fields }
Font is a CFF font instance. There can be more than one CFF font in a font file.
func Parse ¶
func Parse(r io.ReadSeeker) (*Font, error)
Parse interprets the CFF data and returns an error or nil.
func (*Font) GetRawIndexData ¶
func (f *Font) GetRawIndexData(r io.ReadSeeker, index mainIndex) ([]byte, error)
GetRawIndexData returns a byte slice of the index
func (*Font) IsCIDFont ¶
IsCIDFont returns true if the character encoding is based on CID instead of SID
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.
Click to show internal directories.
Click to hide internal directories.