ps

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0, MIT Imports: 11 Imported by: 0 modules, 0 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.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = Options{}

Functions

This section is empty.

Types

type Format

type Format int
const (
	PostScript Format = iota
	EncapsulatedPostScript
)

type Options

type Options struct {
	Format

	Creator string
}

type PS

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

PS is an PostScript renderer. Be aware that PostScript does not support transparency of colors.

func New

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

New returns an PostScript renderer.

func (*PS) Close

func (r *PS) Close() error

Close finishes the document once and preserves the first output error.

func (*PS) Err

func (r *PS) Err() error

Err returns the first output error, including short writes.

func (*PS) NewPage

func (r *PS) NewPage(width, height float64) error

NewPage finishes the previous page and starts a page with millimeter dimensions.

func (*PS) RenderClippedImage

func (r *PS) RenderClippedImage(img image.Image, m canvas.Matrix, clip *canvas.Path)

RenderClippedImage uses the image-local, Y-up clip supplied by canvas.

func (*PS) RenderClippedPath

func (r *PS) RenderClippedPath(path *canvas.Path, style canvas.Style, m canvas.Matrix, clip *canvas.Path)

RenderClippedPath preserves path-local clipping without intersecting outlines.

func (*PS) RenderClippedText

func (r *PS) RenderClippedText(text *canvas.Text, m canvas.Matrix, clip *canvas.Path)

RenderClippedText preserves text-local clipping around glyph outlines.

func (*PS) RenderImage

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

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

func (*PS) RenderPath

func (r *PS) 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 (*PS) RenderText

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

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

func (*PS) Size

func (r *PS) 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