Object Definitions
x, y
w
Square(x, y, w int, style ...string)
x, y
h
w
Rect(x, y, w, h int, style ...string)
x, y
h
w
CenterRect(x, y, w, h int, style ...string)
x, y
h
w
ry
rx
Roundrect(x, y, w, h, rx, ry int, style ...string)
x, y
x, y
x, y
x, y
x, y
x, y
Polygon(x, y []int, style ...string)
x, y
r
Circle(x, y, r int, style ...string)
x, y
rx
ry
Ellipse(x, y, rx, ry int, style ...string)
x1, y1
x2, y2
Line(x1, y1, x2, y2 int, style ...string)
x, y
x, y
x, y
x, y
Polyline(x, y []int, style ...string)
sx, sy
ex, ey
Arc(sx, sy, ax, ay, r int, lflag, sflag bool, ex, ey int, style ...string)
x, y
Path(s string, style ...string)
sx, sy
cx, cy
ex, ey
Qbez(sx, sy, cx, cy, ex, ey int, style ...string)
sx, sy
cx, cy
px, py
ex, ey
Bezier(sx, sy, cx, cy, px, py, ex, ey int, style ...string)
x, y
h
w
Image(x, y, w, h, int path string, style ...string)
x1%, y1%
x2%, y2%
LinearGradient(s string, x1, y1, x2, y2 uint8, oc []Offcolor)
cx%, cy%
fx%, fy%
RadialGradient(s string, cx, cy, r, fx, fy uint8, oc []Offcolor)
0, 0
x, y
Translate(x, y int)
x, y
h
w
n
Grid(x, y, w, h, n int, style ...string)
x, y
hello, this is SVG
Text(x, y int, s string, style ...string)
0, 0
Scale(n float64)
0, 0
ScaleXY(x, y float64)
0, 0
SkewX(a float64)
0, 0
SkewY(a float64)
0, 0
SkewXY(x, y float64)
0, 0
Rotate(r float64)
r
It's "fine" & "dandy" to draw text along a path
Textpath(s, pathid string, style ...string)
New(w io Writer)
Start(w, h int, options ...string)/End()
Startview(w, h, minx, miny, vw, vh int)
Group(s ...string)/Gend()
Gstyle(s string)/Gend()
Gtransform(s string)/Gend()
Gid(id string)/Gend()
ClipPath(s ...string)/ClipEnd()
Def()/DefEnd()
Marker()/MarkerEnd()
Pattern()/PatternEnd()
Desc(s string)
Title(s string)
Script(type, data ...string)
Mask(id string, x,y,w,h int, style ...string)/MaskEnd()
Link(href string, title string)/LinkEnd()
Use(x int, y int, link string, style ...string)
specify destination
begin/end the document
begin/end the document with viewport
begin/end group with attributes
begin/end group style
begin/end group transform
begin/end group id
begin/end clip path
begin/end a defintion block
begin/end markers
begin/end pattern
set the description element
set the title element
define a script
begin/end mask element
begin/end link to href, with a title
use defined objects
Textlines(x, y int, s []string, size, spacing int, fill, align string)
r
g
b
->
RGB(r, g, b int)
alpha
r
g
b
->
RGBA(r, g, b int, opacity float64)
SVG Go Library Description
SVG Go Library
github.com/ajstarks/svgo
Object Usage