Documentation ¶
Overview ¶
Package truetype implements TrueType fonts embedded into PDF files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractEncoding ¶
ExtractEncoding tries to extract an encoding vector from the given encoding dictionary. See section 9.6.5.4 of ISO 32000-2:2020.
TODO(voss): revisit this, once https://github.com/pdf-association/pdf-issues/issues/316 is resolved.
Types ¶
type FontDictComposite ¶ added in v0.4.2
type FontDictComposite struct { // Font is the font to embed (already subsetted, if needed). Font *sfnt.Font // SubsetTag should be a unique tag for the font subset, // or the empty string if this is the full font. SubsetTag string CMap *cmap.Info CID2GID []glyph.ID ForceBold bool IsAllCap bool IsSmallCap bool // ToUnicode (optional) is a map from character codes to unicode strings. ToUnicode *cmap.ToUnicode }
FontDictComposite is the information needed to embed a TrueType font as a composite PDF font.
func ExtractComposite ¶
ExtractComposite extracts information about a composite TrueType font. This is the reverse of FontDictComposite.Embed.
func (*FontDictComposite) Embed ¶ added in v0.4.2
Embed adds a composite TrueType font to a PDF file. This implements the font.Dict interface. This is the reverse of ExtractComposite
type FontDictSimple ¶ added in v0.4.2
type FontDictSimple struct { // Font is the font to embed (already subsetted, if needed). Font *sfnt.Font // SubsetTag should be a unique tag for the font subset, // or the empty string if this is the full font. SubsetTag string // Encoding is the encoding vector used by the client (a slice of length 256). // This may be different from the font's built-in encoding. Encoding []glyph.ID ForceBold bool IsAllCap bool IsSmallCap bool // ToUnicode (optional) is a map from character codes to unicode strings. ToUnicode *cmap.ToUnicode }
FontDictSimple is the information needed to embed a simple TrueType font.
func ExtractSimple ¶
ExtractSimple extracts information about a simple TrueType font. This is the inverse of FontDictSimple.Embed.
func (*FontDictSimple) Embed ¶ added in v0.4.2
Embed adds the font to a PDF file. This implements the font.Dict interface. This is the reverse of ExtractSimple