From b5426da2a72fabf5d485d56cec8334bfc7419bf6 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Fri, 22 May 2026 14:25:38 -0400 Subject: [PATCH] fix(fonts): skip preview API call for BDF bitmap fonts (#345) The font preview endpoint explicitly rejects .bdf files (glyph rendering not implemented server-side), returning 400. The JS didn't know this and called the endpoint for every selected font, causing a noisy 400 on load. Guard added in updateFontPreview(): if the selected font ends in .bdf, show "Preview not available for BDF bitmap fonts" and return early instead of hitting the API. Co-authored-by: Chuck Co-authored-by: Claude Sonnet 4.6 --- web_interface/templates/v3/partials/fonts.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web_interface/templates/v3/partials/fonts.html b/web_interface/templates/v3/partials/fonts.html index 43084e02..fec1d16a 100644 --- a/web_interface/templates/v3/partials/fonts.html +++ b/web_interface/templates/v3/partials/fonts.html @@ -843,6 +843,14 @@ async function updateFontPreview() { return; } + // BDF bitmap fonts cannot be rendered server-side — skip the API call + if (family.toLowerCase().endsWith('.bdf')) { + previewImage.style.display = 'none'; + loadingText.style.display = 'block'; + loadingText.textContent = 'Preview not available for BDF bitmap fonts'; + return; + } + // Show loading state loadingText.textContent = 'Loading preview...'; loadingText.style.display = 'block';