MCPcopy Index your code
hub / github.com/cifertech/DisplayKit / sanitizeU8g2FontName

Function sanitizeU8g2FontName

app.js:1743–1749  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1741}
1742
1743function sanitizeU8g2FontName(value) {
1744 const v = String(value || "").trim();
1745 // Keep it strict so we don't generate invalid C++ identifiers.
1746 if (U8G2_FONT_VALUES.has(v)) return v;
1747 if (/^u8g2_font_[A-Za-z0-9_]+$/.test(v)) return v; // allow custom fonts user knows exist
1748 return DEFAULT_U8G2_FONT;
1749}
1750
1751function getElementFontForMode(el, mode) {
1752 if (!el) return mode === "u8g2" ? DEFAULT_U8G2_FONT : DEFAULT_TFT_FONT;

Callers 2

getElementFontForModeFunction · 0.85
setElementFontForModeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected