LvglFontTool 开启"使用FreeType TTF,需抗锯齿建议使用",字形高度是20;
工具生成的lv_font_t
[C] 纯文本查看 复制代码 //Source Han Sans CN Medium,,-1
//字模高度:30
//XBF字体,外部bin文件
lv_font_t myfont = {
.get_glyph_bitmap = __user_font_get_bitmap,
.get_glyph_dsc = __user_font_get_glyph_dsc,
.line_height = 30,
.base_line = 0,
};
网页生成的lv_font_t
[C] 纯文本查看 复制代码 /*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t lv_font_han_medium_20 = {
#else
lv_font_t lv_font_han_medium_20 = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 23, /*The maximum line height required by the font*/
.base_line = 5, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
.underline_position = -2,
.underline_thickness = 1,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};
导致工具转出的字体数据不居中,是否可以优化?
SourceHanSansCN-Medium-2.rar
(6.41 MB, 下载次数: 3)
|