m5stack / VAMeter-Firmware

M5-VAMeter firmware
MIT License
5 stars 4 forks source link

Image and font converter? #12

Open solosky opened 5 months ago

solosky commented 5 months ago

Hi team, I am working with this code and try to add some function, I would like to know how to generate code from raw image (png, jpeg, etc) and font file (.ttf, wof,etc). I didn't find related script in the repo, also cannot find any information in the LovyanGFX repo.

Thanks with best regards.

Forairaaaaa commented 5 months ago

Hi, I use lcd-image-converter to convert image into code, or you can put jpg images into file system and use them by lgfx api like this. As to the fonts, you can use processing to generate VLW font, use this to convert into code, then load font by lgfx api like this

solosky commented 4 months ago

Thanks.

Regarding lcd-image-converter, unfortunately it only provides Windows version and also cannot run in pipelines, I think I will write a python script to convert any image format to rgb565 format in .c or bin.

I still cannot find a python script to generate vlw font, maybe I need also create a python script to generate vlw font to run in pipeline, but I cannot find any document on the binary format of vlw font. Any suggestion for this?

Forairaaaaa commented 4 months ago

Thanks.

Regarding lcd-image-converter, unfortunately it only provides Windows version and also cannot run in pipelines, I think I will write a python script to convert any image format to rgb565 format in .c or bin.

I still cannot find a python script to generate vlw font, maybe I need also create a python script to generate vlw font to run in pipeline, but I cannot find any document on the binary format of vlw font. Any suggestion for this?

I only tried using processing to generarte vlw font so far~

Forairaaaaa commented 4 months ago

这个可以生成 vlw 字体~ https://docs.m5stack.com/en/guide/develop_tools/vlw_font_creator