Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type T ¶
type T struct { Embeddable bool UnitsPerEm uint16 PostScriptName string Bold bool ItalicAngle int16 IsFixedPitch bool TypoAscender int16 TypoDescender int16 UnderlinePosition int16 UnderlineThickness int16 Xmin, Ymin, Xmax, Ymax int16 CapHeight int16 Widths []uint16 Chars map[uint16]uint16 }
T contains metrics of a TrueType font.
func Parse ¶
Parse extracts various metrics from a TrueType font file.
Example ¶
font, err := Parse(test.FontDir() + "/calligra.ttf") if err == nil { fmt.Printf("Postscript name: %s\n", font.PostScriptName) fmt.Printf("unitsPerEm: %8d\n", font.UnitsPerEm) fmt.Printf("Xmin: %8d\n", font.Xmin) fmt.Printf("Ymin: %8d\n", font.Ymin) fmt.Printf("Xmax: %8d\n", font.Xmax) fmt.Printf("Ymax: %8d\n", font.Ymax) } else { fmt.Printf("%s\n", err) }
Output: Postscript name: CalligrapherRegular unitsPerEm: 1000 Xmin: -173 Ymin: -234 Xmax: 1328 Ymax: 899
Click to show internal directories.
Click to hide internal directories.