Repository navigation
feat(data): use OpenMono as the mono typeface - #64798
Draft
iamdavidhill wants to merge 9 commits into
Draft
iamdavidhill wants to merge 9 commits into
iamdavidhill wants to merge 9 commits into
Conversation
3 of 6 tasks
This branch has not been deployed
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.
Issue for this PR
No issue. This follows the release of OpenMono 1.000.
Type of change
What does this PR do?
The data site (
packages/data/app), its Open Graph cards and the shared nav menus set their text in OpenMono, Anomaly's typeface, built on Iosevka by Belleve Invis (SIL OFL 1.1). The files are the website's subsets of the OpenMono 1.000 build, so both sites serve the same bytes."OpenMono"insrc/routes/index.css, with the stand-ins renamed to"OpenMono Menlo","OpenMono Consolas"and"OpenMono Courier".cyrillicfile of their own (18 kB, with the two stress marks), so a page fetches that and not therestfile, which is 122 kB now that the font has Greek, Vietnamese, Armenian and more. Thecyrillicrule comes after therestrule, which has the stress marks too, so a stressed word such asру́сскийfetches the Cyrillic file only (checked in Chromium).openmono-{regular,bold}-{latin,rest}.bin, in the build and in the pinned deploy targets. The deploy compares the two, so they change together. A card whose text is in the Latin file and has no C, c or G is pixel-identical.restfile was never used and⚠,✓or⥈drew as the empty box. This was so before the rename. Each file now has a family name of its own (OpenMono,OpenMono Rest) and the card names both, which costs no bytes. A new test rendersα,⥈and a character no file has, and fails if any two come out alike. With the final build the tworestmodules are 414 kB and 407 kB (they were 90 kB each), and the OG Worker's files are 5.8 MB, 2.2 MB gzipped.✓ ✗ ✕ ✖ ⚠ ∙ ⋅ ≈ ≠ ≤ ≥ ∞ √ ∑ ⋯ �and the numbers⁰ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ₀ ₁ σ Σ), so a page or a card that shows one does not need therestfile. The Latin file grows by 1.5 kB..github/release/targets/data/(dev/og.jsonandproduction/og.json: the four font module names, nothing else). That path needs a review from its code owner,@thdxr.cardVersiongoes from 2 to 3, so every page links a new image URL and the card is drawn with the new font the first time that URL is asked for. It does not purge the old URLs: a preview that a site has already unfurled stays as it is until that site fetches the page again, and an old URL can be served from the edge for up to 7 days, then one more day while it revalidates.packages/nav-menusbecomes"OpenMono". A host that does not set--nav-menu-monogets that fallback, so it must load OpenMono or set the token. Hosts of the package:packages/data/app(this PR): uses the fallback, and loads OpenMono here.services/site: sets--nav-menu-mono, so it is not affected.packages/status/public/nav-menus.css): neither sets the token on itsdev. The Console must merge anomalyco/opencode-console#8139, which sets it in both, before it next syncspackages/nav-menus; otherwise its lockup and menus fall to the system monospace font.restfilesFeature flag. None. The data site reads no flags, and the pinned OG module names cannot be switched at run time. The gate was the font's release, and OpenMono 1.000 is out.
Refresh the fonts after the website's files change, from
packages/data/app:It reads every file and checks each
@font-facerule inindex.cssagainst the range of its own file before it writes anything, so a missing file or one stale rule leaves the app's fonts untouched. Until the website's PR is merged, give it that branch's folder.Companion: #64796 (the website and docs). This PR can merge before or after it: it carries its own font files, and the website sets
--nav-menu-monoand never uses the fallback family.How did you verify your code works?
bun run checkat the root (lint, and typecheck of every package), which the pre-push hook also ran.bun typecheckandbun testinpackages/data/app(37 pass, including the OG Worker build and the new render test) and inpackages/nav-menus(11 pass), andbun typecheckinservices/data.devand from this branch: the letters change and the layout does not, and their?v=values change./data/compareon the development server in Chromium, light and dark: the browser reportsOpenMonoNerd-Regularand-Boldfrom the bundled files for all mono text, and the open nav menu resolves to OpenMono.Screenshots / recordings
The main page is the deployed dev page; the after shots use this branch's stylesheets and fonts. Only the C, c and G change.
Checklist