From f310c1af432b216edcafb23fe0622ea66fca9591 Mon Sep 17 00:00:00 2001 From: memdmp Date: Sat, 11 Jan 2025 23:50:49 +0100 Subject: feat: get_char should return a character with render-ready information --- build.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'build.rs') diff --git a/build.rs b/build.rs index 3a4b452..7b7b410 100644 --- a/build.rs +++ b/build.rs @@ -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 { 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 {{ " ); -- cgit v1.2.3