svg

package
v0.0.0-...-efd2d09 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{
	EmbedFonts:    true,
	SubsetFonts:   false,
	ImageEncoding: canvas.Lossless,
}

Functions

This section is empty.

Types

type Options

type Options struct {
	Compression int
	EmbedFonts  bool
	SubsetFonts bool
	canvas.ImageEncoding
}

type SVG

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

SVG is a scalable vector graphics renderer.

func New

func New(w io.Writer, width, height float64, opts *Options) *SVG

New returns a scalable vector graphics (SVG) renderer.

func (*SVG) AddClass

func (r *SVG) AddClass(class string)

AddClass adds a class to the class list.

func (*SVG) Close

func (r *SVG) Close() error

Close finished and closes the SVG.

func (*SVG) RemoveClass

func (r *SVG) RemoveClass(class string)

RemoveClass removes a class from the class list.

func (*SVG) RenderImage

func (r *SVG) RenderImage(img image.Image, m canvas.Matrix)

RenderImage renders an image to the canvas using a transformation matrix.

func (*SVG) RenderPath

func (r *SVG) RenderPath(path *canvas.Path, style canvas.Style, m canvas.Matrix)

RenderPath renders a path to the canvas using a style and a transformation matrix.

func (*SVG) RenderText

func (r *SVG) RenderText(text *canvas.Text, m canvas.Matrix)

RenderText renders a text object to the canvas using a transformation matrix.

func (*SVG) SetClass

func (r *SVG) SetClass(classes ...string)

SetClass sets the classes to be assigned to drawn objects.

func (*SVG) SetImageEncoding

func (r *SVG) SetImageEncoding(enc canvas.ImageEncoding)

SetImageEncoding sets the image encoding to Loss or Lossless.

func (*SVG) Size

func (r *SVG) Size() (float64, float64)

Size returns the size of the canvas in millimeters.

Jump to

Keyboard shortcuts

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