From 9434bb5383b02e9307d2414e97a88bd6228651e5 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 25 Sep 2025 16:08:36 +0800 Subject: [PATCH] style_macro is how fonts are added to bao1x By adding a resolver to a given glyph set, the glyph set is automatically pulled into the image. Glyph set is now co-located in the bao-video process, instead of the loader. The orignial argument for putting the font data in the loader is that it's a large, static blob; by putting it in the loader, updates can be more compact, and fonts don't need to be schlepped over every time you have an application update. This came with consequences. It made verifying the loader more complicated (because its memory space is split between the graphics manager and root keys). It also means we have to fix the partition size for the loader at "fairly large" for fonts, even if we don't need all of them in all of the configs. With baochip, we have swap memory! Off-chip memory is cheap and only the fonts actually used by the host get mapped into main memory. This means we don't have as much of a trade-off in terms of cost for fonts if we put them in off-chip swap storage. Also, the updates are split between swap and main memory, and the roadmap includes an item for swap to be individually loadable programs so that if the video server doesn't need an update, it won't be pulled into the update set. --- libs/blitstr2/src/style_macros.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/blitstr2/src/style_macros.rs b/libs/blitstr2/src/style_macros.rs index 63d5fd10b..219769157 100644 --- a/libs/blitstr2/src/style_macros.rs +++ b/libs/blitstr2/src/style_macros.rs @@ -155,9 +155,13 @@ macro_rules! english_rules { Ok(g) => g, _ => match $emoji_style($ch) { Ok(g) => g, - _ => match $base_style(REPLACEMENT) { + // add more character sets to bao1x target by adding match clauses here + _ => match zh_glyph($ch) { Ok(g) => g, - _ => NULL_GLYPH_SPRITE, + _ => match $base_style(REPLACEMENT) { + Ok(g) => g, + _ => NULL_GLYPH_SPRITE, + }, }, }, }