|
@ -41,7 +41,8 @@ impl<'a> Font<'a> { |
|
|
atlas.glyph_data.insert(chr, info);
|
|
|
atlas.glyph_data.insert(chr, info);
|
|
|
} else if chr == ' ' {
|
|
|
} else if chr == ' ' {
|
|
|
// generate a blank pixel for the space texture
|
|
|
// generate a blank pixel for the space texture
|
|
|
let (mut info, _) = self.rasterize_char(' ', scale).unwrap();
|
|
|
|
|
|
|
|
|
// TODO: this is bad and should be fixed
|
|
|
|
|
|
let (mut info, _) = self.rasterize_char('-', scale).unwrap();
|
|
|
let empty_bitmap = Bitmap::new(1, 1);
|
|
|
let empty_bitmap = Bitmap::new(1, 1);
|
|
|
let r = packer.pack_resize(&empty_bitmap, |(w, h)| (w*2, h*2));
|
|
|
let r = packer.pack_resize(&empty_bitmap, |(w, h)| (w*2, h*2));
|
|
|
info.bounding_box = r;
|
|
|
info.bounding_box = r;
|
|
@ -78,8 +79,6 @@ impl<'a> Font<'a> { |
|
|
out.set(x as usize, y as usize, (v * 255.0) as u8);
|
|
|
out.set(x as usize, y as usize, (v * 255.0) as u8);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
println!("{:?}", bbox);
|
|
|
|
|
|
|
|
|
|
|
|
let data = GlyphMetadata {
|
|
|
let data = GlyphMetadata {
|
|
|
scale: scale,
|
|
|
scale: scale,
|
|
|
bounding_box: Rect {
|
|
|
bounding_box: Rect {
|
|
|