Using an online font conversion problem

Hello:
When I used the online font conversion, when I clicked the conversion button, the page simply refreshed.How to correctly convert fonts?


Thank you for reply!

Hi zlm! Welcome to the community.

I’ve only used the converter one time and I don’t remember having to do anything special. I’m in the US using an English character set - I don’t know if that matters.

I do remember seeing a comment somewhere in the forum that the online converter is not 100% error-proof. Have you tried using the offline version instead?

Sorry I can’t be much more help. You may have to wait for the devs to chime in if you can’t get this to work.

It looks like the online font converter didn’t load properly. You can try refreshing the page, or using the offline font converter instead.

HI:
Thank you for your reply.I tried the offline font conversion and it worked.I’ve tried this at my company and at home, and online font conversion doesn’t work.
I found a bug when I used label to display fonts(VS2013 simulator).In function
static uint32_t get_glyph_dsc_id(const lv_font_t * font, uint32_t letter),
fdsc->cmaps[i].type = 0xfffffffe,But what I’m actually setting is this LV_FONT_FMT_TXT_CMAP_SPARSE_TINY.
The following:


But my actual “type” members are as follows:

Finally, I found that “lv_font_fmt_txt_cmap_t” has only 2bit members of “type”:
%E6%8D%95%E8%8E%B74
I think that’s a problem,I modified it in two ways:
%E6%8D%95%E8%8E%B76 %E6%8D%95%E8%8E%B77

After that, the font will display normally.

Thanks for the detailed description.
I’ve applied your solution with lv_font_fmt_txt_cmap_type_t type;.

I wonder why it doesn’t cause problems in other places too.

This patter is used in lot of places in the library:

/** Format of font character map. */
enum {
    LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
    LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL,
    LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
    LV_FONT_FMT_TXT_CMAP_SPARSE_FULL,
};

typedef uint8_t lv_font_fmt_txt_cmap_type_t;

So lv_font_fmt_txt_cmap_type_t is unsigned. However, LV_FONT_FMT_TXT_CMAP_... might be treated as signed is Visual Studio, and in
if(fdsc->cmaps[i].type == LV_FONT_FMT_TXT_CMAP_SPARSE_TINY) both might be treated as signed.

This may be a different version,This is the case in my current version( lv_sim_visual_studio_sdl (6.0.0) by GitHub in 2019.11.14):

/* Format of font character map. */
typedef enum {
    LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
    LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL,
    LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
    LV_FONT_FMT_TXT_CMAP_SPARSE_FULL,
}lv_font_fmt_txt_cmap_type_t;

If you use

/* Format of font character map. */
enum {
    LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY,
    LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL,
    LV_FONT_FMT_TXT_CMAP_SPARSE_TINY,
    LV_FONT_FMT_TXT_CMAP_SPARSE_FULL,
};

typedef uint8_t lv_font_fmt_txt_cmap_type_t;

I don’t think you need to modify it,I tried and the new version (lv_font_fmt_txt_cmap_type_t type:2;)is correct,Thank you.

1 Like