Documentation
¶
Overview ¶
Package svg parses SVG documents and draws them into pixels, for the icons and pictures of package ui, in Go alone.
It draws paths and the basic shapes, groups, nested svg elements, use and symbol elements, transforms, fills and strokes (with joins, caps and dashes) of colors, currentColor and linear and radial gradients, opacity, clip paths and masks, and style sheets of simple selectors (type, class and id). Text, embedded images, patterns, markers and filters are not drawn.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct {
// contains filtered or unexported fields
}
Doc is a parsed SVG document. Draw may draw it from any goroutine.
func (*Doc) Draw ¶
Draw draws the document over the pixels of dst, fitting its viewBox in them as its preserveAspectRatio says, or stretched to them with stretch. currentColor is current where the document does not set the color property.
func (*Doc) DrawRotated ¶
DrawRotated draws the document as Draw does in a box w×h pixels at the center of dst, turned by degrees clockwise around it.
func (*Doc) Size ¶
Size returns the document's size in pixels: its width and height, or those of its viewBox.
func (*Doc) UsesCurrentColor ¶
UsesCurrentColor reports whether the color Draw takes for currentColor changes what it draws.