1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::{io, path::Path};
use graphics::glyph_cache::rusttype;
use texture::TextureSettings;
use crate::RenderBuffer;
pub type BufferGlyphs<'a> = rusttype::GlyphCache<'a, (), RenderBuffer>;
pub fn buffer_glyphs_from_bytes(font_data: &[u8]) -> Result<BufferGlyphs, ()> {
BufferGlyphs::from_bytes(font_data, (), TextureSettings::new())
}
pub fn buffer_glyphs_from_path<'a, P: AsRef<Path>>(font_path: P) -> io::Result<BufferGlyphs<'a>> {
BufferGlyphs::new(font_path, (), TextureSettings::new())
}