Description
What is the easiest way to ad Cyrillic support for my display? Do I have to use the font converter to add the characters? I didn’t find any similar post with the search engine, nor in the documentation.
What MCU/Processor/Board and compiler are you using?
nRF52840
What do you want to achieve?
I have a running project that received data over BLE and displays it. When I send Cyrillic characters I get nothing on the display.
What have you tried so far?
Only the build in fonts
Code to reproduce
n/a
Screenshot and/or video
n/a
You need to reconvert a font and include Cyrillic character ranges. We don’t include many international characters by default because they’d make the font quite large.
- I generated
LV_FONT_MONTSERRAT_CYRILLIC_28
with the full range of symbols (0x00 to 0xFF)
- Added LV_FONT_MONTSERRAT_CYRILLIC_28.c in lv_font directory
- Added
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(LV_FONT_MONTSERRAT_CYRILLIC_28)
in lv_conf.h
- Modified the default font with #define
LV_THEME_DEFAULT_FONT_NORMAL &LV_FONT_MONTSERRAT_CYRILLIC_28
- Added the .c file into the project (I use Segger Embedded Studio).
When I compile the project I get the following errors:
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.42/gcc/arm-none-eabi/bin/ld: Output/ble_app_uart_freertos_pca10056_s140 Release/Obj/lv_obj.o: in function `lv_init':
1> C:\work\my\nordic\nRF5_SDK_17.0.0_9d13099\external\lvgl-7.1.0\src\lv_core/lv_obj.c:181: undefined reference to `LV_FONT_MONTSERRAT_CYRILLIC_28'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.42/gcc/arm-none-eabi/bin/ld: Output/ble_app_uart_freertos_pca10056_s140 Release/Obj/lv_draw_label.o: in function `lv_draw_label_dsc_init':
1> C:\work\my\nordic\nRF5_SDK_17.0.0_9d13099\external\lvgl-7.1.0\src\lv_draw/lv_draw_label.c:103: undefined reference to `LV_FONT_MONTSERRAT_CYRILLIC_28'
1> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 4.42/gcc/arm-none-eabi/bin/ld: Output/ble_app_uart_freertos_pca10056_s140 Release/Obj/lv_draw_rect.o: in function `lv_draw_rect_dsc_init':
1> C:\work\my\nordic\nRF5_SDK_17.0.0_9d13099\external\lvgl-7.1.0\src\lv_draw/lv_draw_rect.c:82: undefined reference to `LV_FONT_MONTSERRAT_CYRILLIC_28'
Build failed
What am I doing wrong? Thank you!
Check the generated C file for an #ifdef
guard - I think there is another define you need to add to make it include the font.
This is how the generated file starts:
#include "../../lvgl.h"
/*******************************************************************************
* Size: 28 px
* Bpp: 4
* Opts:
******************************************************************************/
#ifndef LV_FONT_MONTSERRAT_CYRILLIC_28
#define LV_FONT_MONTSERRAT_CYRILLIC_28 1
#endif
#if LV_FONT_MONTSERRAT_CYRILLIC_28
So it’s enables, wright?
I’m suspicious that the capital name you put on the font…
Modified the default font with #define LV_THEME_DEFAULT_FONT_NORMAL &LV_FONT_MONTSERRAT_CYRILLIC_28
is causing issues.
I’d suggest that you generate it with a lowercase name (the converter will still generate the macros in uppercase) and see if that fixes the problem.
actually the file name is with lower cases. I changed the following line to lower cases and the code compiles:
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(lv_font_montserrat_cyrillic_28)
Thank you for your tips
Good evening!
I’m trying to embed the Russian language in the esp32, but I can generate a font with Russian and English. Can you send your font lv_font_montserrat_cyrillic_28 ?
alansbor @ yandex dot ru