(el)
| 1772 | } |
| 1773 | |
| 1774 | function ensureElementFontFields(el) { |
| 1775 | if (!el) return; |
| 1776 | // Seed driver-specific fields from legacy el.font if possible. |
| 1777 | if (!el.u8g2Font) { |
| 1778 | if (typeof el.font === "string" && el.font.startsWith("u8g2_font_")) el.u8g2Font = el.font; |
| 1779 | else el.u8g2Font = DEFAULT_U8G2_FONT; |
| 1780 | } |
| 1781 | if (!el.tftFont) { |
| 1782 | if (TFT_FONT_VALUES.has(String(el.font))) el.tftFont = String(el.font); |
| 1783 | else el.tftFont = DEFAULT_TFT_FONT; |
| 1784 | } |
| 1785 | // Keep legacy `font` valid for the active mode. |
| 1786 | el.font = getElementFontForMode(el, driverMode); |
| 1787 | } |
| 1788 | |
| 1789 | function ensureAllElementsHaveFonts() { |
| 1790 | (screens || []).forEach((scr) => { |
no test coverage detected