Documentation ¶
Overview ¶
Package freetype2 is a minimal wrapper for the FreeType 2 library, with an API focused around scalable vector fonts.
"FreeType is a software font engine that is designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images). It can be used in graphics libraries, display servers, font conversion tools, text image generation tools, and many other products as well.
Note that FreeType is a font service and doesn't provide APIs to perform higher-level features like text layout or graphics processing (e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly simplifies these tasks by providing a simple, easy to use, and uniform interface to access the content of font files."
Visit http://freetype.org for more on FreeType 2.
Index ¶
- type Face
- func (f *Face) Bounds() image.Rectangle
- func (f *Face) FixedWidth() bool
- func (f *Face) Height() int
- func (f *Face) Image(dst draw.Image, pt image.Point, ch rune) error
- func (f *Face) MaxAdvance() int
- func (f *Face) MaxVerticalAdvance() int
- func (f *Face) Metrics(dst *Metrics, ch rune) error
- func (f *Face) NumFaces() int
- func (f *Face) Pt(pt, dpi int) error
- func (f *Face) Px(px int) error
- type Library
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Face ¶
type Face struct {
// contains filtered or unexported fields
}
Face represents a typeface of a single style.
func (*Face) FixedWidth ¶
FixedWidth returns true if font face is monospaced, where each glyph occupies the same horizontal space.
func (*Face) Image ¶
Image directly copies the rendered bitmap data for the glyph into dst with its top-left corner at pt. Currently, only *image.Alpha is supported.
func (*Face) MaxAdvance ¶
MaxAdvance returns the maximum advance width in pixels.
func (*Face) MaxVerticalAdvance ¶
MaxVerticalAdvance returns the maximum advance height (for vertical layout) in pixels.