supervisor: size the terminal font bitmap for the glyphs the font has - #11365
Open
lynt-smitka wants to merge 1 commit into
Open
supervisor: size the terminal font bitmap for the glyphs the font has#11365lynt-smitka wants to merge 1 commit into
lynt-smitka wants to merge 1 commit into
Conversation
The bitmap is allocated for every character in the locale's sample text, but only the characters the font actually has are drawn into it, so the rest ship as blank tiles. The terminal font has no CJK glyphs, so a Japanese build carries 520 tiles where 95 are used. Size the bitmap, its width and the tile grids from filtered_characters, which is the list the glyph lookup already uses. Generated output is byte-identical for en_US, de_DE, fr and ru. It shrinks for ja (18707 to 7181 bytes of generated C), ko and cs. Flash on a Japanese build: bluemicro840 3592 bytes, datalore_ip_m4 3828 bytes.
Collaborator
|
@tannewt this makes sense to me but not sure of all the consequences |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The terminal font bitmap is sized for every character in the locale's sample text, but only the characters the font has are drawn. The rest are blank tiles that no glyph index can reach: a Japanese build allocates 520 tiles and uses 95.
Size the bitmap and the tile grids from filtered_characters instead.
Generated output is byte-identical for en_US, de_DE, fr and ru. It also shrinks for ko by 3552 bytes and for cs by 48. Nothing changes on screen, those characters were never drawn; the console output is unaffected either way.
The other way round is a board-level choice that stays open: point CIRCUITPY_DISPLAY_FONT at a font that has the glyphs, as the commented-out line in adafruit_fruit_jam suggests.
circuitpython/ports/raspberrypi/boards/adafruit_fruit_jam/mpconfigboard.mk
Lines 17 to 18 in a21f765
Flash in a Japanese build: