Documentation ¶
Index ¶
- func LoadFontFace(path string, points float64) (font.Face, error)
- func SavePNG(path string, im image.Image) error
- type Align
- type Context
- func (dc *Context) Clear()
- func (dc *Context) DrawStringAnchored(s string, x, y, ax, ay float64)
- func (dc *Context) LoadFontFace(path string, points float64) error
- func (dc *Context) MeasureString(s string) (w, h float64)
- func (dc *Context) SavePNG(path string) error
- func (dc *Context) SetRGB(r float64)
- func (dc *Context) SetRGBA(r float64)
- type FillRule
- type LineCap
- type LineJoin
- type Matrix
- func (a Matrix) Multiply(b Matrix) Matrix
- func (a Matrix) Rotate(angle float64) Matrix
- func (a Matrix) Scale(x, y float64) Matrix
- func (a Matrix) Shear(x, y float64) Matrix
- func (a Matrix) TransformPoint(x, y float64) (tx, ty float64)
- func (a Matrix) TransformVector(x, y float64) (tx, ty float64)
- func (a Matrix) Translate(x, y float64) Matrix
- type Pattern
- type Point
- type RepeatOp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFontFace ¶
LoadFontFace is a helper function to load the specified font file with the specified point size. Note that the returned `font.Face` objects are not thread safe and cannot be used in parallel across goroutines. You can usually just use the Context.LoadFontFace function instead of this package-level function.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
NewContext creates a new image.RGBA with the specified width and height and prepares a context for rendering onto that image.
func NewContextForGray ¶
NewContextForRGBA prepares a context for rendering onto the specified image. No copy is made.
func (*Context) Clear ¶
func (dc *Context) Clear()
Clear fills the entire image with the current color.
func (*Context) DrawStringAnchored ¶
DrawStringAnchored draws the specified text at the specified anchor point. The anchor point is x - w * ax, y - h * ay, where w, h is the size of the text. Use ax=0.5, ay=0.5 to center the text at the specified point.
func (*Context) MeasureString ¶
MeasureString returns the rendered width and height of the specified text given the current font face.
type Matrix ¶
type Matrix struct {
XX, YX, XY, YY, X0, Y0 float64
}