Bundle Ubuntu Sans and Ubuntu Sans Mono (zennotes#890) - #43
Merged
Merged
Conversation
…nd iPad Settings → Typography could only offer fonts iOS ships, so the Ubuntu families the Android app bundles were missing on iPad and iPhone (ZenNotes/zennotes#890). The shell now ships the same files Android does (public/fonts, byte-identical: woff2 subsets for Latin, Cyrillic and Greek, upright and italic, Ubuntu Sans 100 to 800 and Ubuntu Sans Mono 400 to 700, with fonts.css and the Ubuntu Font Licence), links the stylesheet from index.html, and offers both names in the interface, text and monospace menus. The list moved to typography-fonts.ts so a test can hold every offered bundled face to a file that ships, and no file ships unused. About 0.55 MB more download. WebKit fetches a subset only once text is drawn in a bundled family, so cold start pays for the few KB of declarations. Monaco is not bundled: it is Apple's macOS font, licensed with macOS only, and not part of iOS. Menlo is in the list and SF Mono is the default. Checked on an iPad Pro 13-inch simulator (iOS 27.0): picking the families through the real menus set the editor, code and app chrome in them, and the bundled Latin, Cyrillic and Greek faces loaded.
) A high-severity advisory for braces (stack exhaustion on deeply nested patterns, no fixed release) failed the production npm audit gate on every pull request. It reached production through @excalidraw/excalidraw, which lists sass 1.51.0 as a dependency; that sass pulls in chokidar 3, which pulls in braces. Excalidraw never loads sass at runtime: nothing in its build output imports it. Excalidraw's sass is overridden to 1.103.1, the version the desktop repo already carries. It watches files with a chokidar that has no braces, so braces stays only under build tools. No existing package changes version.
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 the iOS side of ZenNotes/zennotes#890: Settings → Typography now offers Ubuntu Sans and Ubuntu Sans Mono on iPhone and iPad, as the Android app has since 1.1.3.
What ships.
public/fonts/is a byte-identical copy of the Android shell's files (diff -rclean): 24 woff2 subsets (Latin, Cyrillic, Greek; upright and italic; Ubuntu Sans 100 to 800, Ubuntu Sans Mono 400 to 700),fonts.csswith the@font-facerules, and the Ubuntu Font Licence (UFL.txt).index.htmllinks the stylesheet;listSystemFontsoffers both names in the interface, text and monospace menus. About 0.55 MB more download; WebKit fetches a subset only when text is drawn in that family.Tests. The list moved to
src/bridge/typography-fonts.ts;typography-fonts.test.ts(6 tests) checks both families are offered, each has upright and italic Latin faces, every face points at a woff2 that ships, no file ships unused, each file is real woff2, the licence ships, andindex.htmllinks the CSS.npm test186/186,npm run typecheckclean.Simulator (iPad Pro 13-inch, iOS 27.0). Picking Ubuntu Sans Mono for Monospace, then Ubuntu Sans for Text and Interface, through the real menus set the editor, code and app chrome in those fonts; a load probe showed the bundled Latin, Cyrillic and Greek faces loading.
Not bundled: Monaco. It is Apple's macOS font, licensed with macOS only and not part of iOS. Menlo is in the list and SF Mono is the default.
Found, not changed here: "New York" in the list does not render on iOS (WebKit cannot address it by family name, so it falls back), and the first launch after a simulator boot can stay blank on this Xcode 27 setup until relaunched; both predate this change.