What do you want to achieve?
I’d like to have freetype load fonts from different locations depending on what’s being requested. In my case, I’ve an embedded latin font that includes what I need for the majority of languages, but in the case of Japanese, Korean and Simplified Chinese, I’d like to pull the file from disk.
What have you tried so far?
I’ve got freetype working fine, and I’m able to load arbitrary fonts from locations that I specify on disk. From the docs:
If you want FreeType to use LVGL’s memory allocation and file system interface, you can enable :c:macro:LV_FREETYPE_USE_LVGL_PORT in lv_conf.h, convenient for unified management. If you do this, you will need to exclude the configured FreeType library’s ftsystem.c file from being compiled, since LVGL’s lv_ftsystem.c has custom versions of the functions defined therein.
This seems logical, but I see errors related to FT_ERR_PREFIX as soon as I enable LV_FREETYPE_USE_LVGL_PORT. I suspect I am missing something, but I’m not sure whether this is a bug. Is anyone else doing similar with some success?
Code to reproduce
Just define LV_USE_FREETYPE and LV_FREETYPE_USE_LVGL_PORT as 1.
Environment
- iMX8MP:
- LVGL version: See
9.4