Lyra theme: button-hint labels wrap to two lines in many languages
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- embedded-iot, frontend, internationalization
Research direction
Start in src/components/themes/lyra/LyraTheme.cpp at drawButtonHints and inspect BaseTheme::drawHintLabel in src/components/themes/BaseTheme.cpp, including the SMALL_FONT_ID setup in src/main.cpp. Review the narrow and wide X3 layouts and translation strings before choosing whether to adjust sizing, padding, fonts, or validation in scripts/gen_i18n.py. Verify that the listed home and back labels render on one line in both layouts and that other theme layouts remain unaffected.
Written by the indexing model from the issue text.
Description
Problem
In the Lyra theme, the bottom button-hint labels wrap onto a second line in many languages, so e.g. Latvian « Sākums renders as « on one line and Sākums on the next. Seen on an Xteink X3.
Cause
LyraTheme::drawButtonHintsusesbuttonWidth = 80(src/components/themes/lyra/LyraTheme.cpp:120).BaseTheme::drawHintLabelsubtractstextPadding = 4per side (src/components/themes/BaseTheme.cpp:184-185), so text over 72 px wraps to two lines.- Lyra draws hints with
SMALL_FONT_ID=notosans_8_regular(src/main.cpp:128).
BaseTheme uses 106 px buttons (98 px for text), so the issue mainly hits Lyra.
Affected labels
Widths are the sum of glyph advanceX values in notosans_8_regular, checked against the 72 px limit (STR_HOME / STR_BACK only):
| Label | Width (px) |
|---|---|
« Màn hình chính |
134.8 |
« Ana Sayfa |
89.6 |
« Галоўная |
87.9 |
מסך הבית » |
84.3 |
« Beranda |
79.2 |
« Главная |
78.9 |
« Takaisin |
76.6 |
« Kembali |
76.3 |
« Quay lại |
76.3 |
« Додому |
76.1 |
« Početna |
76.0 |
« Indietro |
75.6 |
« Sākums |
74.1 |
« Начало |
73.2 |
« Główna |
72.1 |
I didn't check other button-hint strings, so there may be more.
Workaround (Latvian, #3376)
PR #3376 drops the space after the guillemet: STR_HOME: "«Sākums" measures about 70 px and fits on one line. This only fixes Latvian.
Possible fixes
- Widen Lyra's hint buttons. On the narrow layout, positions
{58, 146, 254, 342}leave an 8 px gap between buttons 1 and 2, so there's little room; the wide X3 layout{65, 157, 291, 383}has more. - Reduce
textPaddingfor Lyra, or shrink the font only when a label doesn't fit. - Add a translation-time check (e.g. in
scripts/gen_i18n.py) that flags hint strings wider than the smallest theme's limit.
- Dominant language
- C
- Stars
- 8.2k
- Forks
- 2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 140
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from crosspoint-reader/crosspoint-reader
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
crosspoint-reader/crosspoint-reader#4008 · 1 comment ·
Maintainers usually reply within 1 day
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
crosspoint-reader/crosspoint-reader#3959 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
crosspoint-reader/crosspoint-reader#3925 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
crosspoint-reader/crosspoint-reader#3777 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
crosspoint-reader/crosspoint-reader#3716 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in crosspoint-reader/crosspoint-reader
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
FujiNetWIFI/fujinet-lib#204 ·
Maintainers usually reply within 1 day
-
os:linux
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
mpv-player/mpv#18649 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
facebookincubator/muse-gadget-sdk#249 ·
Maintainers usually reply within 1 day
-
docs: nng_dial / nng_dialer_start can return NNG_ECONNSHUT and NNG_ECRYPTO, which are not documentedOpen
Difficulty 1/5 1-3 hours Newbie friendliness 89/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
micropython/micropython#19786 ·
Maintainers usually reply within 1 day