bdf

package module
v0.0.0-...-29975f9 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 8 Imported by: 1

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(r0, r1 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
	Ascent     int
	Descent    int
	CapHeight  int
	XHeight    int
	Characters []Character
	Encoding   map[rune]*Character
}

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