unifont-rs
Unifont for Rust
Provides a monochrome bitmap font that covers the entire Unicode Basic Multilingual Plane. Halfwidth glyphs are 8x16, fullwidth are 16x16 pixels.
Features
- easy to use
- access to raw binary data
#[no_std]
for embedded use- small memory footprint
- basic i18n support
API
;
;
/// Preprocess text so that it may be rendered via Unifont.
;
Example Code
Example code is under examples/banner.rs
.
Run the binary with the following command:
It will produce the following output:
#
# # # ###### #
# # # #
# # # ### ## # #### # ### #
# # ## # # # # # ## # #####
# # # # # ##### # # # # #
# # # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # # #
# # # # # # # # # # #
#### # # ##### # #### # # ##
i18n (Internationalization)
Basic preprocessing is provided for displaying text in non-Latin scripts, such as Arabic.
Try running the example as follows:
It will produce the following output:
##
#
##
#
#
#
# #
# # #
# ### # #
# # ## # #
##################### #
#
#
How it Works
At compile time, the build.rs
script parses the data/unifont-*.hex
file and emits Rust code.