Skip to content

refactor(color): UI layout logic to better handle different screen sizes and orientations #6134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified radio/src/bitmaps/320x240/bootloader/bmp_plug_usb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/bootloader/bmp_usb_plugged.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/alpha_stick_pointer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_busy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_currentmenu_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_currentmenu_dot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_edgetx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_menu_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_menu_model_select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_menu_notes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_menu_radio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_menu_stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_menu_theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_curves.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_flight_modes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_grid_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_grid_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_gvars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_heli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_inputs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_list_one.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_list_two.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_lua_scripts.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_mixer.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_outputs.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_setup.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_telemetry.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_model_usb.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_channels1.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_channels2.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_channels3.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_channels4.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_gvars.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_inver.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_lockch.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_monitor_logsw.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_mplex_add.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_mplex_multi.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_mplex_replace.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_calibration.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_edit_theme.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_hardware.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_sd_browser.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_setup.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_tools.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_trainer.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_radio_version.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_shutdown.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_stats_analogs.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_stats_debug.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_stats_timers.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_textline_curve.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_textline_fm.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_add_view.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_setup.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view1.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view10.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view2.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view3.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view4.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view5.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view6.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view7.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view8.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_theme_view9.png
Binary file modified radio/src/bitmaps/320x240/default_theme/mask_topleft.png
Binary file modified radio/src/bitmaps/320x240/mask_antenna.png
Binary file modified radio/src/bitmaps/320x240/mask_dot.png
Binary file modified radio/src/bitmaps/320x240/mask_round_title_left.png
Binary file modified radio/src/bitmaps/320x240/mask_round_title_right.png
Binary file modified radio/src/bitmaps/320x240/mask_shutdown_circle0.png
Binary file modified radio/src/bitmaps/320x240/mask_shutdown_circle1.png
Binary file modified radio/src/bitmaps/320x240/mask_shutdown_circle2.png
Binary file modified radio/src/bitmaps/320x240/mask_shutdown_circle3.png
Binary file modified radio/src/bitmaps/320x240/mask_timer.png
Binary file modified radio/src/bitmaps/320x240/mask_timer_bg.png
Binary file modified radio/src/bitmaps/320x240/mask_topmenu_gps_18.png
Binary file modified radio/src/bitmaps/320x240/mask_topmenu_usb.png
Binary file modified radio/src/bitmaps/320x240/mask_txbat.png
Binary file modified radio/src/bitmaps/320x240/mask_txbat_charging.png
Binary file modified radio/src/bitmaps/320x240/mask_usb_symbol.png
Binary file modified radio/src/bitmaps/320x240/splash_logo.png
Binary file modified radio/src/bitmaps/320x240/volume/mask_volume_0.png
Binary file modified radio/src/bitmaps/320x240/volume/mask_volume_1.png
Binary file modified radio/src/bitmaps/320x240/volume/mask_volume_2.png
Binary file modified radio/src/bitmaps/320x240/volume/mask_volume_3.png
Binary file modified radio/src/bitmaps/320x240/volume/mask_volume_4.png
Binary file modified radio/src/bitmaps/320x240/volume/mask_volume_scale.png
18 changes: 5 additions & 13 deletions radio/src/fonts/lvgl/lrg/lv_font_bl.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
* Size: 24 px
* Bpp: 1
* Opts: --no-prefilter --bpp 1 --size 24 --no-compress --font ../Roboto/Roboto-Regular.ttf -r 0x20-0x7F --font ../../thirdparty/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff -r 61671,63650,63426,61453,61787,61452,61931,62087 --format lvgl -o lrg/lv_font_bl.c --force-fast-kern-format
* Opts: --no-prefilter --bpp 1 --size 24 --no-compress --font ../Roboto/Roboto-Regular.ttf -r 0x20-0x7F --font ../../thirdparty/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff -r 61671,63650,63426,61453,61787,61452,61931,62087 --format lvgl -o lrg/lv_font_bl.c --force-fast-kern-format --no-compress
******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
Expand Down Expand Up @@ -941,12 +941,9 @@ static const lv_font_fmt_txt_kern_classes_t kern_classes =
* ALL CUSTOM DATA
*--------------------*/

