Skip to content

Add Bitcoin symbol (₿, U+20BF) to built-in Montserrat fonts #95

@bitcoin3us

Description

@bitcoin3us

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 it

The 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_*.c

Or 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions