Documentation ¶
Overview ¶
The freetype package provides a convenient API to draw text onto an image. Use the freetype/raster and freetype/truetype packages for lower level control over rasterization and TrueType parsing.
Index ¶
- func ParseFont(b []byte) (*truetype.Font, error)
- func Pt(x, y int) fixed.Point26_6
- type Context
- func (c *Context) DrawString(s string, p fixed.Point26_6) (fixed.Point26_6, error)
- func (c *Context) PointToFixed(x float64) fixed.Int26_6
- func (c *Context) SetClip(clip image.Rectangle)
- func (c *Context) SetDPI(dpi float64)
- func (c *Context) SetDst(dst draw.Image)
- func (c *Context) SetFont(f *truetype.Font)
- func (c *Context) SetFontSize(fontSize float64)
- func (c *Context) SetHinting(hinting font.Hinting)
- func (c *Context) SetSrc(src image.Image)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
A Context holds the state for drawing text in a given font and size.
func (*Context) DrawString ¶
func (*Context) PointToFixed ¶
PointToFixed converts the given number of points (as in "a 12 point font") into a 26.6 fixed point number of pixels.
func (*Context) SetFontSize ¶
SetFontSize sets the font size in points (as in "a 12 point font").
func (*Context) SetHinting ¶
SetHinting sets the hinting policy.
Click to show internal directories.
Click to hide internal directories.