Customise Shift key

This commit is contained in:
Johannes Marbach 2021-09-20 13:05:12 +02:00
parent 2484871b77
commit ae84dbbbc6
5 changed files with 105 additions and 28 deletions

View file

@ -79,15 +79,7 @@ $ sudo ./unl0kr
## Changing fonts
Fonts need to be converted to C arrays before they can be used with [lvgl]. This is most conveniently done using the official [online font converter]. Useful unicode ranges for the conversion are 0x0020-0x007F (basic Latin), 0x00A0-0x00FF (Latin-1 supplement), 0x0100-0x017F (Latin extended A), 0x2000-0x206F (general punctuation) and 0x20A0-0x20CF (currency symbols). For the various `LV_SYMBOL_...` glyphs, make sure to also add [Font Awesome] with the following code points:
```
0xF001, 0xF008, 0xF00B, 0xF00C, 0xF00D, 0xF011, 0xF013, 0xF015, 0xF019, 0xF01C, 0xF021, 0xF026, 0xF027, 0xF028, 0xF03E, 0xF0E0, 0xF304, 0xF043, 0xF048, 0xF04B, 0xF04C, 0xF04D, 0xF051, 0xF052, 0xF053, 0xF054, 0xF067, 0xF068, 0xF06E, 0xF070, 0xF071, 0xF074, 0xF077, 0xF078, 0xF079, 0xF07B, 0xF093, 0xF095, 0xF0C4, 0xF0C5, 0xF0C7, 0xF0C9, 0xF0E7, 0xF0EA, 0xF0F3, 0xF11C, 0xF124, 0xF158, 0xF1EB, 0xF240, 0xF241, 0xF242, 0xF243, 0xF244, 0xF287, 0xF293, 0xF2ED, 0xF55A, 0xF7C2, 0xF8A2
```
as well as `0xF042` for the [adjust] icon.
It's also possible to do the conversion on the commandline, e.g.
In order to work with [lvgl], fonts need to be converted to C arrays. Buffyboard currently uses a combination of the [Montserrat] font for text and the [FontAwesome] font for pictograms. For both fonts only limited character ranges are included. To (re)generate the C file containing the combined font, run the following command
```
$ npx lv_font_conv --bpp 4 --size 32 --no-compress -o montserrat_extended_32.c --format lvgl \
@ -99,9 +91,23 @@ $ npx lv_font_conv --bpp 4 --size 32 --no-compress -o montserrat_extended_32.c -
--range '0x20A0-0x20CF' \
--font FontAwesome5-Solid+Brands+Regular.woff \
--range '0xF001,0xF008,0xF00B,0xF00C,0xF00D,0xF011,0xF013,0xF015,0xF019,0xF01C,0xF021,0xF026,0xF027,0xF028,0xF03E,0xF0E0,0xF304,0xF043,0xF048,0xF04B,0xF04C,0xF04D,0xF051,0xF052,0xF053,0xF054,0xF067,0xF068,0xF06E,0xF070,0xF071,0xF074,0xF077,0xF078,0xF079,0xF07B,0xF093,0xF095,0xF0C4,0xF0C5,0xF0C7,0xF0C9,0xF0E7,0xF0EA,0xF0F3,0xF11C,0xF124,0xF158,0xF1EB,0xF240,0xF241,0xF242,0xF243,0xF244,0xF287,0xF293,0xF2ED,0xF55A,0xF7C2,0xF8A2' \
--range '0xF042'
--range '0xF042' \
--range '0xF35B'
```
The following is a summary of the meaning of the different unicode ranges used above
- [Montserrat]
- Basic Latin (`0x0020-0x007F`)
- Latin-1 supplement (`0x00A0-0x00FF`)
- Latin extended A (`0x0100-0x017F`)
- General punctuation (`0x2000-0x206F`)
- Currency symbols (`0x20A0-0x20CF`)
- [FontAwesome]
- Standard `LV_SYMBOL_*` glyphs (`0xF001,0xF008,0xF00B,0xF00C,0xF00D,0xF011,0xF013,0xF015,0xF019,0xF01C,0xF021,0xF026,0xF027,0xF028,0xF03E,0xF0E0,0xF304,0xF043,0xF048,0xF04B,0xF04C,0xF04D,0xF051,0xF052,0xF053,0xF054,0xF067,0xF068,0xF06E,0xF070,0xF071,0xF074,0xF077,0xF078,0xF079,0xF07B,0xF093,0xF095,0xF0C4,0xF0C5,0xF0C7,0xF0C9,0xF0E7,0xF0EA,0xF0F3,0xF11C,0xF124,0xF158,0xF1EB,0xF240,0xF241,0xF242,0xF243,0xF244,0xF287,0xF293,0xF2ED,0xF55A,0xF7C2,0xF8A2`)
- [adjust] (`0xF042`)
- [arrow-alt-circle-up] (`0xF35B`)
## Changing layouts
Unl0kr uses [squeekboard layouts] converted to C via [squeek2lvgl]. To regenerate the layouts, run
@ -141,6 +147,7 @@ The Font Awesome font is licensed under the Open Font License version 1.1.
[online font converter]: https://lvgl.io/tools/fontconverter
[Font Awesome]: https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff
[adjust]: https://fontawesome.com/v5.15/icons/adjust?style=solid
[arrow-alt-circle-up]: https://fontawesome.com/v5.15/icons/arrow-alt-circle-up?style=solid
[squeekboard layouts]: https://gitlab.gnome.org/World/Phosh/squeekboard/-/tree/master/data/keyboards
[squeek2lvgl]: https://gitlab.com/cherrypicker/squeek2lvgl
[fix(examples) don't compile assets unless needed]: https://github.com/lvgl/lvgl/pull/2523