bdf

package module
v0.0.0-...-a3af701 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 9 Imported by: 8

README

Glyph Bitmap Distribution Format (BDF) Fonts for Go

Provides the ability to use BDF fonts in Go.

See https://en.wikipedia.org/wiki/Glyph_Bitmap_Distribution_Format for more information about the format.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Character

type Character struct {
	Name       string
	Encoding   rune
	Advance    [2]int
	Alpha      *image.Alpha
	LowerPoint [2]int
}

type Face

type Face struct {
	Font *Font
}

func (*Face) Close

func (f *Face) Close() error

func (*Face) Glyph

func (f *Face) Glyph(dot fixed.Point26_6, r rune) (dr image.Rectangle, mask image.Image, maskp image.Point, advance fixed.Int26_6, ok bool)

func (*Face) GlyphAdvance

func (f *Face) GlyphAdvance(r rune) (advance fixed.Int26_6, ok bool)

func (*Face) GlyphBounds

func (f *Face) GlyphBounds(r rune) (bounds fixed.Rectangle26_6, advance fixed.Int26_6, ok bool)

func (*Face) Kern

func (f *Face) Kern(_, _ rune) fixed.Int26_6

func (*Face) Metrics

func (f *Face) Metrics() font.Metrics

type Font

type Font struct {
	Name        string
	Size        int
	PixelSize   int
	DPI         [2]int
	BPP         int
	Ascent      int
	Descent     int
	CapHeight   int
	XHeight     int
	Characters  []Character
	CharMap     map[rune]*Character
	Encoding    string
	DefaultChar rune
}

func Parse

func Parse(data []byte) (*Font, error)

func (*Font) NewFace

func (f *Font) NewFace() font.Face

Jump to

Keyboard shortcuts

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