lvfontio doesn't consider ascent/descent
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- c
- Ambito
- embedded-iot
Direzione di ricerca
Start with the cited header-reading code in shared-module/lvfontio/OnDiskFont.c (lines 110–114) and the dimensions function (lines 568–570), then compare the font metrics described for the 1bpp and higher-bpp files. The issue does not name a test; reproduce the reported clipping and check how candidate sizing affects terminal row spacing. Done means higher-bpp descenders render without clipping while preserving the desired terminal sizing and alignment.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Currently the lvfontio module reads the font_size and ascent out of the font file header. https://github.com/adafruit/circuitpython/blob/fd4226bb6e15884e9fa7f7014d54a4bfaf192db1/shared-module/lvfontio/OnDiskFont.c#L110-L114
and it uses the font_size as the height returned by common_hal_lvfontio_ondiskfont_get_dimensions https://github.com/adafruit/circuitpython/blob/fd4226bb6e15884e9fa7f7014d54a4bfaf192db1/shared-module/lvfontio/OnDiskFont.c#L568-L570
But it seems that font_size may not fully encompass all of the vertical pixels the font requires. I have noticed that >1bpp versions of the same font have a higher ascent value but the same font_size
Loaded 4bpp font from fonts/unifont-16.0.02-en_US_4bb.lvfontbin
Successfully loaded LVGL font
Font metrics:
Ascent: 15
Descent: -4
font_size: 16
Bounding box: width=0, height=16, x_offset=0, y_offset=-4
Loaded 1bpp font from fonts/unifont-16.0.02-en_US.lvfontbin
Successfully loaded LVGL font
Font metrics:
Ascent: 14
Descent: -4
font_size: 16
Bounding box: width=0, height=16, x_offset=0, y_offset=-4
This seems to be the root cause of the descenders or bottom row(s) of pixels getting cut off when attempting to set the terminal to use a font that is >1bpp
Default font descenders visible 'y' and 'g' characters:
2bpp version of same font descenders clipped:
adafruit_bitmap_font does not seem to have the same issue, using that and BitmapLabel the descenders are rendered in full.
Codex suggested this patch to resolve it by reading the descent value from the header and using it + ascent to calculate the full size.
lvfontio-descent-header.patch
That does work to stop the bottom from getting clipped, but it means that the tile size for the Terminal is bigger, more space in between rows, and doesn't evenly align or evenly divide into the display size.
In practice it seems like for this font (unifont v16.0.02) that the descent doesn't actually use the full ascent + descent range available at least on standard ASCII glyphs. The 'y' and 'g' each only seem to be missing 1 pixel row which to me looks like it matches the 1px difference in ascent value between the two fonts. When using the ascent + decent calculation it will end up at 18 or 19px for height instead of the 16 that we have now, or the 17 that seem like it would fit everything.
I'm interested in thoughts on whether this is something we want to try to resolve, and if so how best to do it in a way that ideally doesn't change the current default fonts terminal size, but does still allow custom >1bpp fonts to render without clipping.
- Lingua principale
- C
- Stelle
- 4.6k
- Fork
- 1.4k
- Merge medio
- 1g 8h
- PR unite (30g)
- 155
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di adafruit/circuitpython
-
board breaks api
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
adafruit/circuitpython#11099 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
storage usb zephyr
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
adafruit/circuitpython#11531 ·
I maintainer di solito rispondono entro 1 giorno
-
Move silabs to ZephyrApertasilabs
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
adafruit/circuitpython#11507 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Feature/API request: portable camera capture across ESP-IDF, Zephyr, and parallel interfacesForse già presa @tannewt l’ha presa oggi. Apertacircuitpython api displayio enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
adafruit/circuitpython#11505 · 5 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
adafruit/circuitpython#11472 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di adafruit/circuitpython
Issue simili
-
#242 leftovers: dated narrative and shas in the social-features test planForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
EchoTools/nevr-runtime#264 ·
I maintainer di solito rispondono entro 1 giorno
-
area/docdb kind/bug priority/medium status/awaiting-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
yugabyte/yugabyte-db#34873 ·
I maintainer di solito rispondono entro 1 giorno
-
[sqlcipher] update to 4.19.0Apertacategory:port-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mypaint/libmypaint#209 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno