阿里兄 发表于 2022-4-8 17:16:45

LvglFontTool字体工具V0.5测试版

本帖最后由 阿里兄 于 2022-4-22 14:10 编辑

LvglFontTool字体工具V0.5测试版,发出来给大家用一用。

LvglFontTool字体工具V0.5测试版:
1、增加对LVGL V8.0以上支持。
2、取消TTF文件字体,其实QT自带TTF处理,效果一样好的,还不用找TTF文件。


图片就不上了。



发现XBF内部字体和XBF外部BIN字体不能正常显示,有需要的XBF字体的请先使用0.4版本吧。

iven 发表于 2022-4-13 08:11:27

感谢阿里兄,前两天我还以为论坛有问题了

阿里兄 发表于 2022-4-13 08:27:48

iven 发表于 2022-4-13 08:11
感谢阿里兄,前两天我还以为论坛有问题了

是个人备案的域名不能用于论坛,虽然加了跳转,不知道后面有没有问题。

iven 发表于 2022-4-13 09:37:08

阿里兄 发表于 2022-4-13 08:27
是个人备案的域名不能用于论坛,虽然加了跳转,不知道后面有没有问题。 ...

阿里兄,要搞设计器吗?感觉NXP的不怎么好用,官方的收费,开源的BUG多

阿里兄 发表于 2022-4-13 10:38:03

iven 发表于 2022-4-13 09:37
阿里兄,要搞设计器吗?感觉NXP的不怎么好用,官方的收费,开源的BUG多

设计器不是那么好搞的,又花时间,吃力不讨好啊

222222 发表于 2022-5-6 09:38:55

哈喽 阿里兄,在使用LvglFontTool字体工具V0.5测试版时,发现转换8.0版本以上的中文字体时 在转换过程中会出现崩溃的现象。。。

阿里兄 发表于 2022-5-6 10:53:22

222222 发表于 2022-5-6 09:38
哈喽 阿里兄,在使用LvglFontTool字体工具V0.5测试版时,发现转换8.0版本以上的中文字体时 在转换过程中会 ...

你转的文字是不是很多,如果是的话,用V0.4版本XBF字体,直接存文件。

haonan1211 发表于 2022-5-25 14:27:32

(7.776, +74)   lv_font_get_glyph_bitmap: Asserted at expression: font_p != NULL (NULL pointer)      (in lv_font.c line #51)

LVGL8.2版本

使用自定义字体报错,使用内置字体正常

若安 发表于 2022-6-2 10:38:17

你好,想请教一下,韩文字库该怎么制作呀,是不是需要一个<用一级二级韩文字.txt>文档,我找不到,求助呀阿里兄

阿里兄 发表于 2022-6-2 10:42:04

若安 发表于 2022-6-2 10:38
你好,想请教一下,韩文字库该怎么制作呀,是不是需要一个文档,我找不到,求助呀阿里兄 ...

把用到的韩文字符复制进去,怎么找所有韩文文字你自己百度一 下。

若安 发表于 2022-6-2 10:48:31

阿里兄 发表于 2022-6-2 10:42
把用到的韩文字符复制进去,怎么找所有韩文文字你自己百度一 下。

百度上也找不到

star_water 发表于 2022-6-16 14:02:16

大佬能不能添加一个自定义图标字体的功能,把图片转成图标字体

阿里兄 发表于 2022-6-16 17:50:30

star_water 发表于 2022-6-16 14:02
大佬能不能添加一个自定义图标字体的功能,把图片转成图标字体

方法可以参考下这里:http://dz.lfly.xyz/forum.php?mod=viewthread&tid=31&extra=page%3D2

iven 发表于 2022-6-30 15:00:29

测试发现,我如果选择18号字体,结果转换出来26号字体,怎么解呢?

阿里兄 发表于 2022-6-30 15:02:35

iven 发表于 2022-6-30 15:00
测试发现,我如果选择18号字体,结果转换出来26号字体,怎么解呢?

字体的多少号,和像素是什么关系,我也不知道,你自己调节到合适的像素就行,字号那里还可以手动输入字号。

star_water 发表于 2022-6-30 16:29:38

阿里兄 发表于 2022-6-16 17:50
方法可以参考下这里:http://dz.lfly.xyz/forum.php?mod=viewthread&tid=31&extra=page%3D2

多谢指教

zhaosj 发表于 2022-7-1 17:31:34

8.0版本
可以用V0.5测试版把全字库保存到spi flash   然后使用吗

阿里兄 发表于 2022-7-1 17:33:32

zhaosj 发表于 2022-7-1 17:31
8.0版本
可以用V0.5测试版把全字库保存到spi flash   然后使用吗

XBF内部字体和XBF外部BIN字体不能正常显示,有需要的XBF字体的请先使用0.4版本吧。如果你是生成外部BIN字体,就先有0.4的。

qq295157970 发表于 2022-7-5 15:13:34

由于LVGL8.1以后字体增加了:uint8_t is_placeholder: 1; /** Glyph is missing. But placeholder will still be displayed */

/** Describes the properties of a glyph.*/
typedef struct {
    const struct _lv_font_t *
      resolved_font; /**< Pointer to a font where the gylph was actually found after handling fallbacks*/
    uint16_t adv_w; /**< The glyph needs this space. Draw the next glyph after this width.*/
    uint16_t box_w; /**< Width of the glyph's bounding box*/
    uint16_t box_h; /**< Height of the glyph's bounding box*/
    int16_t ofs_x;/**< x offset of the bounding box*/
    int16_t ofs_y;/**< y offset of the bounding box*/
    uint8_t bpp: 4;/**< Bit-per-pixel: 1, 2, 4, 8*/
    uint8_t is_placeholder: 1; /** Glyph is missing. But placeholder will still be displayed */
} lv_font_glyph_dsc_t;

会时不时引起这个错误: (0.291, +0)      lv_font_get_glyph_bitmap: Asserted at expression: font_p != NULL (NULL pointer)      (in lv_font.c line #51)

解决办法字体取模后要增加:dsc_out->is_placeholder = false;

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) {
    lv_font_fmt_txt_dsc_t * fdsc = (lv_font_fmt_txt_dsc_t *) font->dsc;

    if( unicode_letter<fdsc->cmaps.range_start || unicode_letter>fdsc->cmaps.range_length ) return false;

    int i;
    if( unicode_letter==fdsc->cache->last_letter ){
      i = fdsc->cache->last_glyph_id;
    }
    else{
      i = binsearch(fdsc->cmaps.unicode_list, fdsc->cmaps.list_length, unicode_letter);
    }
    if( i != -1 ) {
      const lv_font_fmt_txt_glyph_dsc_t * gdsc = &fdsc->glyph_dsc;
      fdsc->cache->last_glyph_id = i;
      fdsc->cache->last_letter = unicode_letter;
      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   = fdsc->bpp;
      dsc_out->is_placeholder = false;//add202207
      return true;
    }
    return false;
}

阿里兄 发表于 2022-7-5 16:02:09

qq295157970 发表于 2022-7-5 15:13
由于LVGL8.1以后字体增加了:uint8_t is_placeholder: 1; /** Glyph is missing. But placeholder will sti ...

:handshake感谢老哥,下次有机会加上区分;这字体结构又修改了,无语了。

qq295157970 发表于 2022-7-5 17:20:21

阿里兄 发表于 2022-7-5 16:02
感谢老哥,下次有机会加上区分;这字体结构又修改了,无语了。

不是系统自带的字体,增加了字体:思源黑体。坑锯齿 4,size: 12 ,版本V8.0以上,内部字体。

上位机LvglFontTool字体工具V0.5测试版上面显示框显示是正常的,但是用在下面LVGL显示出来好像变瘦了。

用LvglFontTool字体工具V0.3导出来的文件显示是正常。

fan 发表于 2022-10-7 15:03:58

生成的line_height值为0,导致文字无法显示

阿里兄 发表于 2022-10-8 08:26:46

fan 发表于 2022-10-7 15:03
生成的line_height值为0,导致文字无法显示

测试版XFB字体是这样,没有修复,你手动改一下高度也是可以的,可以切换回内部字体看高度是多少。

scorpion9111 发表于 2023-1-11 16:04:03

牛逼了,太好了

阿里兄 发表于 2023-1-11 16:05:55

scorpion9111 发表于 2023-1-11 16:04
牛逼了,太好了

还没完善,看看过年有没有时间搞一搞了。

sniper_15 发表于 2023-3-13 15:13:31

哥哥 ,你还没过完年啊,大家都等不及了,要不开源大家一起搞吧

阿里兄 发表于 2023-3-13 22:36:28

sniper_15 发表于 2023-3-13 15:13
哥哥 ,你还没过完年啊,大家都等不及了,要不开源大家一起搞吧

哈哈,忙着搞项目:$

jundg1987 发表于 2023-4-1 18:59:54

1.awesome中在【fontawesome-webfont.ttf】中增加的字库字符,无法在【插入awesome图标】-->【设置图标字体】中显示出来。但字库生产的时候是可以正常使用的。

阿里兄 发表于 2023-4-2 21:15:27

jundg1987 发表于 2023-4-1 18:59
1.awesome中在【fontawesome-webfont.ttf】中增加的字库字符,无法在【插入awesome图标】-->【设置图标字体 ...

http://dz.lfly.xyz/forum.php?mod=viewthread&tid=31&extra=page%3D2

参考一下这里

smallzz 发表于 2023-4-20 17:39:46


咨询下楼主,为何用阿里字库只转了 字符+数字+"天气番茄钟设置闹钟小夜灯专注中休息未开始心动相册“加这几个汉字生成的bin文件包高达160Kb;请问这是正常现象嘛?

页: [1] 2
查看完整版本: LvglFontTool字体工具V0.5测试版