Conversation
…ith' - Files opened via 'Open with' are now automatically selected in FileContext - This enables immediate access to all PDF tools without manual reselection - Moved AppInitializer inside ToolWorkflowProvider to fix context availability Fixes Stirling-Tools#6029
…g-Tools#5479) - Add public fonts endpoint (/api/v1/general/fonts) to security whitelist - Add FontController and FontService for backend font management - Add useSystemFonts hook for frontend font loading - Support both web (Vite proxy) and Tauri desktop modes - Include font cache refresh endpoint for post-installation updates - Update TextInputWithFont and TypeSignatureText components to use system fonts
|
Why would we want to add the fonts to auth exclusion? Only logged in users should need to access these endpoints Edit: Great feature idea btw appreciate you making this! |
The fonts endpoint could benefit from being public because: 1.. No Security Risk -> Font names alone won't expose sensitive data like file paths, user info, system details etc. However, I understand the security-first approach. Should I move it back to authenticated-only?" |
Description of Changes
This PR adds system fonts API endpoint and frontend integration to enable users to select from available system fonts in the Stirling PDF application.
Summary
/api/v1/general/fontspublic API endpoint that returns a cached list of system-installed fontsFontServiceto discover and cache fonts from AWT and system font directoriesFontControllerwith endpoints:GET /api/v1/general/fonts- Returns list of available fontsPOST /api/v1/general/fonts/refresh- Forces font cache refresh after system font installation/api/v1/general/fontsto public whitelist inRequestUriUtils(no authentication required)useSystemFontshook that:TextInputWithFontcomponent to use system fonts instead of hardcoded listTypeSignatureTextcomponent to use system fonts with refresh buttonWhy This Change
Users were limited to hardcoded font lists (5 fonts) when annotating PDFs or creating signatures. This prevented them from using their system-installed fonts, reducing usability and functionality.
Challenges Encountered
Font.createFont()has limited format support; added fallback filename extractionTesting
Closes #5479
Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.py(no new translation keys)UI Changes (if applicable)
Testing (if applicable)
curl http://localhost:8080/api/v1/general/fontsreturns 200 OK with full font listScreenshot for Reference