Utilities to convert
- pictures
- operation system fonts
to raw C arrays.
The utilities are written to be compatible with the Littlev Graphics Library.
GitHub: https://github.com/littlevgl/lvgl
Website: http://www.gl.littlev.hu
Both of the utilities are using Python scripts. So you has to install Python on your operation system.
Clone or download the repository: git clone https://github.com/littlevgl/utils.git
- Copy an image to img_conv folder
- Open a Terminal and go to this directory
- Type to the Terminal:
python img_cony.py test.png 16 1
. Parameters:- Image file name
- Color depth: 8/16/24
- Set Transp. bit in the header or not (it means pixels with a specific color are not drawn - aka color keying)
- Check the output img_test.c and img_test.bin
For more iformation visit http://www.gl.littlev.hu/image-converter/
- Install BMfont with font_create/install_bmfont_1.13.exe
- Open BMfont:
- In Options/Font settings choose a font, set its size and other settings (bold, italian etc.)
- In Options/Export settings choose XML file format and .png texture. Set the texture width and height to 512.
- Save the fnt file: Options/Save bitmap font as…
- According to font_create/test_conf create/modify a configuration file:
- CFontName The file name of the .fnt file without extension
- BytesWidth How much bytes are needed to represent the full width of the letters. One pixel means one bit, so 2 bytes are enough for maximum 16 pixel width.
- BytesHeight The same as the font height in Font settings of BMFont.
- FirstAscii and LastAscii the range of letters.
- Be sure the fnt file, the configuration file and fnt2py.py are in the same folder
- In Terminal go to this folder and type:
python fnt2py.py font_conf
- Check the generated .c and h files
For more information visit: http://www.gl.littlev.hu/font-import/