svg

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attr

func Attr(k, v string) string

func Float

func Float(v float64) string

func SetIgnoreImage

func SetIgnoreImage(v bool) func(*SvgWriteOption)

Types

type Canvas

type Canvas struct {
	*svg.SVG
	// contains filtered or unexported fields
}

type OffColor

type OffColor struct {
	// contains filtered or unexported fields
}

type PathBuilder

type PathBuilder struct {
	strings.Builder
	// contains filtered or unexported fields
}

func (*PathBuilder) IsClip

func (b *PathBuilder) IsClip() bool

func (*PathBuilder) IsCompound

func (b *PathBuilder) IsCompound() bool

func (*PathBuilder) Reset

func (b *PathBuilder) Reset()

func (*PathBuilder) SetAsClip

func (b *PathBuilder) SetAsClip()

func (*PathBuilder) SetAsCompound

func (b *PathBuilder) SetAsCompound()

func (*PathBuilder) UnsetClip

func (b *PathBuilder) UnsetClip()

func (*PathBuilder) UnsetCompound

func (b *PathBuilder) UnsetCompound()

type SVG

type SVG struct {
	// contains filtered or unexported fields
}

func (*SVG) ApplyClip

func (svg *SVG) ApplyClip()

func (*SVG) BeginLayer

func (svg *SVG) BeginLayer(layer *illustrator.AILayer)

func (*SVG) ClipPath

func (svg *SVG) ClipPath()

func (*SVG) ClosePath

func (svg *SVG) ClosePath()

func (*SVG) CompoundPath

func (svg *SVG) CompoundPath()

func (*SVG) Curveto

func (svg *SVG) Curveto(x0, y0, x1, y1, x2, y2 float64)

func (*SVG) Curveto1

func (svg *SVG) Curveto1(x0, y0, x1, y1 float64)

func (*SVG) Curveto2

func (svg *SVG) Curveto2(x1, y1, x2, y2 float64)

func (*SVG) DefGradient

func (svg *SVG) DefGradient(g *illustrator.Gradient)

func (*SVG) EndCompoundPath

func (svg *SVG) EndCompoundPath()

func (*SVG) EndGroup

func (svg *SVG) EndGroup()

func (*SVG) EndLayer

func (svg *SVG) EndLayer()

func (*SVG) Group

func (svg *SVG) Group()

func (*SVG) Lineto

func (svg *SVG) Lineto(x, y float64)

func (*SVG) Moveto

func (svg *SVG) Moveto(x, y float64)

func (*SVG) Nodes

func (svg *SVG) Nodes(depth int) []SvgNode

func (*SVG) PathRender

func (svg *SVG) PathRender(t illustrator.PathOp)

func (*SVG) Save

func (svg *SVG) Save(path string, options ...func(*SvgWriteOption)) error

func (*SVG) SetCMYK

func (svg *SVG) SetCMYK(t illustrator.PathOp, cmyk [4]float64)

func (*SVG) SetDash

func (svg *SVG) SetDash()

func (*SVG) SetFlat

func (svg *SVG) SetFlat()

func (*SVG) SetGradient

func (svg *SVG) SetGradient(g *illustrator.Gradient)

func (*SVG) SetGroupAttr

func (svg *SVG) SetGroupAttr()

func (*SVG) SetHeader

func (svg *SVG) SetHeader(header *illustrator.AIHeader)

func (*SVG) SetLayerName

func (svg *SVG) SetLayerName(name string)

func (*SVG) SetLineCap

func (svg *SVG) SetLineCap(v string)

func (*SVG) SetLineJoin

func (svg *SVG) SetLineJoin(v string)

func (*SVG) SetLineWidth

func (svg *SVG) SetLineWidth(v string)

func (*SVG) SetMiterLimit

func (svg *SVG) SetMiterLimit(v string)

func (*SVG) SetOpacity

func (svg *SVG) SetOpacity(opacity string)

func (*SVG) SetRGB

func (svg *SVG) SetRGB(t illustrator.PathOp, rgb [3]uint8)

func (*SVG) SetRaster

func (svg *SVG) SetRaster(raster *illustrator.Raster)

type StyleBuild

type StyleBuild map[string]string

type SvgCompoundPath

type SvgCompoundPath struct {
	*SvgPath
}

type SvgGradient

type SvgGradient struct {
	Defs      []illustrator.Gradient
	Instances []illustrator.Gradient
}

type SvgGroup

type SvgGroup struct {
	// contains filtered or unexported fields
}

func (*SvgGroup) AddNode

func (g *SvgGroup) AddNode(node SvgNode)

func (*SvgGroup) Attrs

func (g *SvgGroup) Attrs() []string

func (*SvgGroup) Childs

func (g *SvgGroup) Childs() []SvgNode

func (*SvgGroup) Id

func (g *SvgGroup) Id() string

func (*SvgGroup) Indent

func (g *SvgGroup) Indent() int

func (*SvgGroup) SetAttr

func (g *SvgGroup) SetAttr(k, v string)

type SvgImage

type SvgImage struct {
	// contains filtered or unexported fields
}

func (*SvgImage) Id

func (si *SvgImage) Id() string

func (*SvgImage) Indent

func (si *SvgImage) Indent() int

func (*SvgImage) SetAttr

func (si *SvgImage) SetAttr(key, val string)

func (*SvgImage) SetImage

func (si *SvgImage) SetImage(b64data string)

type SvgNode

type SvgNode interface {
	Id() string
	Indent() int // 元素层级/缩进
	SetAttr(k, v string)
}

type SvgPath

type SvgPath struct {
	// contains filtered or unexported fields
}

func (*SvgPath) Attrs

func (sp *SvgPath) Attrs() []string

func (*SvgPath) Id

func (sp *SvgPath) Id() string

func (*SvgPath) Indent

func (sp *SvgPath) Indent() int

func (*SvgPath) SetAttr

func (sp *SvgPath) SetAttr(k, v string)

func (*SvgPath) SetStyle

func (sp *SvgPath) SetStyle(v string)

type SvgWriteOption

type SvgWriteOption struct {
	IgnoreImage bool // 忽略位图数据, 保存为svg的时候, image数据不会写入
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL