avyos.dev/pkg/graphics/svg
package svg
Overview
No package-level documentation is provided.
| Export Group | Count |
|---|---|
| Constants | 0 |
| Variables | 0 |
| Functions | 2 |
| Types | 3 |
Functions
Decode
func Decode(path string, reqSize int, opts Options) (*core.Buffer, error)Decode decodes and rasterizes SVG using an in-tree parser/rasterizer.
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
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.
Options
type Options struct {
TextFace *TextFace
DecodeImage func(path string, reqSize int) (*core.Buffer, error)
}TextFace
type TextFace struct {
Width int
Height int
Glyphs map[rune][]byte
}