Documentation ¶
Index ¶
- func ParseColor(str string) stdcol.Color
- func ParseStyle(str string, attrs map[string]string)
- func ParseTransform(str string) *g2d.Aff3
- func ParseUrlId(str string) string
- func ParseValue(str string) float64
- func ParseValueUnit(str string) (float64, string)
- func ParseViewBox(str string) [][]float64
- func PathsFromDescription(desc string) []*g2d.Path
- type SVG
- func (svg *SVG) CircleElt(elt *xml.Element)
- func (svg *SVG) ClipPathElt(elt *xml.Element)
- func (svg *SVG) Copy() *SVG
- func (svg *SVG) DefsElt(elt *xml.Element)
- func (svg *SVG) EllipseElt(elt *xml.Element)
- func (svg *SVG) FillStroke(elt *xml.Element, bb [][]float64) (*g2d.Pen, *g2d.Pen)
- func (svg *SVG) GroupElt(elt *xml.Element)
- func (svg *SVG) LineElt(elt *xml.Element)
- func (svg *SVG) PathElt(elt *xml.Element)
- func (svg *SVG) PolygonElt(elt *xml.Element)
- func (svg *SVG) PolylineElt(elt *xml.Element)
- func (svg *SVG) Process(elt *xml.Element)
- func (svg *SVG) RectElt(elt *xml.Element)
- func (svg *SVG) SVGElt(elt *xml.Element)
- func (svg *SVG) Transform(elt *xml.Element) *g2d.Aff3
- func (svg *SVG) UseElt(elt *xml.Element)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseColor ¶
func ParseStyle ¶
func ParseTransform ¶
func ParseUrlId ¶
func ParseValue ¶
func ParseValueUnit ¶
func ParseViewBox ¶
func PathsFromDescription ¶
Types ¶
type SVG ¶
type SVG struct { Xfm *g2d.Aff3 // Path transform Clip map[string]*g2d.Shape // Clip path ids to clip shapes Defs map[string]*xml.Element // Element ids to elements Rend *g2d.Renderable // Renderable paths and fillers }
SVG contains the current context - the image being drawn into, the style and view transforms, and the defined clip paths and shapes.
func Draw ¶
Draw is a convenience function to render the svg dom into an image. The svg is scaled to the image size.
func (*SVG) ClipPathElt ¶
func (*SVG) EllipseElt ¶
func (*SVG) FillStroke ¶
func (*SVG) PolygonElt ¶
func (*SVG) PolylineElt ¶
Click to show internal directories.
Click to hide internal directories.