bitmap
1.0.0
✍ Biblioteca de cargador de fuentes de mapa de bits para Go.
Esta biblioteca carga datos de fuentes de una imagen ("mapa de bits").
Se carga en un map GO, lo que significa que se puede recuperar un glifo con font[glyph] , por ejemplo 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 se usa en Pinwheel para su fuente de píxeles.
Si también usa esto por razón, puede hacer un PR para agregar su uso aquí.
BSD 3 Cláusula