Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load optimized Inter fonts (closes #709) #710

Merged
merged 8 commits into from
Oct 17, 2023
Merged

load optimized Inter fonts (closes #709) #710

merged 8 commits into from
Oct 17, 2023

Conversation

evvvritt
Copy link
Collaborator

@evvvritt evvvritt commented Oct 4, 2023

loads local .woff2 files (overwrites radicle-design-system/typography.css @font-face rules)

alternatively, we could update the radicle-design-system css + font files but I don't have write access so thought this was faster

tested on deploy and it properly loads the .woff2 files instead of the .otf (locally it sometimes loads the .otf)

@netlify
Copy link

netlify bot commented Oct 4, 2023

Deploy Preview for drips-app-v2 ready!

Name Link
🔨 Latest commit d01a370
🔍 Latest deploy log https://app.netlify.com/sites/drips-app-v2/deploys/652e6fd71236a00008e3193d
😎 Deploy Preview https://deploy-preview-710--drips-app-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@evvvritt evvvritt changed the title load optimized Inter fonts load optimized Inter fonts (closes #709) Oct 4, 2023
@evvvritt evvvritt marked this pull request as ready for review October 4, 2023 12:37
@evvvritt evvvritt requested a review from efstajas October 4, 2023 12:40
Copy link
Contributor

@efstajas efstajas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, loads a lot faster! Check this section on the LP tho:

Screenshot 2023-10-04 at 16 32 20

The numbers wiggle around, so it seems like the tabular nums font feature stopped working?

@evvvritt
Copy link
Collaborator Author

evvvritt commented Oct 4, 2023

Ah true, it looks like I can preserve them in the optimizer from font-squirrel (options below).

Though I'm having trouble identifying some of the other font features we have in our css: (@brandonhaslegs dyk?)
Screenshot 2023-10-04 at 18 39 44

  1. I presume ss01, ss02 are "Styled Set 1, ...2" in the options below?
  2. what is cv01?
  3. what is calt?
Screenshot 2023-10-04 at 18 39 36

@evvvritt
Copy link
Collaborator Author

evvvritt commented Oct 4, 2023

ah wait found this CSS tricks guide

  • calt = contextual alternates but 0 means disabled i guess
  • cv01 = ???

@efstajas
Copy link
Contributor

efstajas commented Oct 4, 2023

You can see them all here: https://rsms.me/inter/lab/

@brandonhaslegs
Copy link
Collaborator

brandonhaslegs commented Oct 4, 2023

  • CV01 is the alternate 1 character. It's not necessary and I don't know why it was turned on.
  • turning CALT off makes the 0x1 issue go away. If it's on then the x character turns into a × character when it's placed between two numbers. This one is important.

@evvvritt
Copy link
Collaborator Author

evvvritt commented Oct 4, 2023

Ok thanks, of course when I enable tabular numbers in the generator it breaks 🤣

@evvvritt
Copy link
Collaborator Author

evvvritt commented Oct 9, 2023

It's a "known bug" that the font files aren't included in expert mode - but realistically no fix in sight. @efstajas / @brandonhaslegs do you guys know other ways to optimize the .otf's into .woff with our font features enabled?

@brandonhaslegs
Copy link
Collaborator

@evvvritt if you have the optimized OTF's, then you can just convert them to WOFF's on cloudconvert.com.

@evvvritt
Copy link
Collaborator Author

evvvritt commented Oct 9, 2023

Ok I used cloudconvert to just convert the full .otf and they each reduce from ~250kb to ~100kb, and tabular-nums are preserved.

I can't find an alternative service to optimize them further but think this is a solid improvement. Will reduce font load from ~750kb to ~200kb

@evvvritt evvvritt requested a review from efstajas October 9, 2023 13:46
@efstajas efstajas merged commit ffb35be into main Oct 17, 2023
7 checks passed
@efstajas efstajas deleted the ev/iss709 branch October 17, 2023 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants