I’m working Teensy 4.1 on Arduino. I’d like to see just one complete example of how to use a font (I’m so embarrassed to ask something so basic!) I’ve done the online font converter, which creates the font just fine. I see many examples that say:
But the compiler complains “error: ‘lv_style_plain’ was not declared in this scope”
and “error: ‘struct lv_style_t’ has no member named ‘text’”
Looks like I need to #include something? The examples are SO good, and I’ve made excellent progress so far, but I can’t find a single complete example of how to use a font – what to #include, how to declare, etc. Just an example that creates a label in a new font and nothing more. Thanks in advance… --BE
I think you have to declare font before creating the style likeLV_FONT_DECLARE(Arial_75); and then lv_style_set_text_font(&text_style, LV_STATE_DEFAULT, &Arial_75);
Thanks Paul. I had already done
LV_FONT_DECLARE(Arial_75);
(in global space). I added
lv_style_set_text_font(&font_test_style, LV_STATE_DEFAULT, &Arial_75);
The compiler accepts that, but I still get exactly the same errors. There must be an lv_example that changes the font (e.g., there’s all that Montserrat definition), but I can’t find it (I don’t have WinGrep.)
THANKS!! That enabled me to get it working. But nothing happened until I applied the style to the label with (found buried deep in a “styles” example) :
The styles subject is pretty intense – I’m excited about learning more; it’s clearly designed to be flexible and powerful. And same goes for lvgl on a bigger level – allows embedding powerful graphics in a minimal system (i.e., boots immediately.) But I have a job to get done, so (again) a complete working example would have saved me precious time. Would it help others to post my final working code? I’d have to sanitize it a bit…