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

fontWeight should support the wording as in Xcode #618

Closed
fatuhoku opened this issue Apr 2, 2015 · 3 comments
Closed

fontWeight should support the wording as in Xcode #618

fatuhoku opened this issue Apr 2, 2015 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@fatuhoku
Copy link

fatuhoku commented Apr 2, 2015

In Xcode you can select out of a handful of values for font weight:

screen shot 2015-04-02 at 12 06 06

React Native's supported values for fontWeight looks like this: screen shot 2015-04-02 at 12 24 05. It's not obvious what 200 or 900 means in relation to iOS font weight values like "Semibold" or "Thin".

How could the mapping be made clearer?

@vkurchatkin
Copy link
Contributor

I think this is the way it is for compatibility with CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight

@ericvicenti
Copy link
Contributor

Yep, we're sticking to the web standards everywhere we can, but we don't want you to be restricted. Is there anything that you can do in Xcode that you can't do with the font-weight CSS spec?

Feel free to send a PR to clarify the docs and link to the spec

@fatuhoku
Copy link
Author

@ericvicenti Hi, coming back to this, I guess it's possible to make a mapping for the following strings (essentially an enum) onto the relevant fontWeights... it's just that our designer would specify the font weight in terms of 'Medium' or 'Light' and translating into a number like 100 is simply not descriptive.

Based on the 9 selections you get from Xcode:

screen shot 2015-06-28 at 20 28 52

... here's what I make of the mapping:

100 = Thin
200 = Ultra Light
300 = Light
400 = Regular
500 = Medium
600 = Semibold
700 = Bold
800 = Heavy
900 = Black

It's worth noting that under Xcode it appears that Heavy and Black are actually the same font weight.

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants