Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 1.09 KB

README.md

File metadata and controls

66 lines (51 loc) · 1.09 KB

bdf-explorer

Quick BDF font utility, because I needed one. Forked from zachomedia/go-bdf - thanks!

commandline usage

bdf-explorer -font "<path>" 

Generates a png with a grid of all characters.

bdf-explorer -font "<path>"  -export

Generates a png with a grid of all and exports each character as a separate png file into a subdirectory.

library usage

go get github.com/ByteSizedMarius/bdf-explorer
package main

import "github.com/ByteSizedMarius/bdf-explorer/bdf"

func main() {
	// load a file
	font, err := bdf.FromFile("<path>")

	// etc.
}
type Face struct {
    Font *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
}

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