font

package
v0.0.0-...-3435f2a Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Atom

type Atom struct {
	Advance    bag.ScaledPoint
	Height     bag.ScaledPoint
	Depth      bag.ScaledPoint
	IsSpace    bool
	Components string
	Codepoint  int
	Hyphenate  bool
	Kernafter  bag.ScaledPoint
}

An Atom contains size information about the glyphs as a result of Shape

type Font

type Font struct {
	Space        bag.ScaledPoint
	SpaceStretch bag.ScaledPoint
	SpaceShrink  bag.ScaledPoint
	Size         bag.ScaledPoint
	Depth        bag.ScaledPoint
	Face         *pdf.Face
	Hyphenchar   Atom
	SpaceChar    Atom
	Mag          int
}

Font is the main structure of a font instance

func NewFont

func NewFont(face *pdf.Face, size bag.ScaledPoint) *Font

NewFont creates a new font instance.

func (*Font) Shape

func (f *Font) Shape(text string, features []harfbuzz.Feature) []Atom

Shape transforms the text into a slice of code points.

Jump to

Keyboard shortcuts

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