| 2015 | } |
| 2016 | |
| 2017 | function getPreviewFontFamily(u8g2FontName) { |
| 2018 | const f = String(u8g2FontName || "").toLowerCase(); |
| 2019 | // Rough mapping: we don't have U8g2 fonts in the browser, so map to "similar" web families |
| 2020 | if (f.includes("helv")) return 'system-ui, -apple-system, "Segoe UI", Arial, sans-serif'; |
| 2021 | if (f.includes("ncen")) return 'Georgia, "Times New Roman", Times, serif'; |
| 2022 | if (f.includes("profont") || f.includes("t0_") || f.includes("6x") || f.includes("5x") || f.includes("7x") || f.includes("8x") || f.includes("9x") || f.includes("10x")) { |
| 2023 | return 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'; |
| 2024 | } |
| 2025 | return 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'; |
| 2026 | } |
| 2027 | |
| 2028 | function getPreviewTftFontStyle(tftFontValue, textSize) { |
| 2029 | const v = String(tftFontValue || DEFAULT_TFT_FONT); |