Versions in this module Expand all Collapse all v0 v0.5.0 Dec 28, 2020 Changes in this version + func WordWrap(m StringMeasurer, s string, width float64) []string + type GraphicContext interface + ArcTo func(x1, y1, x2, y2, radius float64) + BeginPath func() + Clear func() + Clip func() + ClosePath func() + CurrentPoint func() (float64, float64, bool) + DrawEllipticalArc func(x, y, rx, ry, angle1, angle2 float64) + DrawImageAnchored func(im image.Image, x, y int, ax, ay float64) + DrawLine func(x1, y1, x2, y2 float64) + DrawPoint func(x, y float64) + DrawStringAnchored func(s string, x, y, ax, ay float64) + Fill func() + FillAndStroke func() + FontSize func() float64 + Height func() float64 + Identity func() + LineTo func(x, y float64) + MeasureString func(s string) (w, h float64) + MoveTo func(x, y float64) + Pop func() + Push func() + QuadraticTo func(x1, y1, x2, y2 float64) + ResetClip func() + Rotate func(angle float64) + Scale func(sx, sy float64) + SetFillColor func(r, g, b, a int) + SetFillRule func(f FillRule) + SetFillStyle func(pattern Pattern) + SetFont func(f *truetype.Font) + SetFontSize func(fontSize float64) + SetLineCap func(cap LineCap) + SetLineDash func(dashes ...float64) + SetLineDashOffset func(dashOffset float64) + SetLineJoin func(join LineJoin) + SetPixelColor func(c color.Color, x, y int) + SetStrokeColor func(r, g, b, a int) + SetStrokeStyle func(pattern Pattern) + SetStrokeWeight func(lineWidth float64) + Stroke func() + StrokeWeight func() float64 + TransformPoint func(x, y float64) (float64, float64) + Translate func(tx, ty float64) + Width func() float64 + type SolidPattern struct + Color color.Color + func (p *SolidPattern) ColorAt(x, y int) color.Color + type StringMeasurer interface + MeasureString func(s string) (w, h float64) + type SurfacePattern struct + func (p *SurfacePattern) ColorAt(x, y int) color.Color v0.4.1 Dec 15, 2020 Changes in this version + func Degrees(radians float64) float64 + func LoadFontFace(path string, points float64) (font.Face, error) + func LoadImage(path string) (image.Image, error) + func LoadJPG(path string) (image.Image, error) + func LoadPNG(path string) (image.Image, error) + func LoadTtrueTypeFont(path string) (*truetype.Font, error) + func Radians(degrees float64) float64 + func SaveJPG(path string, im image.Image, quality int) error + func SavePNG(path string, im image.Image) error + type Align int + const AlignCenter + const AlignLeft + const AlignRight + type Context struct + func NewContext(width, height int) *Context + func NewContextForImage(im image.Image) *Context + func NewContextForRGBA(im *image.RGBA) *Context + func (dc *Context) ArcTo(x1, y1, x2, y2, radius float64) + func (dc *Context) AsMask() *image.Alpha + func (dc *Context) Clear() + func (dc *Context) ClearPath() + func (dc *Context) Clip() + func (dc *Context) ClipPreserve() + func (dc *Context) ClosePath() + func (dc *Context) CubicTo(x1, y1, x2, y2, x3, y3 float64) + func (dc *Context) DrawArc(x, y, r, angle1, angle2 float64) + func (dc *Context) DrawCircle(x, y, r float64) + func (dc *Context) DrawEllipse(x, y, rx, ry float64) + func (dc *Context) DrawEllipticalArc(x, y, rx, ry, angle1, angle2 float64) + func (dc *Context) DrawImage(im image.Image, x, y int) + func (dc *Context) DrawImageAnchored(im image.Image, x, y int, ax, ay float64) + func (dc *Context) DrawLine(x1, y1, x2, y2 float64) + func (dc *Context) DrawPoint(x, y, r float64) + func (dc *Context) DrawQuadrilateral(x1, y1, x2, y2, x3, y3, x4, y4 float64) + func (dc *Context) DrawRectangle(x, y, w, h float64) + func (dc *Context) DrawRegularPolygon(n int, x, y, r, rotation float64) + func (dc *Context) DrawRoundedRectangle(x, y, w, h, r float64) + func (dc *Context) DrawRoundedRectangleExtended(x, y, w, h, tl, tr, br, bl float64) + func (dc *Context) DrawString(s string, x, y float64) + func (dc *Context) DrawStringAnchored(s string, x, y, ax, ay float64) + func (dc *Context) DrawStringWrapped(s string, x, y, ax, ay, width, lineSpacing float64, align Align) + func (dc *Context) EncodeJPG(w io.Writer, o *jpeg.Options) error + func (dc *Context) EncodePNG(w io.Writer) error + func (dc *Context) Fill() + func (dc *Context) FillPreserve() + func (dc *Context) FontHeight() float64 + func (dc *Context) GetCurrentPoint() (Point, bool) + func (dc *Context) Height() int + func (dc *Context) Identity() + func (dc *Context) Image() image.Image + func (dc *Context) InvertMask() + func (dc *Context) InvertY() + func (dc *Context) LineTo(x, y float64) + func (dc *Context) LineWidth() float64 + func (dc *Context) LoadFontFace(path string, points float64) error + func (dc *Context) MeasureMultilineString(s string, lineSpacing float64) (width, height float64) + func (dc *Context) MeasureString(s string) (w, h float64) + func (dc *Context) MoveTo(x, y float64) + func (dc *Context) NewSubPath() + func (dc *Context) Pop() + func (dc *Context) Push() + func (dc *Context) QuadraticTo(x1, y1, x2, y2 float64) + func (dc *Context) ResetClip() + func (dc *Context) Rotate(angle float64) + func (dc *Context) RotateAbout(angle, x, y float64) + func (dc *Context) SaveJPG(path string, quality int) error + func (dc *Context) SavePNG(path string) error + func (dc *Context) Scale(x, y float64) + func (dc *Context) ScaleAbout(sx, sy, x, y float64) + func (dc *Context) SetColor(c color.Color) + func (dc *Context) SetDash(dashes ...float64) + func (dc *Context) SetDashOffset(offset float64) + func (dc *Context) SetFillRule(fillRule FillRule) + func (dc *Context) SetFillRuleEvenOdd() + func (dc *Context) SetFillRuleWinding() + func (dc *Context) SetFillStyle(pattern Pattern) + func (dc *Context) SetFontFace(fontFace font.Face) + func (dc *Context) SetHexColor(x string) + func (dc *Context) SetLineCap(lineCap LineCap) + func (dc *Context) SetLineCapButt() + func (dc *Context) SetLineCapRound() + func (dc *Context) SetLineCapSquare() + func (dc *Context) SetLineJoin(lineJoin LineJoin) + func (dc *Context) SetLineJoinBevel() + func (dc *Context) SetLineJoinRound() + func (dc *Context) SetLineWidth(lineWidth float64) + func (dc *Context) SetMask(mask *image.Alpha) error + func (dc *Context) SetPixel(x, y int) + func (dc *Context) SetRGB(r, g, b float64) + func (dc *Context) SetRGB255(r, g, b int) + func (dc *Context) SetRGBA(r, g, b, a float64) + func (dc *Context) SetRGBA255(r, g, b, a int) + func (dc *Context) SetStrokeStyle(pattern Pattern) + func (dc *Context) SetWorldCoordinates(xMin, xMax, yMin, yMax float64) + func (dc *Context) Shear(x, y float64) + func (dc *Context) ShearAbout(sx, sy, x, y float64) + func (dc *Context) Stroke() + func (dc *Context) StrokePreserve() + func (dc *Context) TransformPoint(x, y float64) (tx, ty float64) + func (dc *Context) Translate(x, y float64) + func (dc *Context) Width() int + func (dc *Context) WordWrap(s string, w float64) []string + type FillRule int + const FillRuleEvenOdd + const FillRuleWinding + type LineCap int + const LineCapButt + const LineCapRound + const LineCapSquare + type LineJoin int + const LineJoinBevel + const LineJoinRound + type Matrix struct + X0 float64 + XX float64 + XY float64 + Y0 float64 + YX float64 + YY float64 + func Identity() Matrix + func Rotate(angle float64) Matrix + func Scale(x, y float64) Matrix + func Shear(x, y float64) Matrix + func Translate(x, y float64) 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 interface + ColorAt func(x, y int) color.Color + func NewSolidPattern(color color.Color) Pattern + func NewSurfacePattern(im image.Image, op RepeatOp) Pattern + type Point struct + X float64 + Y float64 + func CubicBezier(x0, y0, x1, y1, x2, y2, x3, y3 float64) []Point + func QuadraticBezier(x0, y0, x1, y1, x2, y2 float64) []Point + func (a Point) Distance(b Point) float64 + func (a Point) Fixed() fixed.Point26_6 + func (a Point) Interpolate(b Point, t float64) Point + type RepeatOp int + const RepeatBoth + const RepeatNone + const RepeatX + const RepeatY