svg

package
v0.0.0-...-155abb7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(path string, reqSize int, opts Options) (*core.Buffer, error)

Decode decodes and rasterizes SVG using an in-tree parser/rasterizer.

func DecodeFile

func DecodeFile(path string, reqSize int, opts ...DecodeFileOptions) (*core.Buffer, error)

DecodeFile decodes an SVG file into a pixel buffer. Nested image references are resolved relative to the SVG's directory.

Types

type DecodeFileOptions

type DecodeFileOptions struct {
	TextFace *TextFace
	// DecodeImage overrides nested <image href="..."> loading.
	// If nil, nested images are decoded recursively by extension.
	DecodeImage func(path string, reqSize int) (*core.Buffer, error)
}

DecodeFileOptions controls high-level SVG file decoding behavior.

type Options

type Options struct {
	TextFace    *TextFace
	DecodeImage func(path string, reqSize int) (*core.Buffer, error)
}

type TextFace

type TextFace struct {
	Width  int
	Height int
	Glyphs map[rune][]byte
}

Jump to

Keyboard shortcuts

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