Repository navigation
fix: #5327 render music notation with bundled font fallbacks - #5722
Merged
Merged
Conversation
|
Yay! 🙏🏻Thanks again for taking the time fix it. |
Zane-0x5a
added a commit
to Zane-0x5a/marktext
that referenced
this pull request
Oct 15, 2026
Upstream reworked the old print path (marktext#5722 makes MarkdownPrint wait for the notation fonts; marktext#5716 resolves URL-encoded Windows image paths). The fork replaced that path with the paged preview, so printService and its two specs keep the fork's side. Both fixes still reach the preview: the image fix lives in resolveLocalImageSrc, which exportHtml uses, and the notation fonts arrive through the muya export styles, the export themes and getCssForOptions. Main already waits for fonts.ready under print media before printToPDF. marktext#5746 drops the Info tab and explains that a table of contents needs a [TOC] line. The HTML export dialog takes both changes. The print preview panel shows the same explanation under its contents settings. The preload keeps the fork's visual zoom limit next to upstream's platform path import, and the editor store keeps isSameList. marktext#5691 was merged earlier from its PR head; upstream's squash differs from it only by commits that came in alongside it. Verified on Windows 11: typecheck, desktop and muya lint, and the desktop unit suite pass. In the muya unit suite, only the tableChessboard entrypoint import timed out, and only on cold runs (it passes alone). The print, export, sidebar, theme and title bar e2e specs plus upstream's new 3510, 5394, 5683 and 5710 specs pass in background windows, except 5394's exact `toBe(400)` width check. At this machine's 1.75 device pixel ratio the restored width reads 400.0000305, with or without the camera transform; with `toBeCloseTo(400, 3)` all three scenarios pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5327
Summary
Music notation in the reporter's
Notes - Definitions.mdremains intact in the DOM and Markdown round-trip, but some glyphs appear blank in preview. The bundled Open Sans font lacks those symbols and its.notdefglyph has no contours, so unsuccessful system font fallback produces invisible placeholders.Add Noto Music and Noto Sans Math WOFF2 assets using the existing local
@font-facepattern. Their Unicode ranges cover music notation and technical brackets: Noto Music covers𝅗𝅥and𝅘𝅥𝅯, while Noto Sans Math covers⏜and⏝.Declare the fonts directly in the editor's default stack, the default export stylesheet, both built-in export themes, header/footer styles and application-generated export font overrides. Built-in export stacks prioritize the range-limited symbol faces to prevent system missing-glyph placeholders from taking precedence; ordinary text keeps its existing fonts. External custom CSS is preserved unchanged.
All styled HTML exports embed the fonts by extending the existing KaTeX font embedding utility, renamed
embedExportFonts. PDF/print waits for font loading before submitting the print request, including when the print container is hidden on screen. Font copyright metadata is preserved, with the complete OFL license stored inside each font's metadata; no separate license files or HTML license comments are added.Type of change
Test plan
.appwith the reporter's document; verified thatapp.asarfont assets load and actual notation glyphs render. macOS ARM64 packaging also succeeds after removal of the standalone font license resources.webContents.printToPDFusing exported HTML. Both Noto fonts are embedded; PDF text extraction and visual inspection confirm the notation. The packaged app's native save dialog was not exercised.pnpm run lint— passes with existing warnings.pnpm run typecheck— passes.pnpm run build:unpack— passes.git diff --check, targeted font/export CSS Stylelint and font-helper ESLint — pass.Notes for reviewers
Windows and Linux were not available for local verification. The complete fonts add approximately 413 KiB to the application; styled HTML exports always embed them (approximately 550 KiB of base64 data). PDF embeds the glyphs actually used.
The full Muya CSS lint command still reports seven pre-existing
no-descending-specificityerrors elsewhere in the existing stylesheets; the modified font and export stylesheets pass targeted Stylelint.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license. The bundled Noto fonts retain their SIL Open Font License 1.1 metadata.