diff options
Diffstat (limited to 'src/displayapp/fonts')
-rw-r--r-- | src/displayapp/fonts/README.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index 08427d51..13b61b8e 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -2,6 +2,7 @@ * [Jetbrains Mono](https://www.jetbrains.com/fr-fr/lp/mono/) * [Awesome font from LVGL](https://lvgl.io/assets/others/FontAwesome5-Solid+Brands+Regular.woff) +* [Open Sans Light from Google](https://fonts.google.com/specimen/Open+Sans) ## Generate the fonts: @@ -14,6 +15,8 @@ * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252` * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` +* Add the font .c file path to src/CMakeLists.txt +* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h Add new symbols: @@ -28,6 +31,21 @@ Add new symbols: static constexpr const char* newSymbol = "\xEF\x86\x85"; ``` +## Simple method to generate a font + +If you want to generate a basic font containing only numbers and letters, you can use the above settings but instead of specifying a range, simply list the characters you need in the Symbols field and leave the range blank. This is the approach used for the PineTimeStyle watchface. +This works well for fonts which will only be used to display numbers, but will fail if you try to add a colon or other punctuation. + +* Open the [LVGL font converter](https://lvgl.io/tools/fontconverter) +* Name : open_sans_light +* Size : 150 +* Bpp : 1 bit-per-pixel +* Do not enable font compression and horizontal subpixel hinting +* Load the file `open_sans_light.tff` (use the file in this repo to ensure the version matches) and specify the following symbols : `0123456789` +* Click on Convert, and download the file `open_sans_light.c` and copy it in `src/DisplayApp/Fonts` +* Add the font .c file path to src/CMakeLists.txt (search for jetbrains to find the appropriate location/format) +* Add an LV_FONT_DECLARE line in src/libs/lv_conf.h (as above) + #### Navigation font To create the navigtion.ttf I use the web app [icomoon](https://icomoon.io/app) |