feat: support custom font files for song titles (Closes #4) #14
Reference in New Issue
Block a user
Delete Branch "feature/issue-4-support-custom-font-files-fraktur"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary\n\n- Improved
PdfFontMetrics: Uses canonical/absolute paths for cache keys to avoid duplicate font loading; validates font file existence with a clear error message before attempting to load; usesBaseFont.IDENTITY_Hencoding for full Unicode support (including German umlauts)\n- Added font file path resolution inSongbookPipeline: Relative font file paths insongbook.yamlare resolved against the project directory before validation and rendering\n- Added font file validation inValidator:validateConfig()now checks that all configured font files exist, producing clear error messages identifying which font role (title, lyrics, etc.) has the missing file\n- Added comprehensive tests: 7 new tests inPdfFontMetricsTest(custom font loading, umlaut rendering, cache deduplication, missing file error, bold delegation) and 4 new tests inValidatorTest(missing/existing font file validation)\n- Documented usage: Added commented example insongbook.yamlshowing how to configure a custom font file for titles\n\nCloses #4\n\n## Test plan\n\n- [x] All existing tests pass (gradle test)\n- [x] Custom font loading from TTF file works end-to-end\n- [x] German umlauts render correctly with custom font (IDENTITY_H encoding)\n- [x] Missing font file produces clear validation error\n- [x] Cache uses canonical paths to avoid duplicate font objects\n- [x] Font file paths are resolved relative to project directory\n- [x] Example config documents custom font usage"