Repository navigation
Warn about missing document fonts without blocking conversion - #417
Conversation
KnifeLemon
left a comment
There was a problem hiding this comment.
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:
- Fonts the user's document never named. On the built-in routes (Markdown, DOCX, XLSX … → HWPX → rhwp)
RhwpConverterchecks the HWPX that Filee wrote itself, and that one always lists 맑은 고딕 and 함초롬돋움 from Filee's HWPX template (DocumentFonts.Referencedon 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. - 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. - Cost on large files. Every XML part under
word/,xl/andppt/up to 64 MB is loaded into anXDocumentbefore 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 streamingXmlReader. - Fail-open. The header says malformed metadata can never block a conversion, but
Missingcatches 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. - 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.
RhwpFonts.Findcaches 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.- 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. - A line in
docs/ARCHITECTURE.mdnext to the notices (ConversionStep.MissingFonts→FileResult.MissingFonts→ the card and the CLI) would help the next reader.
|
Thanks for the careful review. Addressed all eight points in 5fb2cad:
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
left a comment
There was a problem hiding this comment.
Thanks @Perricheno, I went through 5fb2cad point by point and everything from the last review is addressed:
- rhwp and LibreOffice now check
step.OriginalSourcePath, so Markdown/TXT → HWPX → PDF reports nothing and a DOCX reports its own fonts. - Symbol, Wingdings 1-3, Webdings and OpenSymbol are skipped.
XmlReaderover the font-bearing parts only; worksheets are no longer read.- Everything except cancellation is caught, and legacy formats are skipped by extension.
- One page per click, and no link for families without a public page.
- The cached lookup is forgotten before each check.
- 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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implements the non-blocking first stage of #413.
UI
The card below shows the missing-font notice after document conversion:
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.