glyphs

package
v0.0.0-...-117f852 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Glyphs

type Glyphs interface {
	Type() Type
	SetSize(float64)
	Width() int
	Height() int
	Ascent() int
}

Glyphs is the interface to a font face.

func LoadTruetype

func LoadTruetype(path string) (Glyphs, error)

LoadTruetype loads a Face from the provided path.

func LoadTruetypeFromBytes

func LoadTruetypeFromBytes(ttf []byte) (Glyphs, error)

LoadTruetypeFromBytes loads a Face from the provided bytes of TTF data.

type ID

type ID uint8

ID is our glyphs ID index.

const (
	Default ID = iota
	Alternate
)

Theses are our default font IDs we provide names for.

type Truetype

type Truetype struct {
	Normal font.Face
	// contains filtered or unexported fields
}

Truetype is our Truetype data.

func (*Truetype) Ascent

func (f *Truetype) Ascent() int

Ascent returns the ascent of the font.

func (*Truetype) Height

func (f *Truetype) Height() int

Height gets the width of the font.

func (*Truetype) SetSize

func (f *Truetype) SetSize(size float64)

SetSize sets the glyph size to the provided size.

func (*Truetype) Type

func (f *Truetype) Type() Type

Type returns FaceTruetype.

func (*Truetype) Width

func (f *Truetype) Width() int

Width gets the width of the font.

type Type

type Type uint8

Type represents the underlying data type of a Glyphs.

const (
	BitmapType Type = iota
	TruetypeType
)

These are our built-in GlyphTypes.

Jump to

Keyboard shortcuts

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