|
|
@ -4,15 +4,15 @@ use rusttype; |
|
|
|
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
use ::{FontTexture, FontAtlas, GlyphMetadata};
|
|
|
|
use ::{FontAtlas, GlyphMetadata};
|
|
|
|
use ::geometry::Rect;
|
|
|
|
use ::texture::{Buffer2d, Bitmap};
|
|
|
|
use ::packer::{Packer, GrowingPacker, SkylinePacker};
|
|
|
|
|
|
|
|
/// Wraps a rusttype font and provides atlas packing and rasterization functions.
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct Font<'a> {
|
|
|
|
font: rusttype::Font<'a>,
|
|
|
|
texture: Option<FontTexture>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
@ -21,7 +21,6 @@ impl<'a> Font<'a> { |
|
|
|
pub fn new(rt_font: rusttype::Font<'a>) -> Font {
|
|
|
|
Font {
|
|
|
|
font: rt_font,
|
|
|
|
texture: None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|