Custom U8g2 font #372
Replies: 2 comments 2 replies
-
I mean in the designer you should be able to use the following method for U8G2 pre-packaged fonts, which is basically opening code generator dialog, select the "set font" button, choose U8G2/static, and enter the font. However, you probably need it to work more like an adafruit font where you include the header, and I think it would just work if you chose the Adafruit local to project option as it would then include the header file (assuming a header file of the same name as the font). Another option is that you manually setup the font in the theme header file, and set the font to default in the designer. Theme files are safe to edit, as they only get regenerated if you delete the theme file. |
Beta Was this translation helpful? Give feedback.
-
@davetcc I tried both your solutions. However they don't work for my usecase.
extern const GFXfont u8g2_font_6x10_t_complete; Instead, my font is defined like this: extern const uint8_t u8g2_font_6x10_t_complete[] U8G2_FONT_SECTION("u8g2_font_6x10_t_complete"); My usecase is therefore not covered. I can't change font structure to Adafruit To sum up:
By the way, how do you differentiate between different font structs? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I made a custom U8g2 font with extra glyphs to support my unicode characters. It work correctly with TcMenu when I update the file
tcMenuU8g2.cpp
.In this file I include my custom font header and then modify the following function:
However, the file
tcMenuU8g2.cpp
is overwritten every time I re-generate my code from the Designer. Is there a better way how to define my custom font? I tried to specify it in the Designer but so far I was not successful. The generated code still uses the original font, not my custom one.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions