xous-core/libs/blitstr2
bunnie 9434bb5383 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.
2025-09-25 16:08:36 +08:00
..
codegen remove fonts from loader for bao1x: update codegen template 2025-09-25 16:07:31 +08:00
src style_macro is how fonts are added to bao1x 2025-09-25 16:08:36 +08:00
Cargo.toml FLAG DAY: fix all names to harmonize around 'bao1x' 2025-09-18 21:25:51 +08:00
LEGAL.md remove copy of blitstr2 from ux-api; move blitstr2 to lib location 2025-02-13 17:41:07 +08:00
LICENSE-APACHE remove copy of blitstr2 from ux-api; move blitstr2 to lib location 2025-02-13 17:41:07 +08:00
LICENSE-MIT remove copy of blitstr2 from ux-api; move blitstr2 to lib location 2025-02-13 17:41:07 +08:00
README.md remove copy of blitstr2 from ux-api; move blitstr2 to lib location 2025-02-13 17:41:07 +08:00

blitstr2

This code is vendored in from https://github.com/samblenny/blitstr2 with permission from the author.

multi-lingual string blitter for 1-bit monochrome (sequel to blitstr)

Maintenance Notes

  • Font files are regenerated by running ruby config_editor.rb followed by go run main.go --write in the /src/blitstr2/codegen directory relative to this README.md file
  • The Go files have been modified to generate the necessary templates for the loader/kernel split of the font tables. The main bit of manual "glue" is at the top of main.rs inside the map_fonts() routine, where the AtomicU32 pointers that hold the final linked location of the font maps are initialized at boot.
  • Font sources are located in src/blitstr2/codegen/src_data, along with various indices and codepoints.
  • Most font sources were generated by https://github.com/samblenny/hd1b_other
  • The latin sets that have a more manual process consisting of taking a screenshot of ResEdit's KCHR screen on a Mac OS 7 emulator via https://archive.org/details/mac_MacOS_7.0.1_compilation and massaging the result into a usable sprite sheet. The only two native font sizes that look good ane 9 and 12 point, which gives a coverage of 9, 12, 18 and 24 point sizes (with pixel doubling).

What's New

Compared to the original version of blitstr, blitstr2:

  • Supports more languages
  • Uses 16x16 pixel size for CJK glyphs instead of 32x32
  • Makes it easier for calling code to calculate size of rendered strings
  • Ignores multi-codepoint grapheme clusters for modern emoji (instead, there is limited support for old-school monochrome bitmap emoji)
  • Focuses on an API to look up glyphs from just one typeface at a time

License

Source code for blitstr2 is dual licensed under the terms of Apache 2.0 or MIT, at your option.

Glyph bitmaps included with blitstr2 have their own copyrights and licenses (OFL-1.1, public domain, Japanese equivalent of public domain).

See LEGAL.md for copyright and license details on embedded glyph bitmaps.