text

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: BSD-3-Clause Imports: 8 Imported by: 6

Documentation

Overview

Package text provides types and functions to parse, format and render text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Latex

type Latex struct {
	// DPI is the dot-per-inch controlling the font resolution used by LaTeX.
	// If zero, the resolution defaults to 72.
	DPI float64
}

Latex parses, formats and renders LaTeX.

func (Latex) Box

func (hdlr Latex) Box(txt string, fnt vg.Font) (width, height, depth vg.Length)

Box returns the bounding box of the given text where:

  • width is the horizontal space from the origin.
  • height is the vertical space above the baseline.
  • depth is the vertical space below the baseline, a negative number.

func (Latex) Draw

func (hdlr Latex) Draw(c *draw.Canvas, txt string, sty draw.TextStyle, pt vg.Point)

Draw renders the given text with the provided style and position on the canvas.

type Plain

type Plain = draw.PlainTextHandler

Plain is a text/plain handler.

Jump to

Keyboard shortcuts

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