--- /dev/null
+typedef struct {
+ int maxSize;
+ const uint8_t* u8g2;
+} FontInfo;
+
+#define CyrFonts 4
+
+const FontInfo CyrFontArray[CyrFonts] = {
+ { 5, u8g2_font_4x6_t_cyrillic },
+ { 9, u8g2_font_6x13_t_cyrillic },
+ { 12, u8g2_font_9x15_t_cyrillic },
+ { 24, u8g2_font_inr24_t_cyrillic },
+};
+
+#define NumFonts 8
+
+const FontInfo NumFontArray[NumFonts] = {
+ { 5, u8g2_font_4x6_t_cyrillic },
+ { 9, u8g2_font_6x13_t_cyrillic },
+ { 12, u8g2_font_9x15_t_cyrillic },
+ { 16, u8g2_font_logisoso16_tf },
+ { 24, u8g2_font_logisoso24_tf },
+ { 32, u8g2_font_logisoso32_tf },
+ { 50, u8g2_font_logisoso50_tf },
+ { 92, u8g2_font_logisoso92_tn }
+};
+
+void SetCyrFont(byte size) {
+ for (byte i=0; i<CyrFonts; i++) {
+ if (CyrFontArray[i].maxSize<size) u8g2Fonts.setFont(CyrFontArray[i].u8g2);
+ }
+};
+
+void SetNumFont(byte size) {
+ for (byte i=0; i<NumFonts; i++) {
+ if (NumFontArray[i].maxSize<size) u8g2Fonts.setFont(NumFontArray[i].u8g2);
+ }
+};
+
+