font

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Unlicense Imports: 3 Imported by: 0

Documentation

Overview

package font converts an OpenType font into a form usable for engraving.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Face

type Face struct {
	Metrics Metrics
	// Index maps a character to its segment range.
	Index [unicode.MaxASCII]Glyph
	// Segments encoded as opcode, args, opcode, args...
	Segments []uint32
}

func (*Face) Decode

func (f *Face) Decode(ch rune) (float32, []Segment, bool)

type Glyph

type Glyph struct {
	Advance    float32
	Start, End uint16
}

type Metrics

type Metrics struct {
	Ascent, Height float32
}

type Segment

type Segment struct {
	Op   SegmentOp
	Args [3]f32.Vec2
}

Segment is like sfnt.Segment but with float32 coordinates.

type SegmentOp

type SegmentOp uint32
const (
	SegmentOpMoveTo SegmentOp = iota
	SegmentOpLineTo
	SegmentOpQuadTo
	SegmentOpCubeTo
)

Directories

Path Synopsis
Code generated DO NOT EDIT.
Code generated DO NOT EDIT.

Jump to

Keyboard shortcuts

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