-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
中文加载问题 #71
Comments
代码的文件编码用UTF8 |
我用官方的工具生成的也是UTF8格式的,,字库直接定义在lv_config.h文件的宏是可以正常显示中文的[#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(font_bahnschrift_18)],然而我把它添加至ResourceManager却无法显示,报的错误是 not found for U+4BB ,在生成的字库中所显示的字体对应的是U+4E00。是不是ResourceManager中Vector容器添加中文字模后再读出来会出了问题?(生成的字库文件除了中文其他数字和英文都是正常的) |
ResourceManager其实就是一个简单的key-value匹配,是不是请求字体key的时候没有请求成功,返回了默认字体。 |
请求成功了,字库中的英文和数字都显示正常,只有中文显示异常,楼主有空可以测试一下吗 |
我用自己生成的字库直接替换工程的font_bahnschrift_17,直接搞了一个demo中文显示是正常的 昨天我做了很多测试 /*******************************************************************************
#ifdef LV_LVGL_H_INCLUDE_SIMPLE #ifndef FONT_BAHNSCHRIFT_18 #if FONT_BAHNSCHRIFT_18 /*-----------------
/Store the image of the glyphs/
}; /*---------------------
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { /*---------------------
static const uint16_t unicode_list_1[] = { /Collect the unicode lists and glyph_id offsets/ /*--------------------
#if LV_VERSION_CHECK(8, 0, 0) /*-----------------
/Initialize a public general font descriptor/ #endif /#if FONT_BAHNSCHRIFT_18/ |
文件编码不是指字库文件,而是存中文字符的代码文件, 你测试的中文可以显示是因为 |
受教了,非常感谢 |
您好,我用lvgl官方工具生成一些中文字体后用ResourceManager管理却无法显示中文?有解决方法吗
The text was updated successfully, but these errors were encountered: