-
Notifications
You must be signed in to change notification settings - Fork 1.1k
u8g2optimization
On AVR systems, use the Arduino F()
macro. U8g2 supports the Arduino print
function, which accepts the F()
macro.
A simple example for the F()
macro is available as an example:
A more complex example is here:
Usually U8g2 fonts are available in different sizes (number of glyphs included in the font). The last letter of the font name indicates the character set (and the size) of the fonts.
Font Name | Character Set |
---|---|
u8g2_xxx_xe | Extended: Glyphs with unicode 32 to 701 are included in the font (v2.16.x will also include big ß) |
u8g2_xxx_xf | Full: Glyphs with unicode 32 to 255 are included in the font |
u8g2_xxx_xr | Restricted: Only characters from 32 to 127 are included |
u8g2_xxx_xu | Uppercase: Numbers and uppercase letters |
u8g2_xxx_xn | Numbers and some extra glyphs for date and time printing are included |
u8g2_xxx_x_something | Special selection of glyphs. See the font picture for details. |
For example if only a number needs to be displayed with a font,
then the font should contain only numbers. In such a case, it is better to
select a n
font to avoid the allocation of unneeded chars in the flash memory.
Each font picture also includes the number of bytes, occupied by the font in flash memory (upper part of the picture, third line):
These pictures are available on the font group pages.
See also: setFont