Repository navigation
Fix capitals drawn small in the model hub's fallback fonts - #881
Open
sabrinaaquino wants to merge 1 commit into
Open
sabrinaaquino wants to merge 1 commit into
sabrinaaquino wants to merge 1 commit into
Conversation
Until Aeonik loads, the model hub draws its text in Arial, or Roboto on Android, and a first visit usually keeps that fallback for the whole view. Each fallback scaled capitals, digits and lowercase separately to match Aeonik's widths, so a capital stood only 1.09 times as tall as a lowercase x instead of about 1.38, and words like "How", "Text" and "POST" read as small capitals. One scale per fallback, matched to Aeonik's x-height, keeps capitals in proportion and letters at Aeonik's size. The ascent and descent overrides change with it, so lines keep their height. Widths no longer match Aeonik's, which moves nothing: a view that starts on a fallback keeps it.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
This branch was successfully 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.
On a first visit, model pages usually draw their text in a local fallback font (Arial, or Roboto on Android) because Aeonik isn't ready at the first paint, and that view keeps the fallback. The fallback was scaled three ways to match Aeonik's widths: lowercase up to 118%, capitals down to 93%, digits in between. A capital ended up only 1.09 times the height of a lowercase x instead of about 1.38. Every capital looked like a small capital: "How it's measured", "Text", "Private", "1M", "USD", "POST", "Model ID".
Change: one scale per fallback, matched to Aeonik's x-height: 98.35% for Arial and 96.53% for Roboto. Arial's proportions are almost exactly Aeonik's (capital to x-height 1.38 against 1.37), so capitals land within 1% of Aeonik's. The ascent and descent overrides are recomputed so lines keep the height they had.
Why widths don't need to match anymore: a view never switches fonts after it's drawn. The page is only marked fonts-ready once the build-time first screen is hidden, and a live view that mounts before Aeonik is ready keeps the fallback. Text drawn in the fallback is now a little narrower than Aeonik, so a line can wrap differently than it would in Aeonik, but nothing moves on screen.
Tested: I loaded a model page on localhost with
venice.ai/fontsblocked, which forces the fallback:To see it yourself, block
venice.ai/fonts/*in DevTools (Network, Block request URL) and reload a model page.