Custom fonts per map file #31

Open
opened 2026-08-12 16:39:13 +00:00 by ImBenji · 0 comments
Owner

Let users import a custom .ttf/.otf font (single style — bold/italic synthesized by the renderer, same as station labels already handle missing weights) and use it in the currently open map.

Font bytes get embedded as base64 directly in the map's .ana file, same pattern ReferenceImageObjectData already uses for images, and registered at runtime via Flutter's FontLoader under a generated internal family id (decoupled from the user-facing display name to avoid collisions).

Needs a dedicated "Fonts" management panel (import/rename/delete) whose entries show up alongside the built-in Google Fonts list in the existing font pickers (text label properties panel, blender canvas panel, canvas settings panel). Also needs CanvasState.setStationLabelFontFamily's hard whitelist against kStationLabelFontOptions loosened to accept a map's registered custom fonts, or it silently resets to Inter.

See follow-up: multi-file font families.

Let users import a custom .ttf/.otf font (single style — bold/italic synthesized by the renderer, same as station labels already handle missing weights) and use it in the currently open map. Font bytes get embedded as base64 directly in the map's .ana file, same pattern ReferenceImageObjectData already uses for images, and registered at runtime via Flutter's FontLoader under a generated internal family id (decoupled from the user-facing display name to avoid collisions). Needs a dedicated "Fonts" management panel (import/rename/delete) whose entries show up alongside the built-in Google Fonts list in the existing font pickers (text label properties panel, blender canvas panel, canvas settings panel). Also needs CanvasState.setStationLabelFontFamily's hard whitelist against kStationLabelFontOptions loosened to accept a map's registered custom fonts, or it silently resets to Inter. See follow-up: multi-file font families.
ImBenji added the enhancementarea:ui/ux labels 2026-08-12 16:39:13 +00:00
ImBenji added this to the Arcs & Angles project 2026-08-12 16:39:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: IMBENJI.NET/Metro-Map-Maker#31