-
Notifications
You must be signed in to change notification settings - Fork 168
Add font metrics package to FURN #2298
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
Add font metrics package to FURN #2298
Conversation
...ntui-react-native-experimental-native-font-metrics-53961c7c-6784-4f8c-b197-79ec8ba74332.json
Show resolved
Hide resolved
|
Question for future dev guidance: from Apple's HIG meaningful interface icons should scale with text scaling; if my icon is an SVG, what would be the right way to have it scale with DynamicType / this metrics package such that it scales the same as the automatically-scaling SF Symbols? |
We intend to scale V2 text elements based on this scale, so as long as you match the text styles, scaling your SVGs by the appropriate factor from here should do you well. As an aside, this won't give the EXACT same font sizes as listed on Apple's typography page (which is what I presume SF Symbols would use) because |
Platforms Impacted
Description of changes
This is a temporary native module that gives JavaScript access to a subset of
UIFontMetrics.Dynamic Type support is on its way into RNCore (as per this PR), but we want to be able to take advantage of it now, so we're adding this module accordingly. Once this publishes to NPM, we'll use it when rendering a
Text.The idea of using a hook to access font metrics data is inspired by
RCTAppearanceanduseColorScheme, which uses a similar subscription hook to fetch an initial "expensive" (i.e., "synchronously obtained") bit of information.Verification
Validated using the draft PR #2269.
Pull request checklist
This PR has considered (when applicable):