epikao
March 17, 2022, 8:08am
1
Hello
I need to use the offline converter “https://github.com/lvgl/lv_font_conv ” to convert a “.otf” font.
Unfortunately the examples for command sets on the homepage are quite complex.
I have the font “monofonto rg.otf” and now I want to convert it to a C-file (for LVGL), 20 pixel height and 1bit per pixel.
How should the command look like?
Maybe like this?:
lv_font_conv --font monofonto rg.otf --size 20 --format lvgl --bpp 1 -o monofonto rg.font ?
What does 0x20-0x7F actually mean? I just need the abc to Z + numbers dot, colon and comma…
Thanks
PGNet
March 17, 2022, 8:25am
2
Hi!
Convert OTF to TTF: OTF to TTF (Online & Free) — Convertio
0x20-0x7F means the character codes. You can check with Glyphr Studio by loading TTF: Glyphr Studio
Run lv_font_conv
on TTF with CLI arguments you want: https://github.com/lvgl/lv_font_conv#cli-params
If font file name contains whitespace, then do not forget to put it into double quotes, otherwise lv_font_conv
will not recognize arguments correctly!
Example:
lv_font_conv --font "monofonto rg.ttf" --output "monofonto rg.font" --bpp 1 --size 20 --format bin --range 0x21-0x7E --no-compress --no-kerning
epikao
March 17, 2022, 11:47am
3
Thank you very much for your help. Do I really need to convert OTF to TTF? According lv_font_conv it should also support otf, see:
Converts TTF/WOFF/OTF fonts to compact format , suitable for small embedded systems.
epikao
March 17, 2022, 2:23pm
4
I receive following error:
BTW: With the online converter it works…