-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Request
Add the Bitcoin sign character (₿, U+20BF) to the built-in Montserrat fonts so apps can display it natively.
Background
The current Montserrat-Medium.ttf (v7.200) does not include U+20BF. The Lightning Piggy app comments this out:
#balance_text = "₿ " + str(balance) # font doesnt support itThe latest Montserrat (v9.000) from Google Fonts includes ₿ along with other currency symbols.
Changes Required
1. Update the font source
Replace lvgl_micropython/lib/lvgl/scripts/built_in_font/Montserrat-Medium.ttf with the latest version from:
https://github.com/JulietaUla/Montserrat/raw/master/fonts/ttf/Montserrat-Medium.ttf
2. Add U+20BF to the glyph range
In lvgl_micropython/lib/lvgl/scripts/built_in_font/built_in_font_gen.py, line 23:
# Before:
default=['0x20-0x7F,0xB0,0x2022'],
# After:
default=['0x20-0x7F,0xB0,0x2022,0x20BF'],3. Regenerate all font .c files
cd lvgl_micropython/lib/lvgl/scripts/built_in_font
# For each size (8, 10, 12, ... 48):
npx lv_font_conv --no-compress --no-prefilter --bpp 4 --size SIZE \
--font Montserrat-Medium.ttf -r 0x20-0x7F,0xB0,0x2022,0x20BF \
--font FontAwesome5-Solid+Brands+Regular.woff -r FONTAWESOME_SYMBOLS \
--format lvgl -o ../../src/font/lv_font_montserrat_SIZE.c --force-fast-kern-format
# Fix includes:
sed -i 's|#include "lvgl.h"|#include "../../lvgl.h"|' ../../src/font/lv_font_montserrat_*.cOr use the existing generate_all.py script after applying step 2.
4. Rebuild firmware
Size impact
Minimal — one additional glyph per font size (a few bytes each).
Usage
After this change, apps can use the Bitcoin symbol directly:
balance_label.set_text("₿ " + str(balance))
# or with \u20bf
balance_label.set_text("\u20bf " + str(balance))🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels