Documentation ¶
Overview ¶
Package opentype implements text layout and shaping for OpenType files.
NOTE: the OpenType specification allows for fonts to include bitmap images in a variety of formats. In the interest of small binary sizes, the opentype package only automatically imports the PNG image decoder. If you have a font with glyphs in JPEG or TIFF formats, register those decoders with the image package in order to ensure those glyphs are visible in text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescriptionToFont ¶
func DescriptionToFont(md metadata.Description) giofont.Font
func FontToDescription ¶
func FontToDescription(font giofont.Font) metadata.Description
func ParseCollection ¶
ParseCollection parse an Opentype font file, with support for collections. Single font files are supported, returning a slice with length 1. The returned fonts are automatically wrapped in a text.FontFace with inferred font metadata. BUG(whereswaldon): the only Variant that can be detected automatically is "Mono".
Types ¶
type Face ¶
type Face struct {
// contains filtered or unexported fields
}
Face is a thread-safe representation of a loaded font. For efficiency, applications should construct a face for any given font file once, reusing it across different text shapers.
Notes ¶
Bugs ¶
the only Variant that can be detected automatically is "Mono".
the only Variant that can be detected automatically is "Mono".