Skip to content

Warn about missing document fonts without blocking conversion - #417

Merged
KnifeLemon merged 8 commits into
KnifeLemon:mainfrom
Perricheno:feature/missing-font-notice
Oct 23, 2026
Merged

KnifeLemon merged 8 commits into
KnifeLemon:mainfrom
Perricheno:feature/missing-font-notice

Conversation

@Perricheno

@Perricheno Perricheno commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Implements the non-blocking first stage of #413.

  • Preflights fonts referenced by DOCX, XLSX, PPTX and HWPX before LibreOffice/rhwp rendering.
  • Ignores embedded fonts, theme placeholders, installed families and known metric-compatible aliases such as Calibri → Carlito.
  • Keeps conversion running and shows the missing family list in the existing job card.
  • Get fonts opens only trusted sources: Microsoft typography pages for proprietary Microsoft families, official project pages where known, and Google Fonts otherwise. Nothing is downloaded or installed silently.
  • CLI text and JSON report the same warning and watch jobs never pause.
  • XML scanning is bounded and fail-open, so malformed font metadata cannot block conversion.

UI

The card below shows the missing-font notice after document conversion:

Missing-font warning in the Filee conversion card

Tested with the reported Syllabus.docx: it completes and reports only the families unavailable on the machine. Focused engine, queue, CLI, UI and all-localization tests pass.

@KnifeLemon KnifeLemon added the feature New features label Oct 22, 2026
@KnifeLemon KnifeLemon self-assigned this Oct 22, 2026

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @Perricheno. The non-blocking shape from your #413 comment is the right one: nothing pauses, the CLI and watch folders only report, and nothing is downloaded or installed. CI is green. A few things need another pass:

  1. Fonts the user's document never named. On the built-in routes (Markdown, DOCX, XLSX … → HWPX → rhwp) RhwpConverter checks the HWPX that Filee wrote itself, and that one always lists 맑은 고딕 and 함초롬돋움 from Filee's HWPX template (DocumentFonts.Referenced on a Markdown → HWPX output returns exactly those two). On a PC without the Hancom fonts, and on Linux and macOS, every such PDF would report fonts that aren't in the user's file. Please check only the job's original source, or skip HWPX files Filee made.
  2. Symbol fonts. Word's bullets name Symbol and Wingdings in word/numbering.xml, and LibreOffice maps them to OpenSymbol. On Linux (and on macOS for Wingdings) nearly every bulleted DOCX would warn about them. Please treat Symbol, Wingdings, Wingdings 2/3 and Webdings like the metric-compatible aliases.
  3. Cost on large files. Every XML part under word/, xl/ and ppt/ up to 64 MB is loaded into an XDocument before LibreOffice starts, including every worksheet of an XLSX, which never names a font. Please read only the parts that can (document, styles, numbering, theme, xl/styles.xml, slides/layouts/masters, Contents/header.xml) and use a streaming XmlReader.
  4. Fail-open. The header says malformed metadata can never block a conversion, but Missing catches four exception types and runs outside the converters' try blocks. Please catch everything except cancellation, and skip non-ZIP inputs (.doc, .xls, .hwp, .rtf) by extension instead of through an exception.
  5. Get fonts opens up to eight browser tabs in one click. One page is enough: the first family's source, or the list with a link per font. For families such as 맑은 고딕, 함초롬바탕 or MS Mincho a Google Fonts search finds nothing, so those are better without a link.
  6. RhwpFonts.Find caches its answer for the whole session, so after installing a font the card keeps calling it missing until Filee restarts. Clearing that entry before the check (or saying so in the card) would avoid confusion.
  7. Please remove docs/media/missing-fonts-toast-en.png. Screenshots for the description are fine on a separate branch (as in #428), but we don't keep them in the repository.
  8. A line in docs/ARCHITECTURE.md next to the notices (ConversionStep.MissingFonts → FileResult.MissingFonts → the card and the CLI) would help the next reader.

@Perricheno

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review. Addressed all eight points in 5fb2cad:

  1. The font preflight now receives the job's original source path, so built-in routes no longer report fonts from Filee-generated HWPX templates.
  2. Symbol, Wingdings (including 2/3), Webdings and OpenSymbol are excluded from missing-font warnings.
  3. The scanner uses XmlReader and reads only font-bearing OOXML/HWPX parts; it skips worksheets and unrelated package entries.
  4. Legacy non-ZIP formats are skipped by extension, and metadata errors fail open except for cancellation.
  5. Get fonts opens at most one source page. Families such as Malgun Gothic, HCR Batang/Dotum and MS Mincho keep the warning but have no misleading Google Fonts button.
  6. The font lookup cache entry is cleared before each preflight lookup, so an installed font can be recognized without restarting Filee.
  7. Removed the screenshot from docs/media.
  8. Documented the MissingFonts flow in docs/ARCHITECTURE.md.

Local checks: 457 core tests, 5 focused engine tests and 4 toast UI tests passed. I also tried the broad app/engine suites; those hit unrelated local-environment failures (for example, an unavailable libspeex encoder and repository-root detection with an external build directory), so I am leaving the full cross-platform verdict to CI.

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @Perricheno, I went through 5fb2cad point by point and everything from the last review is addressed:

  1. rhwp and LibreOffice now check step.OriginalSourcePath, so Markdown/TXT → HWPX → PDF reports nothing and a DOCX reports its own fonts.
  2. Symbol, Wingdings 1-3, Webdings and OpenSymbol are skipped.
  3. XmlReader over the font-bearing parts only; worksheets are no longer read.
  4. Everything except cancellation is caught, and legacy formats are skipped by extension.
  5. One page per click, and no link for families without a public page.
  6. The cached lookup is forgotten before each check.
  7. The screenshot is gone. 8. The ARCHITECTURE.md note is there.

The focused tests pass here (DocumentFontsTests 5/5, JobQueueTests, ToastWindowTests, CLI), and all 12 languages have both strings.

One thing keeps CI red: the format check fails on tests/Filee.Core.Tests/FakeConverter.cs, where using System.Collections.Concurrent; has to come before using Filee.Core.Conversion;. If you don't get to it first, we'll push that one-line fix ourselves and merge once CI is green.

A note for later, not blocking: RhwpFonts.Find asks SKFontManager.Default, and Skia's font manager may keep the font list it loaded at start (on Windows it reads DirectWrite's system collection once), so a font installed while Filee runs may still not be found until a restart even with Forget. If you happen to try that, let us know what you see.

@KnifeLemon
KnifeLemon merged commit d9b94a6 into KnifeLemon:main Oct 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants