Documentation ¶
Overview ¶
Package header reads and writes TrueType and OpenType file headers. https://docs.microsoft.com/en-us/typography/opentype/spec/otff#table-directory
Index ¶
Constants ¶
View Source
const ( // ScalerTypeTrueType is the scaler type for fonts which use TrueType // outlines. ScalerTypeTrueType uint32 = 0x00010000 // ScalerTypeCFF is the scaler type for fonts which use CFF // outlines (version 1 or 2). ScalerTypeCFF uint32 = 0x4F54544F // "OTTO" // ScalerTypeApple is recognised as an alternative for ScalerTypeTrueType // on Apple systems. ScalerTypeApple uint32 = 0x74727565 // "true" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrMissing ¶
type ErrMissing struct {
TableName string
}
ErrMissing indicates that a required table is missing from a TrueType or OpenType font file.
func (*ErrMissing) Error ¶
func (err *ErrMissing) Error() string
type Info ¶
Info contains information about the tables present in an sfnt font file.
func Read ¶
Read reads the file header of an sfnt font file. All checksum data is ignored, but basic sanity checks for the table structure are performed.
func (*Info) Has ¶
Has returns true if all of the given tables are present in the font, and none of them are empty.
func (*Info) ReadTableBytes ¶
ReadTableBytes returns the un-decoded table contents.
func (*Info) TableReader ¶
TableReader returns an io.Reader for the given table.
Click to show internal directories.
Click to hide internal directories.