diff options
feat: get_char should return a character with render-ready information
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2,6 +2,8 @@ use rusttype::{Font, Point, Scale}; use std::fs::{self, File}; use std::io::{self, Write}; +// TODO: Build a Rust Macro that does what this does but without a build.rs + #[derive(Clone)] struct FontMetadata { pub charset: &'static str, @@ -103,9 +105,8 @@ fn generate_struct(font: &FontMetadata) -> io::Result<String> { let name = font.name; let mut contents = format!( "pub struct {name} {{}} -impl {name} {{}} impl BakedFont for {name} {{ - fn get_char(c: char) -> &'static [u8] {{ + fn get_char_bytes(c: char) -> &'static [u8] {{ match c as u8 {{ " ); |