#if LVGL_VERSION_MAJOR == 8
#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static lv_font_fmt_txt_glyph_cache_t cache;
#endif

#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
Expand All @@ -960,19 +957,18 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
.bpp = 1,
.kern_classes = 1,
.bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
#if LV_VERSION_CHECK(8, 0, 0)
.cache = &cache
#endif
};



/*-----------------
* PUBLIC FONT
*----------------*/

/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t lv_font_bl = {
#else
lv_font_t lv_font_bl = {
Expand All @@ -988,11 +984,7 @@ lv_font_t lv_font_bl = {
.underline_position = -2,
.underline_thickness = 1,
#endif
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
#if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
.fallback = NULL,
#endif
.user_data = NULL,
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};


Expand Down
18,158 changes: 9,054 additions & 9,104 deletions radio/src/fonts/lvgl/lrg/lv_font_cn_L.c

Large diffs are not rendered by default.

4,779 changes: 2,310 additions & 2,469 deletions radio/src/fonts/lvgl/lrg/lv_font_cn_STD.c

Large diffs are not rendered by default.

10,240 changes: 5,095 additions & 5,145 deletions radio/src/fonts/lvgl/lrg/lv_font_cn_XS.c

Large diffs are not rendered by default.

6,606 changes: 3,288 additions & 3,318 deletions radio/src/fonts/lvgl/lrg/lv_font_cn_XXS.c

Large diffs are not rendered by default.

13,791 changes: 6,863 additions & 6,928 deletions radio/src/fonts/lvgl/lrg/lv_font_cn_bold_STD.c

Large diffs are not rendered by default.

26,715 changes: 13,303 additions & 13,412 deletions radio/src/fonts/lvgl/lrg/lv_font_cn_bold_XL.c

Large diffs are not rendered by default.

1,965 changes: 0 additions & 1,965 deletions radio/src/fonts/lvgl/lrg/lv_font_cn_bold_XXL.c

This file was deleted.

2,312 changes: 1,156 additions & 1,156 deletions radio/src/fonts/lvgl/lrg/lv_font_en_L.c

Large diffs are not rendered by default.

258 changes: 125 additions & 133 deletions radio/src/fonts/lvgl/lrg/lv_font_en_STD.c

Large diffs are not rendered by default.

1,635 changes: 818 additions & 817 deletions radio/src/fonts/lvgl/lrg/lv_font_en_XS.c

Large diffs are not rendered by default.

1,246 changes: 623 additions & 623 deletions radio/src/fonts/lvgl/lrg/lv_font_en_XXS.c

Large diffs are not rendered by default.

2,218 changes: 1,109 additions & 1,109 deletions radio/src/fonts/lvgl/lrg/lv_font_en_bold_STD.c

Large diffs are not rendered by default.

3,245 changes: 1,622 additions & 1,623 deletions radio/src/fonts/lvgl/lrg/lv_font_en_bold_XL.c

Large diffs are not rendered by default.

2,630 changes: 1,315 additions & 1,315 deletions radio/src/fonts/lvgl/lrg/lv_font_en_bold_XXL.c

Large diffs are not rendered by default.

1,986 changes: 1,002 additions & 984 deletions radio/src/fonts/lvgl/lrg/lv_font_he_L.c

Large diffs are not rendered by default.

3,003 changes: 1,551 additions & 1,452 deletions radio/src/fonts/lvgl/lrg/lv_font_he_STD.c

Large diffs are not rendered by default.

1,747 changes: 886 additions & 861 deletions radio/src/fonts/lvgl/lrg/lv_font_he_XS.c

Large diffs are not rendered by default.

1,147 changes: 586 additions & 561 deletions radio/src/fonts/lvgl/lrg/lv_font_he_XXS.c

Large diffs are not rendered by default.

2,209 changes: 1,108 additions & 1,101 deletions radio/src/fonts/lvgl/lrg/lv_font_he_bold_STD.c

Large diffs are not rendered by default.

2,171 changes: 1,080 additions & 1,091 deletions radio/src/fonts/lvgl/lrg/lv_font_he_bold_XL.c

Large diffs are not rendered by default.

1,811 changes: 0 additions & 1,811 deletions radio/src/fonts/lvgl/lrg/lv_font_he_bold_XXL.c

This file was deleted.

12,005 changes: 5,976 additions & 6,029 deletions radio/src/fonts/lvgl/lrg/lv_font_jp_L.c

Large diffs are not rendered by default.

4,787 changes: 2,278 additions & 2,509 deletions radio/src/fonts/lvgl/lrg/lv_font_jp_STD.c

Large diffs are not rendered by default.

7,091 changes: 3,518 additions & 3,573 deletions radio/src/fonts/lvgl/lrg/lv_font_jp_XS.c

Large diffs are not rendered by default.

4,613 changes: 2,290 additions & 2,323 deletions radio/src/fonts/lvgl/lrg/lv_font_jp_XXS.c

Large diffs are not rendered by default.

9,152 changes: 4,543 additions & 4,609 deletions radio/src/fonts/lvgl/lrg/lv_font_jp_bold_STD.c

Large diffs are not rendered by default.

16,563 changes: 8,224 additions & 8,339 deletions radio/src/fonts/lvgl/lrg/lv_font_jp_bold_XL.c

Large diffs are not rendered by default.

1,965 changes: 0 additions & 1,965 deletions radio/src/fonts/lvgl/lrg/lv_font_jp_bold_XXL.c

This file was deleted.

10,030 changes: 5,002 additions & 5,028 deletions radio/src/fonts/lvgl/lrg/lv_font_ko_L.c

Large diffs are not rendered by default.

4,020 changes: 1,979 additions & 2,041 deletions radio/src/fonts/lvgl/lrg/lv_font_ko_STD.c

Large diffs are not rendered by default.

5,990 changes: 2,994 additions & 2,996 deletions radio/src/fonts/lvgl/lrg/lv_font_ko_XS.c

Large diffs are not rendered by default.

3,497 changes: 1,743 additions & 1,754 deletions radio/src/fonts/lvgl/lrg/lv_font_ko_XXS.c

Large diffs are not rendered by default.

7,808 changes: 3,889 additions & 3,919 deletions radio/src/fonts/lvgl/lrg/lv_font_ko_bold_STD.c

Large diffs are not rendered by default.

14,878 changes: 7,391 additions & 7,487 deletions radio/src/fonts/lvgl/lrg/lv_font_ko_bold_XL.c

Large diffs are not rendered by default.

1,950 changes: 0 additions & 1,950 deletions radio/src/fonts/lvgl/lrg/lv_font_ko_bold_XXL.c

This file was deleted.

2,538 changes: 1,334 additions & 1,204 deletions radio/src/fonts/lvgl/lrg/lv_font_ru_L.c

Large diffs are not rendered by default.

3,667 changes: 1,989 additions & 1,678 deletions radio/src/fonts/lvgl/lrg/lv_font_ru_STD.c

Large diffs are not rendered by default.

2,052 changes: 1,061 additions & 991 deletions radio/src/fonts/lvgl/lrg/lv_font_ru_XS.c

Large diffs are not rendered by default.

1,322 changes: 687 additions & 635 deletions radio/src/fonts/lvgl/lrg/lv_font_ru_XXS.c

Large diffs are not rendered by default.

2,572 changes: 1,326 additions & 1,246 deletions radio/src/fonts/lvgl/lrg/lv_font_ru_bold_STD.c

Large diffs are not rendered by default.

2,840 changes: 1,492 additions & 1,348 deletions radio/src/fonts/lvgl/lrg/lv_font_ru_bold_XL.c

Large diffs are not rendered by default.

1,811 changes: 0 additions & 1,811 deletions radio/src/fonts/lvgl/lrg/lv_font_ru_bold_XXL.c

This file was deleted.

21,926 changes: 10,937 additions & 10,989 deletions radio/src/fonts/lvgl/lrg/lv_font_tw_L.c

Large diffs are not rendered by default.

4,887 changes: 2,364 additions & 2,523 deletions radio/src/fonts/lvgl/lrg/lv_font_tw_STD.c

Large diffs are not rendered by default.

11,219 changes: 5,585 additions & 5,634 deletions radio/src/fonts/lvgl/lrg/lv_font_tw_XS.c

Large diffs are not rendered by default.

6,830 changes: 3,401 additions & 3,429 deletions radio/src/fonts/lvgl/lrg/lv_font_tw_XXS.c

Large diffs are not rendered by default.

14,496 changes: 7,216 additions & 7,280 deletions radio/src/fonts/lvgl/lrg/lv_font_tw_bold_STD.c

Large diffs are not rendered by default.

28,959 changes: 14,425 additions & 14,534 deletions radio/src/fonts/lvgl/lrg/lv_font_tw_bold_XL.c

Large diffs are not rendered by default.

1,965 changes: 0 additions & 1,965 deletions radio/src/fonts/lvgl/lrg/lv_font_tw_bold_XXL.c

This file was deleted.

2,507 changes: 1,319 additions & 1,188 deletions radio/src/fonts/lvgl/lrg/lv_font_ua_L.c

Large diffs are not rendered by default.

3,617 changes: 1,957 additions & 1,660 deletions radio/src/fonts/lvgl/lrg/lv_font_ua_STD.c

Large diffs are not rendered by default.

1,947 changes: 1,009 additions & 938 deletions radio/src/fonts/lvgl/lrg/lv_font_ua_XS.c

Large diffs are not rendered by default.

1,383 changes: 718 additions & 665 deletions radio/src/fonts/lvgl/lrg/lv_font_ua_XXS.c

Large diffs are not rendered by default.

2,569 changes: 1,325 additions & 1,244 deletions radio/src/fonts/lvgl/lrg/lv_font_ua_bold_STD.c

Large diffs are not rendered by default.

2,789 changes: 1,468 additions & 1,321 deletions radio/src/fonts/lvgl/lrg/lv_font_ua_bold_XL.c

Large diffs are not rendered by default.

1,811 changes: 0 additions & 1,811 deletions radio/src/fonts/lvgl/lrg/lv_font_ua_bold_XXL.c

This file was deleted.

146 changes: 84 additions & 62 deletions radio/src/fonts/lvgl/make_fonts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,25 @@ ARROWS_FONT="EdgeTX/OpenArrow-Regular.woff"
# 0x80: right, 0x81: left, 0x82: up, 0x83: down
ARROWS="0x21E8=>0x80,0x21E6=>0x81,0x21E7=>0x82,0x21E9=>0x83"

LATIN_FONT="Roboto/Roboto-Regular.ttf"
LATIN_FONT_BOLD="Roboto/Roboto-Bold.ttf"

function make_font() {
local name=$1
local ttf=$2
local size=$3
local sfx=$4
local dir=$5
local chars=$6
local arg=$7
local latin_ttf=$2
local ttf=$3
local size=$4
local sfx=$5
local dir=$6
local chars=$7

lv_font_conv --no-prefilter --bpp 4 --size ${size} \
--font ${TTF_DIR}${ttf} -r ${ASCII},${DEGREE},${BULLET},${COMPARE}${chars} \
--font ${TTF_DIR}${latin_ttf} -r ${ASCII},${DEGREE},${BULLET},${COMPARE} \
--font ${TTF_DIR}${ttf} -r ${chars} \
--font EdgeTX/extra.ttf -r ${EXTRA_SYM} \
--font ${ARROWS_FONT} -r ${ARROWS} \
--font ${SYMBOLS_FONT} -r ${SYMBOLS} \
--format lvgl -o ${dir}/lv_font_${name}_${sfx}.c --force-fast-kern-format ${arg}
--format lvgl -o ${dir}/lv_font_${name}_${sfx}.c --force-fast-kern-format --no-compress
}

function compress_font() {
Expand All @@ -56,50 +60,66 @@ function compress_font() {

function make_font_lz4() {
local name=$1
local ttf=$2
local size=$3
local sfx=$4
local dir=$5
local chars=$6
local arg=$7
local latin_ttf=$2
local ttf=$3
local size=$4
local sfx=$5
local dir=$6
local chars=$7

lv_font_conv --no-prefilter --bpp 4 --size ${size} \
--font ${TTF_DIR}${ttf} -r ${ASCII},${DEGREE},${BULLET},${COMPARE}${chars} \
--font ${TTF_DIR}${latin_ttf} -r ${ASCII},${DEGREE},${BULLET},${COMPARE} \
--font ${TTF_DIR}${ttf} -r ${chars} \
--font EdgeTX/extra.ttf -r ${EXTRA_SYM} \
--font ${ARROWS_FONT} -r ${ARROWS} \
--font ${SYMBOLS_FONT} -r ${SYMBOLS} \
--format lvgl -o lv_font.inc --force-fast-kern-format ${arg}
--format lvgl -o lv_font.inc --force-fast-kern-format --no-compress
compress_font ${dir}/lv_font_${name}_${sfx}
}

function make_font_w_extra_sym() {
local name=$1
local ttf=$2
local size=$3
local sfx=$4
local dir=$5
local chars=$6
local arg=$7
local latin_ttf=$2
local ttf=$3
local size=$4
local sfx=$5
local dir=$6
local chars=$7

lv_font_conv --no-prefilter --bpp 4 --size ${size} \
--font ${TTF_DIR}${ttf} -r ${ASCII},${DEGREE}${chars} \
--font ${TTF_DIR}${latin_ttf} -r ${ASCII},${DEGREE} \
--font ${TTF_DIR}${ttf} -r ${chars} \
--font EdgeTX/extra.ttf -r ${EXTRA_SYM} \
--format lvgl -o lv_font.inc --force-fast-kern-format ${arg}
--format lvgl -o lv_font.inc --force-fast-kern-format --no-compress
compress_font ${dir}/lv_font_${name}_${sfx}
}

function make_font_no_sym() {
local name=$1
local ttf=$2
local latin_ttf=$2
local ttf=$3
local size=$4
local sfx=$5
local dir=$6
local chars=$7

lv_font_conv --no-prefilter --bpp 4 --size ${size} \
--font ${TTF_DIR}${latin_ttf} -r ${ASCII},${DEGREE} \
--font ${TTF_DIR}${ttf} -r ${chars} \
--format lvgl -o lv_font.inc --force-fast-kern-format --no-compress
compress_font ${dir}/lv_font_${name}_${sfx}
}

function make_font_no_sym_no_trans() {
local name=$1
local latin_ttf=$2
local size=$3
local sfx=$4
local dir=$5
local chars=$6
local arg=$7

lv_font_conv --no-prefilter --bpp 4 --size ${size} \
--font ${TTF_DIR}${ttf} -r ${ASCII},${DEGREE}${chars} \
--format lvgl -o lv_font.inc --force-fast-kern-format ${arg}
--font ${TTF_DIR}${latin_ttf} -r ${ASCII},${DEGREE} \
--format lvgl -o lv_font.inc --force-fast-kern-format --no-compress
compress_font ${dir}/lv_font_${name}_${sfx}
}

Expand All @@ -116,7 +136,7 @@ function make_bootloader_font() {
lv_font_conv --no-prefilter --bpp 1 --size ${size} --no-compress \
--font ${TTF_DIR}${ttf} -r ${ASCII} \
--font ${SYMBOLS_FONT} -r ${BL_SYMBOLS} \
--format lvgl -o ${dir}/lv_font_${name}.c --force-fast-kern-format
--format lvgl -o ${dir}/lv_font_${name}.c --force-fast-kern-format --no-compress
}

function make_font_set() {
Expand All @@ -125,47 +145,49 @@ function make_font_set() {
local ttf_bold=$3
local chars=$4

make_font_lz4 "${name}" "${ttf_normal}" 9 "XXS" "std" ${chars} --no-compress
make_font_lz4 "${name}" "${ttf_normal}" 13 "XS" "std" ${chars} --no-compress
make_font "${name}" "${ttf_normal}" 16 "STD" "std" ${chars} --no-compress
make_font_lz4 "${name}_bold" "${ttf_bold}" 16 "STD" "std" ${chars} --no-compress
make_font_w_extra_sym "${name}" "${ttf_normal}" 24 "L" "std" ${chars} --no-compress
make_font_no_sym "${name}_bold" "${ttf_bold}" 32 "XL" "std" ${chars} --no-compress
make_font_no_sym "${name}_bold" "${ttf_bold}" 64 "XXL" "std" "" --no-compress
make_font_lz4 "${name}" ${LATIN_FONT} "${ttf_normal}" 9 "XXS" "std" ${chars}
make_font_lz4 "${name}" ${LATIN_FONT} "${ttf_normal}" 13 "XS" "std" ${chars}
make_font "${name}" ${LATIN_FONT} "${ttf_normal}" 16 "STD" "std" ${chars}
make_font_lz4 "${name}_bold" ${LATIN_FONT_BOLD} "${ttf_bold}" 16 "STD" "std" ${chars}
make_font_w_extra_sym "${name}" ${LATIN_FONT} "${ttf_normal}" 24 "L" "std" ${chars}
make_font_no_sym "${name}_bold" ${LATIN_FONT_BOLD} "${ttf_bold}" 32 "XL" "std" ${chars}

# 320x240 LCD fonts
make_font_lz4 "${name}" "${ttf_normal}" 8 "XXS" "sml" ${chars} --no-compress
make_font_lz4 "${name}" "${ttf_normal}" 9 "XS" "sml" ${chars} --no-compress
make_font "${name}" "${ttf_normal}" 11 "STD" "sml" ${chars} --no-compress
make_font_lz4 "${name}_bold" "${ttf_bold}" 11 "STD" "sml" ${chars} --no-compress
make_font_w_extra_sym "${name}" "${ttf_normal}" 15 "L" "sml" ${chars} --no-compress
make_font_no_sym "${name}_bold" "${ttf_bold}" 20 "XL" "sml" ${chars} --no-compress
make_font_no_sym "${name}_bold" "${ttf_bold}" 40 "XXL" "sml" "" --no-compress
make_font_lz4 "${name}" ${LATIN_FONT} "${ttf_normal}" 8 "XXS" "sml" ${chars}
make_font_lz4 "${name}" ${LATIN_FONT} "${ttf_normal}" 10 "XS" "sml" ${chars}
make_font "${name}" ${LATIN_FONT} "${ttf_normal}" 13 "STD" "sml" ${chars}
make_font_lz4 "${name}_bold" ${LATIN_FONT_BOLD} "${ttf_bold}" 13 "STD" "sml" ${chars}
make_font_w_extra_sym "${name}" ${LATIN_FONT} "${ttf_normal}" 19 "L" "sml" ${chars}
make_font_no_sym "${name}_bold" ${LATIN_FONT_BOLD} "${ttf_bold}" 25 "XL" "sml" ${chars}

# 800x480 LCD fonts
make_font_lz4 "${name}" "${ttf_normal}" 13 "XXS" "lrg" ${chars} --no-compress
make_font_lz4 "${name}" "${ttf_normal}" 19 "XS" "lrg" ${chars} --no-compress
make_font "${name}" "${ttf_normal}" 24 "STD" "lrg" ${chars} --no-compress
make_font_lz4 "${name}_bold" "${ttf_bold}" 24 "STD" "lrg" ${chars} --no-compress
make_font_w_extra_sym "${name}" "${ttf_normal}" 36 "L" "lrg" ${chars} --no-compress
make_font_no_sym "${name}_bold" "${ttf_bold}" 48 "XL" "lrg" ${chars} --no-compress
make_font_no_sym "${name}_bold" "${ttf_bold}" 96 "XXL" "lrg" "" --no-compress
make_font_lz4 "${name}" ${LATIN_FONT} "${ttf_normal}" 13 "XXS" "lrg" ${chars}
make_font_lz4 "${name}" ${LATIN_FONT} "${ttf_normal}" 19 "XS" "lrg" ${chars}
make_font "${name}" ${LATIN_FONT} "${ttf_normal}" 24 "STD" "lrg" ${chars}
make_font_lz4 "${name}_bold" ${LATIN_FONT_BOLD} "${ttf_bold}" 24 "STD" "lrg" ${chars}
make_font_w_extra_sym "${name}" ${LATIN_FONT} "${ttf_normal}" 36 "L" "lrg" ${chars}
make_font_no_sym "${name}_bold" ${LATIN_FONT_BOLD} "${ttf_bold}" 48 "XL" "lrg" ${chars}
}

# Bootloader font
make_bootloader_font "bl" "Roboto/Roboto-Regular.ttf" 16 "std" # 480x272, 480x320, 320x480
make_bootloader_font "bl" "Roboto/Roboto-Regular.ttf" 11 "sml" # 320x240
make_bootloader_font "bl" "Roboto/Roboto-Regular.ttf" 24 "lrg" # 800x480
make_bootloader_font "bl" ${LATIN_FONT} 16 "std" # 480x272, 480x320, 320x480
make_bootloader_font "bl" ${LATIN_FONT} 14 "sml" # 320x240
make_bootloader_font "bl" ${LATIN_FONT} 24 "lrg" # 800x480

# XXL fonts (no translation chars)
make_font_no_sym_no_trans "en_bold" ${LATIN_FONT_BOLD} 64 "XXL" "std"
make_font_no_sym_no_trans "en_bold" ${LATIN_FONT_BOLD} 50 "XXL" "sml"
make_font_no_sym_no_trans "en_bold" ${LATIN_FONT_BOLD} 96 "XXL" "lrg"

# Language fonts
make_font_set "en" "Roboto/Roboto-Regular.ttf" "Roboto/Roboto-Bold.ttf" ",${LATIN1}"
make_font_set "tw" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" ",${TW_SYMBOLS}"
make_font_set "cn" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" ",${CN_SYMBOLS}"
make_font_set "jp" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" ",${JP_SYMBOLS}"
make_font_set "he" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" ",${HE_SYMBOLS}"
make_font_set "ru" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" ",${RU_SYMBOLS}"
make_font_set "ua" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" ",${UA_SYMBOLS}"
make_font_set "ko" "Nanum/NanumBarunpenR.ttf" "Nanum/NanumBarunpenB.ttf" ",${KO_SYMBOLS}"
make_font_set "en" ${LATIN_FONT} ${LATIN_FONT_BOLD} "${LATIN1}"
make_font_set "tw" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" "${TW_SYMBOLS}"
make_font_set "cn" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" "${CN_SYMBOLS}"
make_font_set "jp" "Noto/NotoSansCJKsc-Regular.otf" "Noto/NotoSansCJKsc-Bold.otf" "${JP_SYMBOLS}"
make_font_set "he" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" "${HE_SYMBOLS}"
make_font_set "ru" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" "${RU_SYMBOLS}"
make_font_set "ua" "Arimo/Arimo-Regular.ttf" "Arimo/Arimo-Bold.ttf" "${UA_SYMBOLS}"
make_font_set "ko" "Nanum/NanumBarunpenR.ttf" "Nanum/NanumBarunpenB.ttf" "${KO_SYMBOLS}"

rm lv_font.inc
rm lz4_font
Loading
Loading