您尚未登录。

楼主 #1 2019-07-31 15:56:32

cdft
会员
注册时间: 2019-07-31
已发帖子: 22
积分: 21.5

移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

移植用老版本littlevGL,移植成功后显示汉子成功;通过在线取模(https://littlevgl.com/ttf-font-to-c-array-old)。之前版本字体样式
lv_font_t chinese1_m1_font =
{
    .unicode_first = 19968,    /*First Unicode letter in this font*/
    .unicode_last = 40959,    /*Last Unicode letter in this font*/
    .h_px = 25,                /*Font height in pixels*/
    .glyph_bitmap = chinese1_m1_font_glyph_bitmap,    /*Bitmap of glyphs*/
    .glyph_dsc = chinese1_m1_font_glyph_dsc,        /*Description of glyphs*/
    //.glyph_cnt = 18,            /*Number of glyphs in the font*/
    .unicode_list = chinese1_m1_font_unicode_list,    /*List of unicode characters*/
    .get_bitmap = lv_font_get_bitmap_sparse,    /*Function pointer to get glyph's bitmap*/
    .get_width = lv_font_get_width_sparse,    /*Function pointer to get glyph's width*/
#if USE_CHINESE1_M1_FONT == 1
    .bpp = 1,                /*Bit per pixel*/
#elif USE_CHINESE1_M1_FONT == 2
    .bpp = 2,                /*Bit per pixel*/
#elif USE_CHINESE1_M1_FONT == 4
    .bpp = 4,                /*Bit per pixel*/
#elif USE_CHINESE1_M1_FONT == 8
    .bpp = 8,                /*Bit per pixel*/
#endif
    //.monospace = 0,                /*Fix width (0: if not used)*/
    .next_page = NULL,        /*Pointer to a font extension*/
};

移植最先版本littlevGL 6.0.0后,发现字体结构改变了,请教需要怎么修改?
typedef struct _lv_font_struct
{
    /** Get a glyph's  descriptor from a font*/
    bool (*get_glyph_dsc)(const struct _lv_font_struct *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next);

    /** Get a glyph's bitmap from a font*/
    const uint8_t * (*get_glyph_bitmap)(const struct _lv_font_struct *, uint32_t);

    /*Pointer to the font in a font pack (must have the same line height)*/
    uint8_t line_height;      /**< The real line height where any text fits*/
    uint8_t base_line;        /**< Base line measured from the top of the line_height*/
    void * dsc;               /**< Store implementation specific data here*/
#if LV_USE_USER_DATA
    lv_font_user_data_t user_data; /**< Custom user data for font. */
#endif
} lv_font_t;

离线

楼主 #2 2019-07-31 16:57:41

cdft
会员
注册时间: 2019-07-31
已发帖子: 22
积分: 21.5

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

https://littlevgl.com/ttf-font-to-c-array 上想生成字体移植失败。

离线

#3 2019-08-28 16:45:50

hengyongchao
会员
注册时间: 2019-05-05
已发帖子: 5
积分: 5

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

@cdft 这个问题后来解决了吗?

离线

楼主 #4 2019-08-28 16:51:06

cdft
会员
注册时间: 2019-07-31
已发帖子: 22
积分: 21.5

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

@hengyongchao 没有解决

离线

#5 2019-08-31 14:42:34

zwmasdf
会员
注册时间: 2019-08-31
已发帖子: 19
积分: 4

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

重新去光网生成字体即可使用

离线

#6 2019-08-31 14:47:17

超级萌新
会员
注册时间: 2018-05-04
已发帖子: 408
积分: 407

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

zwmasdf 说:

重新去光网生成字体即可使用

请问是哪个地址呢

离线

#7 2019-08-31 17:18:34

zwmasdf
会员
注册时间: 2019-08-31
已发帖子: 19
积分: 4

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

超级萌新 说:
zwmasdf 说:

重新去光网生成字体即可使用

请问是哪个地址呢

就是2楼的地址

离线

楼主 #8 2019-11-05 13:31:01

cdft
会员
注册时间: 2019-07-31
已发帖子: 22
积分: 21.5

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

zwmasdf 说:
超级萌新 说:
zwmasdf 说:

重新去光网生成字体即可使用

请问是哪个地址呢

就是2楼的地址

可以么?

离线

#9 2019-11-05 14:28:33

我思故我在
会员
注册时间: 2019-09-03
已发帖子: 244
积分: 243.5

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

分享一个好用的 littlevgl 字体生成工具. https://whycan.cn/t_1350.html

离线

#10 2019-11-07 13:20:27

silong1126
会员
注册时间: 2019-11-07
已发帖子: 32
积分: 32

Re: 移植lvgl,更新版本到6.0.0后,字体结构发生变化,不知道怎么修改?请大神赐教

学习下。。。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn