Documentation ¶
Index ¶
- Variables
- func AssertFloatAttribute(attr *tokens.StringDict, key string) error
- func BuildPath(attr *tokens.StringDict, d []PathCommand, ctx context.Context) (tree.Tag, error)
- func BuildTag(key string, attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func CompressFloatAttribute(attr *tokens.StringDict, key string, fn func(float64) float64)
- func CompressStyles(attr *tokens.StringDict, vb tree.SVGViewBox)
- func IsTag(key string) bool
- func MinifyStyles(attr *tokens.StringDict, containsText bool)
- func NewDefs(attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func NewGeneric(key string, attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func NewGroup(attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func NewInkscapeGrid(attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func NewMetadata(attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func NewRect(attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func NewSodiPodiNamedView(attr *tokens.StringDict, ctx context.Context) (tree.SVGTag, error)
- func SegmentsLength(segments []PathSegment) float64
- func SegmentsPosition(segments []PathSegment, t float64) (float64, float64)
- type Arc
- type ArcBy
- type ArcCoreData
- type ArcTo
- type Close
- type Cubic
- type CubicBy
- type CubicTo
- type Defs
- type ExtraCubicBy
- type ExtraCubicTo
- type ExtraQuadraticBy
- type ExtraQuadraticTo
- type GenBuilder
- type Generic
- type Group
- type HorBy
- type HorTo
- type InkscapeGrid
- type Line
- type LineBy
- type LineTo
- type Metadata
- type MoveBy
- type MoveTo
- type NoChildrenBuilder
- type Path
- type PathCommand
- type PathCommandData
- type PathSegment
- type PathSegmentData
- type Quadratic
- type QuadraticBy
- type QuadraticTo
- type Rect
- type SodiPodiNamedView
- type TagBuilder
- type TextChildBuilder
- type VerBy
- type VerTo
Constants ¶
This section is empty.
Variables ¶
View Source
var (
COMPRESS = false
)
Functions ¶
func AssertFloatAttribute ¶
func AssertFloatAttribute(attr *tokens.StringDict, key string) error
func BuildPath ¶
func BuildPath(attr *tokens.StringDict, d []PathCommand, ctx context.Context) (tree.Tag, error)
func CompressFloatAttribute ¶
func CompressFloatAttribute(attr *tokens.StringDict, key string, fn func(float64) float64)
func CompressStyles ¶
func CompressStyles(attr *tokens.StringDict, vb tree.SVGViewBox)
func MinifyStyles ¶
func MinifyStyles(attr *tokens.StringDict, containsText bool)
func NewGeneric ¶
func NewInkscapeGrid ¶
func NewMetadata ¶
func NewSodiPodiNamedView ¶
func SegmentsLength ¶
func SegmentsLength(segments []PathSegment) float64
func SegmentsPosition ¶
func SegmentsPosition(segments []PathSegment, t float64) (float64, float64)
Types ¶
type Arc ¶
type Arc struct { PathSegmentData ArcCoreData // contains filtered or unexported fields }
func NewArc ¶
func NewArc(start, stop PathCommand, x0, y0, x1, y1 float64, rx, ry, xAxisRot float64, largeArc, positiveSweep bool) *Arc
func (*Arc) Reverse ¶
func (s *Arc) Reverse() PathSegment
type ArcBy ¶
type ArcBy struct { ArcCoreData PathCommandData // contains filtered or unexported fields }
func (*ArcBy) Compress ¶
func (c *ArcBy) Compress(vb tree.SVGViewBox)
type ArcCoreData ¶
type ArcCoreData struct {
// contains filtered or unexported fields
}
func (*ArcCoreData) Compress ¶
func (c *ArcCoreData) Compress(vb tree.SVGViewBox)
type ArcTo ¶
type ArcTo struct { ArcCoreData PathCommandData // contains filtered or unexported fields }
func (*ArcTo) Compress ¶
func (c *ArcTo) Compress(vb tree.SVGViewBox)
type Close ¶
type Close struct {
PathCommandData
}
func (*Close) Compress ¶
func (c *Close) Compress(vb tree.SVGViewBox)
type Cubic ¶
type Cubic struct { PathSegmentData // contains filtered or unexported fields }
func NewCubic ¶
func NewCubic(start, stop PathCommand, x0, y0, x1, y1 float64, xa, ya, xb, yb float64) *Cubic
func (*Cubic) Reverse ¶
func (s *Cubic) Reverse() PathSegment
type CubicBy ¶
type CubicBy struct { PathCommandData // contains filtered or unexported fields }
func (*CubicBy) Compress ¶
func (c *CubicBy) Compress(vb tree.SVGViewBox)
type CubicTo ¶
type CubicTo struct { PathCommandData // contains filtered or unexported fields }
func (*CubicTo) Compress ¶
func (c *CubicTo) Compress(vb tree.SVGViewBox)
type ExtraCubicBy ¶
type ExtraCubicBy struct { PathCommandData // contains filtered or unexported fields }
func NewExtraCubicBy ¶
func NewExtraCubicBy(dx2, dy2, dx, dy float64, ctx context.Context) *ExtraCubicBy
func (*ExtraCubicBy) Compress ¶
func (c *ExtraCubicBy) Compress(vb tree.SVGViewBox)
func (*ExtraCubicBy) Write ¶
func (c *ExtraCubicBy) Write() string
type ExtraCubicTo ¶
type ExtraCubicTo struct { PathCommandData // contains filtered or unexported fields }
func NewExtraCubicTo ¶
func NewExtraCubicTo(x2, y2, x, y float64, ctx context.Context) *ExtraCubicTo
func (*ExtraCubicTo) Compress ¶
func (c *ExtraCubicTo) Compress(vb tree.SVGViewBox)
func (*ExtraCubicTo) Write ¶
func (c *ExtraCubicTo) Write() string
type ExtraQuadraticBy ¶
type ExtraQuadraticBy struct { PathCommandData // contains filtered or unexported fields }
func NewExtraQuadraticBy ¶
func NewExtraQuadraticBy(dx, dy float64, ctx context.Context) *ExtraQuadraticBy
func (*ExtraQuadraticBy) Compress ¶
func (c *ExtraQuadraticBy) Compress(vb tree.SVGViewBox)
func (*ExtraQuadraticBy) Write ¶
func (c *ExtraQuadraticBy) Write() string
type ExtraQuadraticTo ¶
type ExtraQuadraticTo struct { PathCommandData // contains filtered or unexported fields }
func NewExtraQuadraticTo ¶
func NewExtraQuadraticTo(x, y float64, ctx context.Context) *ExtraQuadraticTo
func (*ExtraQuadraticTo) Compress ¶
func (c *ExtraQuadraticTo) Compress(vb tree.SVGViewBox)
func (*ExtraQuadraticTo) Write ¶
func (c *ExtraQuadraticTo) Write() string
type GenBuilder ¶
type GenBuilder struct { }
type Generic ¶
type Generic struct {
tree.SVGTagData
}
func (*Generic) Compress ¶
func (t *Generic) Compress(vb tree.SVGViewBox)
type Group ¶
type Group struct {
tree.SVGTagData
}
func (*Group) Compress ¶
func (t *Group) Compress(vb tree.SVGViewBox)
type HorBy ¶
type HorBy struct { PathCommandData // contains filtered or unexported fields }
func (*HorBy) Compress ¶
func (c *HorBy) Compress(vb tree.SVGViewBox)
type HorTo ¶
type HorTo struct { PathCommandData // contains filtered or unexported fields }
func (*HorTo) Compress ¶
func (c *HorTo) Compress(vb tree.SVGViewBox)
type InkscapeGrid ¶
type InkscapeGrid struct {
tree.SVGTagData
}
type Line ¶
type Line struct {
PathSegmentData
}
func NewLine ¶
func NewLine(start, stop PathCommand, x0, y0, x1, y1 float64) *Line
func (*Line) Reverse ¶
func (s *Line) Reverse() PathSegment
type LineBy ¶
type LineBy struct { PathCommandData // contains filtered or unexported fields }
func (*LineBy) Compress ¶
func (c *LineBy) Compress(vb tree.SVGViewBox)
type LineTo ¶
type LineTo struct { PathCommandData // contains filtered or unexported fields }
func (*LineTo) Compress ¶
func (c *LineTo) Compress(vb tree.SVGViewBox)
type Metadata ¶
type Metadata struct {
tree.SVGTagData
}
type MoveBy ¶
type MoveBy struct { PathCommandData // contains filtered or unexported fields }
func (*MoveBy) Compress ¶
func (c *MoveBy) Compress(vb tree.SVGViewBox)
type MoveTo ¶
type MoveTo struct { PathCommandData // contains filtered or unexported fields }
func (*MoveTo) Compress ¶
func (c *MoveTo) Compress(vb tree.SVGViewBox)
type NoChildrenBuilder ¶
type NoChildrenBuilder struct { }
type Path ¶
type Path struct { tree.SVGTagData // contains filtered or unexported fields }
func (*Path) Compress ¶
func (t *Path) Compress(vb tree.SVGViewBox)
type PathCommand ¶
type PathCommand interface { Write() string Compress(tree.SVGViewBox) Context() context.Context }
other operations are done by inference
func ParsePathString ¶
func ParsePathString(d string, ctx context.Context) ([]PathCommand, error)
func ShortenEnds ¶
func ShortenEnds(pcs []PathCommand, dStart, dEnd float64, ctx context.Context) ([]PathCommand, error)
type PathCommandData ¶
type PathCommandData struct {
// contains filtered or unexported fields
}
func (*PathCommandData) Context ¶
func (c *PathCommandData) Context() context.Context
type PathSegment ¶
type PathSegment interface { Length() float64 // f between 0 and 1 Position(f float64) (float64, float64) // f between 0 and 1 Tangent(f float64) (float64, float64) // pointing from start to end, normalized Reverse() PathSegment Context() context.Context }
func GenerateSegments ¶
func GenerateSegments(pcs []PathCommand, ctx context.Context) ([]PathSegment, error)
type PathSegmentData ¶
type PathSegmentData struct {
// contains filtered or unexported fields
}
func (*PathSegmentData) Context ¶
func (s *PathSegmentData) Context() context.Context
type Quadratic ¶
type Quadratic struct { PathSegmentData // contains filtered or unexported fields }
func NewQuadratic ¶
func NewQuadratic(start, stop PathCommand, x0, y0, x1, y1 float64, xa, ya float64) *Quadratic
func (*Quadratic) Reverse ¶
func (s *Quadratic) Reverse() PathSegment
type QuadraticBy ¶
type QuadraticBy struct { PathCommandData // contains filtered or unexported fields }
func NewQuadraticBy ¶
func NewQuadraticBy(dx1, dy1, dx, dy float64, ctx context.Context) *QuadraticBy
func (*QuadraticBy) Compress ¶
func (c *QuadraticBy) Compress(vb tree.SVGViewBox)
func (*QuadraticBy) Write ¶
func (c *QuadraticBy) Write() string
type QuadraticTo ¶
type QuadraticTo struct { PathCommandData // contains filtered or unexported fields }
func NewQuadraticTo ¶
func NewQuadraticTo(x1, y1, x, y float64, ctx context.Context) *QuadraticTo
func (*QuadraticTo) Compress ¶
func (c *QuadraticTo) Compress(vb tree.SVGViewBox)
func (*QuadraticTo) Write ¶
func (c *QuadraticTo) Write() string
type Rect ¶
type Rect struct {
tree.SVGTagData
}
func (*Rect) Compress ¶
func (t *Rect) Compress(vb tree.SVGViewBox)
type SodiPodiNamedView ¶
type SodiPodiNamedView struct {
tree.SVGTagData
}
func (*SodiPodiNamedView) Minify ¶
func (t *SodiPodiNamedView) Minify() bool
type TagBuilder ¶
type TextChildBuilder ¶
type TextChildBuilder struct { }
type VerBy ¶
type VerBy struct { PathCommandData // contains filtered or unexported fields }
func (*VerBy) Compress ¶
func (c *VerBy) Compress(vb tree.SVGViewBox)
Click to show internal directories.
Click to hide internal directories.