标题: 0.4生成的字库在8.1版本上编译错误 [打印本页] 作者: feihongkld 时间: 2022-1-4 14:40 标题: 0.4生成的字库在8.1版本上编译错误 8.1版本的字库文件和生成的字库结构体有些不一样,/*Describe store additional data for fonts*/typedef struct {
/*The bitmaps of all glyphs*/
const uint8_t * glyph_bitmap;
/*Describe the glyphs*/
const lv_font_fmt_txt_glyph_dsc_t * glyph_dsc;
/*Map the glyphs to Unicode characters.
*Array of `lv_font_cmap_fmt_txt_t` variables*/
const lv_font_fmt_txt_cmap_t * cmaps;
/**
* Store kerning values.
* Can be `lv_font_fmt_txt_kern_pair_t * or `lv_font_kern_classes_fmt_txt_t *`
* depending on `kern_classes`
*/
const void * kern_dsc;
/*Scale kern values in 12.4 format*/
uint16_t kern_scale;
/*
* storage format of the bitmap
* from `lv_font_fmt_txt_bitmap_format_t`
*/
uint16_t bitmap_format : 2;
/*Cache the last letter and is glyph id*/
lv_font_fmt_txt_glyph_cache_t * cache;
} lv_font_fmt_txt_dsc_t;
是不是这个0.4不支持8.1版本
..\..\lvgl8\lvgl\src\font\myFont1.c(119465): error: #136: struct "<unnamed>" has no field "last_letter"
.last_letter = 0x9fa0,
..\..\lvgl8\lvgl\src\font\myFont1.c(119494): error: #136: struct "<unnamed>" has no field "last_letter"
if( unicode_letter==fdsc->last_letter ){
..\..\lvgl8\lvgl\src\font\myFont1.c(119495): error: #136: struct "<unnamed>" has no field "last_glyph_id"
i = fdsc->last_glyph_id;
..\..\lvgl8\lvgl\src\font\myFont1.c(119502): error: #136: struct "<unnamed>" has no field "last_glyph_id"
fdsc->last_glyph_id = i;
..\..\lvgl8\lvgl\src\font\myFont1.c(119503): error: #136: struct "<unnamed>" has no field "last_letter"
fdsc->last_letter = unicode_letter;
..\..\lvgl8\lvgl\src\font\myFont1.c(119516): error: #136: struct "<unnamed>" has no field "last_letter"
if( unicode_letter==fdsc->last_letter ){
..\..\lvgl8\lvgl\src\font\myFont1.c(119517): error: #136: struct "<unnamed>" has no field "last_glyph_id"
i = fdsc->last_glyph_id;
..\..\lvgl8\lvgl\src\font\myFont1.c(119524): error: #136: struct "<unnamed>" has no field "last_glyph_id"
fdsc->last_glyph_id = i;
..\..\lvgl8\lvgl\src\font\myFont1.c(119525): error: #136: struct "<unnamed>" has no field "last_letter"
fdsc->last_letter = unicode_letter;
..\..\lvgl8\lvgl\src\font\myFont1.c(119542): error: #147: declaration is incompatible with "const lv_font_t myFont1" (declared at line 239 of "..\..\lvgl8\lvgl\src/core/../misc/../font/lv_font.h")
lv_font_t myFont1 = {
..\..\lvgl8\lvgl\src\font\myFont1.c: 0 warnings, 10 errors
".\Output_Data\NUC972_FreeRTOS_LvglV8_Cap.axf" - 10 Error(s), 0 Warning(s).
lv_obj_t *label1 = lv_label_create(scr); /* 创建 label 控件 */
lv_obj_set_pos(label1,0,0); /* 设置控件的坐标 */
lv_label_set_text(label1,"Hello欢迎到来"); /* 设置文字 */
lv_obj_align(label1,LV_ALIGN_CENTER,0,0); /* 设置控件的对*/
} 注意需要修改lv_conf.h /*Optionally declare custom fonts here.
*You can use these fonts as default font too and they will be available globally.
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(myFont1)
/*Always set a default font*/
#define LV_FONT_DEFAULT &myFont1