From 8f48572b9c80b9e356cff08511cf7455fd1382bd Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 28 Feb 2025 16:32:03 +0800 Subject: [PATCH] restrict font choices in baosec target we have a smaller font map, so don't resolve glyphs to fonts that we don't have. --- libs/blitstr2/src/style_macros.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libs/blitstr2/src/style_macros.rs b/libs/blitstr2/src/style_macros.rs index 1ccc3c16d..63d5fd10b 100644 --- a/libs/blitstr2/src/style_macros.rs +++ b/libs/blitstr2/src/style_macros.rs @@ -121,6 +121,7 @@ macro_rules! en_audio_rules { } #[macro_export] +#[cfg(not(any(feature = "board-baosec", feature = "hosted-baosec")))] macro_rules! english_rules { ($base_style:expr, $emoji_style:expr, $ch:ident) => { match $base_style($ch) { @@ -145,6 +146,24 @@ macro_rules! english_rules { }; } +#[macro_export] +// Reflect reduced font space on small-memory footprint devices +#[cfg(any(feature = "board-baosec", feature = "hosted-baosec"))] +macro_rules! english_rules { + ($base_style:expr, $emoji_style:expr, $ch:ident) => { + match $base_style($ch) { + Ok(g) => g, + _ => match $emoji_style($ch) { + Ok(g) => g, + _ => match $base_style(REPLACEMENT) { + Ok(g) => g, + _ => NULL_GLYPH_SPRITE, + }, + }, + } + }; +} + pub use en_audio_rules; pub use english_rules; pub use jp_rules;