graphics_buffer/
glyphs.rs1use std::{io, path::Path};
2
3use graphics::glyph_cache::rusttype;
4use texture::TextureSettings;
5
6use crate::RenderBuffer;
7
8pub type BufferGlyphs<'a> = rusttype::GlyphCache<'a, (), RenderBuffer>;
13
14#[allow(clippy::result_unit_err)]
16pub fn buffer_glyphs_from_bytes(font_data: &[u8]) -> Result<BufferGlyphs, ()> {
17 BufferGlyphs::from_bytes(font_data, (), TextureSettings::new())
18}
19
20pub fn buffer_glyphs_from_path<'a, P: AsRef<Path>>(font_path: P) -> io::Result<BufferGlyphs<'a>> {
22 BufferGlyphs::new(font_path, (), TextureSettings::new())
23}