Skip to content

Fix font file embedding mismatch between FontFileFinder and EpubMaker#7655

Closed
Copilot wants to merge 3 commits intoBL-15558FixFontEmbeddingfrom
copilot/sub-pr-7644
Closed

Fix font file embedding mismatch between FontFileFinder and EpubMaker#7655
Copilot wants to merge 3 commits intoBL-15558FixFontEmbeddingfrom
copilot/sub-pr-7644

Conversation

Copy link

Copilot AI commented Feb 4, 2026

When BoldItalic font variant is missing, EpubMaker.AddFontFace generates CSS referencing the Italic fallback, but FontFileFinder.GetFileForFont returns the Bold fallback, causing BloomPUB to embed the wrong font file.

Changes

  • Aligned FontFileFinder.GetFileForFont fallback priority with EpubMaker.AddFontFace: BoldItalic > Italic > Bold > Normal
  • Previously: BoldItalic > Bold > Italic > Normal

Impact
For a BoldItalic request with only Italic and Bold available:

// fonts.css now references:
@font-face { font-family:'MyFont'; font-weight:normal; font-style:italic; src:url(MyFont-Italic.ttf); }

// and BloomPUB embeds: MyFont-Italic.ttf ✓
// instead of:         MyFont-Bold.ttf ✗

This ensures CSS font references match embedded files, preventing missing font errors in BloomPUBs and EPUBs.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


This change is Reviewable


Open with Devin

hatton and others added 2 commits February 3, 2026 16:50
Also, give the user a chance to read notes like ones about font embedding.

Review: JohnThomson - progressKind switch cleanup -> clearer fall-through

Review: andrew-polk - AddFontFace step number -> rename to Step 3

3rd
…uests

This aligns FontFileFinder.GetFileForFont with EpubMaker.AddFontFace's cascade
(BoldItalic > Italic > Bold > Normal), ensuring the font files copied into
BloomPUB match the files referenced in fonts.css.

Co-authored-by: andrew-polk <5847219+andrew-polk@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix feedback from review on PR #7644 Fix font file embedding mismatch between FontFileFinder and EpubMaker Feb 4, 2026
Copilot AI requested a review from andrew-polk February 4, 2026 17:21
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@hatton hatton force-pushed the BL-15558FixFontEmbedding branch from cdaecb5 to 9e858ba Compare February 5, 2026 22:45
@andrew-polk andrew-polk closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants