|
代码:
LV_FONT_DECLARE(lv_font_SourceHanSansSCVF_16);//引入字库
lv_obj_t* zh_label = lv_label_create(lv_scr_act());//获取默认屏幕
lv_obj_set_style_text_font(zh_label, &lv_font_SourceHanSansSCVF_16, LV_STATE_DEFAULT);// 设置风格的字体
lv_label_set_text(zh_label, "你好,这是思源黑体!");//显示文字
lv_obj_align(zh_label, LV_ALIGN_TOP_MID, 0, 0);
死在了第三行代码
模拟器报错:
static bool __user_font_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t * dsc_out, uint32_t unicode_letter, uint32_t unicode_letter_next) {
if( unicode_letter>__g_xbf_hd.max || unicode_letter<__g_xbf_hd.min ) {
return NULL;
}
uint32_t unicode_offset = sizeof(x_header_t)+(unicode_letter-__g_xbf_hd.min)*4;
uint32_t *p_pos = (uint32_t *)__user_font_getdata(unicode_offset, 4);
if( p_pos[0] != 0 ) {
glyph_dsc_t * gdsc = (glyph_dsc_t*)__user_font_getdata(p_pos[0], sizeof(glyph_dsc_t));
dsc_out->adv_w = gdsc->adv_w;
dsc_out->box_h = gdsc->box_h;
dsc_out->box_w = gdsc->box_w;
dsc_out->ofs_x = gdsc->ofs_x;
dsc_out->ofs_y = gdsc->ofs_y;
dsc_out->bpp = __g_xbf_hd.bpp;
return true;
}
return false;
报错的位置是生成的.c文件
|
|