MCPcopy Create free account
hub / github.com/cifertech/DisplayKit / ensureElementFontFields

Function ensureElementFontFields

app.js:1774–1787  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

1772}
1773
1774function 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
1789function ensureAllElementsHaveFonts() {
1790 (screens || []).forEach((scr) => {

Callers 1

Calls 1

getElementFontForModeFunction · 0.85

Tested by

no test coverage detected