Documentation ¶
Overview ¶
Package cff implements CFF font data embedded into PDF files.
CFF fonts can be embedded into a PDF file either as "simple fonts" or as "composite fonts".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FontDictComposite ¶ added in v0.4.2
type FontDictComposite struct { // Font is the font to embed (already subsetted, if needed). Font *cff.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 UnitsPerEm uint16 // TODO(voss): get this from the font matrix instead? Ascent funit.Int16 Descent funit.Int16 CapHeight funit.Int16 IsSerif bool IsScript 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 CFF font as a composite PDF font.
func ExtractComposite ¶
ExtractComposite extracts information about a composite CFF font from a PDF file. This is the reverse of FontDictComposite.Embed.
func (*FontDictComposite) Embed ¶ added in v0.4.2
Embed adds a composite CFF 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 *cff.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 // TODO(voss): use PDF text space units Ascent funit.Int16 Descent funit.Int16 CapHeight funit.Int16 IsSerif bool IsScript 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 CFF font.
func ExtractSimple ¶
ExtractSimple extracts information about a simple CFF font from a PDF file. 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