resvg

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: GPL-3.0 Imports: 14 Imported by: 18 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

椛

resvg-go


A SVG render written in Go & WASM depended on resvg without CGO

Example

// initialize and don't forget to close!
ctx, _ := NewContext(context.Background())
defer ctx.Close()
renderer, _ := ctx.NewRenderer()
defer renderer.Close()

// render the SVG as a PNG!
png, _ := renderer.Render(svg)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx context.Context) (*Context, error)

func (*Context) Close

func (ctx *Context) Close() error

func (*Context) NewRenderer

func (ctx *Context) NewRenderer() (*Renderer, error)

type Renderer

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

func (*Renderer) Close

func (r *Renderer) Close() error

func (*Renderer) LoadFontData

func (r *Renderer) LoadFontData(data []byte) error

func (*Renderer) LoadFontDir

func (r *Renderer) LoadFontDir(dir string) error

func (*Renderer) LoadFontFile

func (r *Renderer) LoadFontFile(file string) error

func (*Renderer) LoadSystemFonts

func (r *Renderer) LoadSystemFonts() (err error)

func (*Renderer) Render

func (r *Renderer) Render(svg []byte) ([]byte, error)

func (*Renderer) RenderWithSize

func (r *Renderer) RenderWithSize(svg []byte, width, height uint32) ([]byte, error)

func (*Renderer) SetDefaultSize

func (r *Renderer) SetDefaultSize(width, height float32) error

func (*Renderer) SetDpi

func (r *Renderer) SetDpi(dpi float32) error

func (*Renderer) SetFontFamily

func (r *Renderer) SetFontFamily(family string) error

func (*Renderer) SetFontSize

func (r *Renderer) SetFontSize(size float32) error

func (*Renderer) SetKeepNamedGroups

func (r *Renderer) SetKeepNamedGroups(iskeep bool) error

func (*Renderer) SetLanguages

func (r *Renderer) SetLanguages(languages string) error

func (*Renderer) SetResourcesDir

func (r *Renderer) SetResourcesDir(dir string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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