ferristseng/rust-embedded-graphics-cjk

How to use a custom font?

Opened this issue · 1 comments

I wonder how to use the tools in the repo to create a Rust type for other fonts, such as MiSans.
I didn't find a detailed document in the repo.

Not super easy, but you can use the Makefile as a template:

########## Build Source Files ##########
$(TARGET_PNGS): $(PNG_DIR)/$(TTF2BITS_PREFIX)-%.png: $(TARGET)/FUSION_PIXEL_DOWNLOAD $(PNG_DIR)
$(TTF2BITS) \
$(TARGET)/fusion-pixel-$(FUSION_PIXEL_VERSION)/fusion-pixel.otf \
$(TTF2BITS_PREFIX) \
png \
-o $(PNG_DIR) \
-s $*
$(TARGET_SOURCES): $(SOURCE_DIR)/$(TTF2BITS_PREFIX)_%.rs: $(TARGET)/FUSION_PIXEL_DOWNLOAD $(SOURCE_DIR)
$(TTF2BITS) \
$(TARGET)/fusion-pixel-$(FUSION_PIXEL_VERSION)/fusion-pixel.otf \
$(TTF2BITS_PREFIX) \
rs \
-o $(SOURCE_DIR) \
-s $*