Documentation ¶
Overview ¶
Package glyf reads and writes "glyf" and "loca" tables. https://docs.microsoft.com/en-us/typography/opentype/spec/glyf https://docs.microsoft.com/en-us/typography/opentype/spec/loca
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComponentFlag ¶ added in v0.4.0
type ComponentFlag uint16
const ( FlagArg1And2AreWords ComponentFlag = 0x0001 FlagArgsAreXYValues ComponentFlag = 0x0002 FlagRoundXYToGrid ComponentFlag = 0x0004 FlagWeHaveAScale ComponentFlag = 0x0008 FlagMoreComponents ComponentFlag = 0x0020 FlagWeHaveAnXAndYScale ComponentFlag = 0x0040 FlagWeHaveATwoByTwo ComponentFlag = 0x0080 FlagWeHaveInstructions ComponentFlag = 0x0100 FlagUseMyMetrics ComponentFlag = 0x0200 FlagOverlapCompound ComponentFlag = 0x0400 FlagScaledComponentOffset ComponentFlag = 0x0800 FlagUnscaledComponentOffset ComponentFlag = 0x1000 )
The recognised values for the ComponentFlag field.
https://learn.microsoft.com/en-us/typography/opentype/spec/glyf#compositeGlyphFlags
func (ComponentFlag) String ¶ added in v0.4.0
func (f ComponentFlag) String() string
type CompositeGlyph ¶
type CompositeGlyph struct { Components []GlyphComponent Instructions []byte }
CompositeGlyph is a composite glyph.
type Glyph ¶
Glyph represents a single glyph in a TrueType font.
func (*Glyph) Components ¶
Components returns the components of a composite glyph, or nil if the glyph is simple.
type GlyphComponent ¶
type GlyphComponent struct { Flags ComponentFlag GlyphIndex glyph.ID Data []byte }
GlyphComponent is a single component of a composite glyph.
https://learn.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description
type Glyphs ¶
type Glyphs []*Glyph
Glyphs contains a slice of TrueType glyph outlines. This represents the information stored in the "glyf" and "loca" tables of a TrueType font.
type Outlines ¶
type Outlines struct { // Glyphs is a slice of glyph outlines in the font. Glyphs Glyphs // Widths contains the glyph widths, indexed by glyph ID. Widths []funit.Int16 // Names, if non-nil, contains the glyph names. Names []string // Tables contains the raw contents of the "cvt ", "fpgm", "prep", "gasp" // tables. Tables map[string][]byte // Maxp contains information from the "maxp" table. Maxp *maxp.TTFInfo }
Outlines stores the glyph data of a TrueType font.
type SimpleGlyph ¶
SimpleGlyph is a simple glyph.
func (*SimpleGlyph) Decode ¶
func (glyph *SimpleGlyph) Decode() (*GlyphInfo, error)
Decode returns the contours of a glyph.