-
-
Notifications
You must be signed in to change notification settings - Fork 7
fix: align font naming with PostScript convention for mobile compatibility #862
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
Conversation
📖 Storybook Preview |
| 'Geist Regular': require('../fonts/Geist/Geist Regular.otf'), | ||
| 'Geist Regular Italic': require('../fonts/Geist/Geist Regular Italic.otf'), | ||
| 'Geist Medium': require('../fonts/Geist/Geist Medium.otf'), | ||
| 'Geist Medium Italic': require('../fonts/Geist/Geist Medium Italic.otf'), | ||
| 'Geist SemiBold': require('../fonts/Geist/Geist SemiBold.otf'), | ||
| 'Geist SemiBold Italic': require('../fonts/Geist/Geist SemiBold Italic.otf'), | ||
| 'MM Poly Regular': require('../fonts/MMPoly/MM Poly Regular.otf'), | ||
| 'MM Sans Regular': require('../fonts/MMSans/MM Sans Regular.otf'), | ||
| 'MM Sans Medium': require('../fonts/MMSans/MM Sans Medium.otf'), | ||
| 'MM Sans Bold': require('../fonts/MMSans/MM Sans Bold.otf'), | ||
| 'Geist-Regular': require('../fonts/Geist/Geist-Regular.otf'), | ||
| 'Geist-RegularItalic': require('../fonts/Geist/Geist-RegularItalic.otf'), | ||
| 'Geist-Medium': require('../fonts/Geist/Geist-Medium.otf'), | ||
| 'Geist-MediumItalic': require('../fonts/Geist/Geist-MediumItalic.otf'), | ||
| 'Geist-SemiBold': require('../fonts/Geist/Geist-SemiBold.otf'), | ||
| 'Geist-SemiBoldItalic': require('../fonts/Geist/Geist-SemiBoldItalic.otf'), | ||
| 'Geist-Bold': require('../fonts/Geist/Geist-Bold.otf'), | ||
| 'Geist-BoldItalic': require('../fonts/Geist/Geist-BoldItalic.otf'), | ||
| 'MMPoly-Regular': require('../fonts/MMPoly/MMPoly-Regular.otf'), | ||
| 'MMSans-Regular': require('../fonts/MMSans/MMSans-Regular.otf'), | ||
| 'MMSans-Medium': require('../fonts/MMSans/MMSans-Medium.otf'), | ||
| 'MMSans-Bold': require('../fonts/MMSans/MMSans-Bold.otf'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating storybook react fonts to be consistent and prevent confusion between platforms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating storybook react fonts to be consistent and prevent confusion between platforms
|
|
||
| /* Geist */ | ||
| @font-face { | ||
| font-family: 'Geist'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating tailwind stylesheet
e8bae74 to
5b7a994
Compare
📖 Storybook Preview |
|
@metamaskbot publish-preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR standardizes font file naming and references across the design system monorepo to use PostScript-style hyphenated naming conventions (e.g., Geist-Regular.otf) instead of space-separated names (e.g., Geist Regular.otf). This change resolves iOS Metro bundler asset resolution issues with spaces in file paths and aligns with MetaMask Mobile's font implementation.
Key Changes:
- Updated font file references from space-separated to hyphenated PostScript naming conventions
- Applied naming consistently across React Native (
.otf) and React Web (.woff2) font files - Updated font family mappings in typography configuration to match new naming
Reviewed changes
Copilot reviewed 4 out of 28 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/design-system-twrnc-preset/src/typography.ts |
Updated font family mappings to use hyphenated PostScript names (e.g., Geist-Regular, MMSans-Bold) |
packages/design-system-twrnc-preset/src/typography.types.ts |
Updated documentation example to use Geist-SemiBold instead of Geist Bold |
apps/storybook-react/tailwind.css |
Updated all @font-face declarations to reference hyphenated .woff2 font files |
apps/storybook-react-native/.storybook/FontLoader.js |
Updated expo-font loading to use hyphenated font keys and file paths for all .otf files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@metamaskbot publish-preview |
📖 Storybook Preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
08c551e to
c47bb52
Compare
📖 Storybook Preview |
📖 Storybook Preview |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
## **Description** This PR releases version 17.0.0 of the MetaMask Design System, featuring important fixes for mobile font compatibility, the addition of the ButtonHero component to React, export fixes for React Native, and various dependency updates including ESLint configuration upgrades. ## **Included PRs** #836, #837, #838, #840, #843, #845, #846, #847, #848, #850, #851, #852, #853, #854, #855, #856, #857, #858, #859, #861, #862, #863, #864 ## **Manual testing steps** 1. Check package.json version bumps align with included changes 2. Check changelog accurately reflects the release ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Release 17.0.0 introducing React `ButtonHero`, RN font naming changes and TWRNC preset font family rename (both breaking), plus RN export fix and dependency updates. > > - **Release 17.0.0** > - Bump root `package.json` to `17.0.0`. > - **React (`@metamask/[email protected]`)** > - Add `ButtonHero` component for prominent CTAs. > - Update `@metamask/utils` peer to `^11.8.1`. > - **React Native (`@metamask/[email protected]`)** > - BREAKING: Rename font files to hyphenated PostScript format for iOS Metro compatibility. > - Export missing `TextButtonSize` enum. > - Peer: require `@metamask/design-system-twrnc-preset@^0.3.0`; update `@metamask/utils` peer. > - **TWRNC preset (`@metamask/[email protected]`)** > - BREAKING: Rename font family names to hyphenated PostScript format for iOS/expo-font. > - **Changelogs** > - Update `CHANGELOG.md` links and entries for all packages. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9a90311. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->












Description
This PR updates font file naming and references across the design system monorepo to use PostScript naming conventions (hyphenated format) instead of space-separated names. This change aligns with the font naming convention implemented in MetaMask Mobile (see metamask-mobile#23517) and resolves iOS Metro bundler asset resolution issues.
What changed:
Geist Regular.otf) to hyphenated PostScript names (e.g.,Geist-Regular.otf)expo-fontloading and Tailwind configurations to match the new namingWhy this change:
Related issues
Related to: MetaMask/metamask-mobile#23517
Manual testing steps
yarn installyarn storybook:iosto verify iOS bundler can resolve font assetsyarn storybook:webto ensure web fonts still work correctlyScreenshots/Recordings
Before
This was likely an issue created in the semi bold PR there was an iOS Metro bundler errors with "Asset not found" for font files with spaces
After
Fonts load successfully without bundler errors
React Native
Text(@metamask/design-system-react-native) renders as expected with all three fonts Geist, MM Poly and MM Sansmmdsr.font.file.update.after.mov
React
Text(@metamask/design-system-react) renders as expected with all three fonts Geist, MM Poly and MM Sansmmdsr.font.file.after.mov
Design tokens(
@metamask/design-tokens) renders as expected with all three fonts Geist, MM Poly and MM Sansmmds.design.tokens.after.mov
Pre-merge author checklist
Pre-merge reviewer checklist
🤖 Generated with Claude Code
Note
Renames font files and family keys to PostScript-style hyphenated names and updates React Native loader, web @font-face sources, and typography config accordingly.
apps/storybook-react-native/.storybook/FontLoader.jsto load hyphenated PostScript font keys (e.g.,Geist-Regular,MMSans-Bold,MMPoly-Regular).apps/storybook-react/tailwind.css@font-facesrcpaths to hyphenated filenames (e.g.,Geist-Regular.woff2,MMSans-Regular.woff2,MMPoly-Regular.woff2).packages/design-system-twrnc-preset/src/typography.tsfontFamilymappings to new hyphenated names.packages/design-system-twrnc-preset/src/typography.types.tsto reflectGeist-Boldnaming.Written by Cursor Bugbot for commit c47bb52. This will update automatically on new commits. Configure here.