bitmap
1.0.0
✍ Biblioteca de carregadores de fontes Bitmap para GO.
Esta biblioteca carrega dados de fonte de uma imagem ("bitmap").
Ele é carregado em um map GO, o que significa que um glifo pode ser recuperado com font[glyph] , por exemplo font["A"] .
bm := bitmap . New ()
font := bm . Load ( "font.png" )
x := 0
y := 0
xx := x
yy := y
ch := font [ glyph ]
for i := 0 ; i < ch . Height ; i ++ {
bin := ch . Data [ i ] // Gets a line: a glyph is 8x8
binarr := strings . Split ( bin , "" )
for _ , pix := range binarr {
if pix == "1" { draw ( xx , yy ) }
xx += 1
}
yy += 1
xx = x
}Esta biblioteca é usada no Pinwheel para sua fonte Pixel.
Se você também usar isso por motivo, poderá fazer um PR para adicionar seu uso aqui.
BSD 3-cláusulas