bdf

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 18 Imported by: 1

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
}

func (*Character) RenderCharacterImage

func (c *Character) RenderCharacterImage(path string) error

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 FromFile

func FromFile(path string) (f *Font, err error)

FromFile loads the Font from the given file.

func Parse

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

Parse parses the BDF font data.

func (*Font) RenderFontImage

func (f *Font) RenderFontImage(output string, padding int) error

RenderFontImage renders the characters of a font into a single image with grid lines and padding.

Jump to

Keyboard shortcuts

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