页次: 1
static const uint8_t*
lv_font_get_bitmap_freetype(const struct _lv_font_struct *font, uint32_t unicode_letter)
{
return bitmap;
}static int16_t
lv_font_get_width_freetype(const struct _lv_font_struct *font, uint32_t unicode_letter)
{
/*Check the range*/
if(unicode_letter < font->unicode_first || unicode_letter > font->unicode_last) return -1;
FT_Error err = FT_Load_Char(face, unicode_letter, FT_LOAD_RENDER);
if (err == 0) {
lv_font_freetype.bpp = 8;
lv_font_freetype.bitmap_dx = face->glyph->bitmap_left;
lv_font_freetype.bitmap_dy = lv_font_freetype.monospace - face->glyph->bitmap_top;
lv_font_freetype.bitmap_row = face->glyph->bitmap.rows;
bitmap = face->glyph->bitmap.buffer;
return face->glyph->bitmap.width;
}bitmap = NULL;
return -1;
}代码很简单的,但是修改了部分的LV代码
你好,感谢你的分享,请教下littlevgl修改的部分是?最近也在移植中文显示,借鉴下楼主的方法。谢谢。
页次: 1