mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-05-23 04:53:33 +00:00
fix(fonts): skip preview API call for BDF bitmap fonts
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: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -843,6 +843,14 @@ async function updateFontPreview() {
|
|||||||
return;
|
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
|
// Show loading state
|
||||||
loadingText.textContent = 'Loading preview...';
|
loadingText.textContent = 'Loading preview...';
|
||||||
loadingText.style.display = 'block';
|
loadingText.style.display = 'block';
|
||||||
|
|||||||
Reference in New Issue
Block a user