Skip to content

Conversation

@gedeagas
Copy link
Contributor

PR Reference
facebook/react-native#34003

Adding stylistics as new fontvariant values.

fontVariant?: $ReadOnlyArray<
    | 'small-caps'
    | 'oldstyle-nums'
    | 'lining-nums'
    | 'tabular-nums'
    | 'proportional-nums'
    | 'stylistic-one'
    | 'stylistic-two'
    | 'stylistic-three'
    | 'stylistic-four'
    | 'stylistic-five'
    | 'stylistic-six'
    | 'stylistic-seven'
    | 'stylistic-eight'
    | 'stylistic-nine'
    | 'stylistic-ten'
    | 'stylistic-eleven'
    | 'stylistic-twelve'
    | 'stylistic-thirteen'
    | 'stylistic-fourteen'
    | 'stylistic-fifteen'
    | 'stylistic-sixteen'
    | 'stylistic-seventeen'
    | 'stylistic-eighteen'
    | 'stylistic-nineteen'
    | 'stylistic-twenty',
  >,

@gedeagas
Copy link
Contributor Author

Hi @Simek, sorry to bother you, can you add this PR with Wait on future Release tag. Thanks

@netlify
Copy link

netlify bot commented Aug 20, 2022

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit 45b49be
🔍 Latest deploy log https://app.netlify.com/sites/react-native/deploys/6317181dfd4e4c00083c1532
😎 Deploy Preview https://deploy-preview-3272--react-native.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 settings.

Comment on lines 411 to 430
| array of enum(`'small-caps'`, `'oldstyle-nums'`, `'lining-nums'`, `'tabular-nums'`, `'proportional-nums' `,`'stylistic-one'`,
, `'stylistic-two'`
, `'stylistic-three'`
, `'stylistic-four'`
, `'stylistic-five'`
, `'stylistic-six'`
, `'stylistic-seven'`
, `'stylistic-eight'`
, `'stylistic-nine'`
, `'stylistic-ten'`
, `'stylistic-eleven'`
, `'stylistic-twelve'`
, `'stylistic-thirteen'`
, `'stylistic-fourteen'`
, `'stylistic-fifteen'`
, `'stylistic-sixteen'`
, `'stylistic-seventeen'`
, `'stylistic-eighteen'`
, `'stylistic-nineteen'`
, `'stylistic-twenty'`) | `[]` |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
| array of enum(`'small-caps'`, `'oldstyle-nums'`, `'lining-nums'`, `'tabular-nums'`, `'proportional-nums' `,`'stylistic-one'`,
, `'stylistic-two'`
, `'stylistic-three'`
, `'stylistic-four'`
, `'stylistic-five'`
, `'stylistic-six'`
, `'stylistic-seven'`
, `'stylistic-eight'`
, `'stylistic-nine'`
, `'stylistic-ten'`
, `'stylistic-eleven'`
, `'stylistic-twelve'`
, `'stylistic-thirteen'`
, `'stylistic-fourteen'`
, `'stylistic-fifteen'`
, `'stylistic-sixteen'`
, `'stylistic-seventeen'`
, `'stylistic-eighteen'`
, `'stylistic-nineteen'`
, `'stylistic-twenty'`) | `[]` |
| array of enum(`'small-caps'`, `'oldstyle-nums'`, `'lining-nums'`, `'tabular-nums'`, `'proportional-nums' `,`'stylistic-one'`, `'stylistic-two'`, `'stylistic-three'`, `'stylistic-four'`, `'stylistic-five'`, `'stylistic-six'`, `'stylistic-seven'`, `'stylistic-eight'`, `'stylistic-nine'`, `'stylistic-ten'`, `'stylistic-eleven'`, `'stylistic-twelve'`, `'stylistic-thirteen'`, `'stylistic-fourteen'`, `'stylistic-fifteen'`, `'stylistic-sixteen'`, `'stylistic-seventeen'`, `'stylistic-eighteen'`, `'stylistic-nineteen'`, `'stylistic-twenty'`) | `[]` |

Unfortunately, making table row multiline breaks the MD renderer.

Screenshot 2022-09-06 112431

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, Thank you for the feedback @Simek

Copy link
Collaborator

Choose a reason for hiding this comment

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

The table still appears broken after the deploy with the suggested changes, so it looks like I need to checkout out it locally to looks at it and fix it. 😅 Maybe you would like to give it a try @gedeagas ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wait, let me check again. sorry for the inconvenience

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, it looks like the table is still displaying incorrectly. 🤔

@gedeagas
Copy link
Contributor Author

gedeagas commented Sep 23, 2022 via email

@Simek
Copy link
Collaborator

Simek commented Nov 5, 2022

Hello @gedeagas, are you planning to look at this changeset in the near future?

@gedeagas
Copy link
Contributor Author

gedeagas commented Nov 5, 2022 via email

@pke
Copy link

pke commented Nov 7, 2022

I wonder why the decision was made translate the OTF feature strings like pnum or in that case ss01 into RN own enums? Why not just use the ones the official standard uses (and every web developer knows from CSS!)?

This would also instantly solve the documentation situation as the docs could just point to CSS or OTF docs for fontVariant.

I wanted to add stylistic sets myself in the past and checked the RN code and didn't understand why the team hasn't just passed the string to the render engine (works in Android). Its more complicated in iOS but a simple mapper from string parts "pnum ss01" like you would do in CSS would have helped there too and would have included stylistic from the get go.

Would you accept a PR with an alternative variant (notation like in CSS) and less repetitive code?
It could be back compatible accepting an array as before and newly a string.

fontVariant=["..."]
fontVariant="pnum ss01"

@Simek
Copy link
Collaborator

Simek commented Aug 19, 2025

Hey @gedeagas, thanks for the contribution! 👍

Since the PR was not updated recently, closing it in favour of:

@Simek Simek closed this Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants