feat(android): font variation settings#44667
Conversation
|
Base commit: 4c6bff0 |
|
Not sure why the bot still says the changelog is missing :) |
4f6d057 to
e63e994
Compare
NickGerleman
left a comment
There was a problem hiding this comment.
This seems pretty sane to me, though we need to update the logic around Span management in ReactEditText a bit, for the new fields added to CustomStyleSpan.
Could we make sure to validate against Paper and Fabric, for both Text and TextInput?
e63e994 to
9dd41dd
Compare
8549425 to
afba1de
Compare
|
I updated some stuff regarding the edit text for paper but unfortunetaly it's not working. What am I missing here? @NickGerleman |
Hard to tell without debugging. Does prop setter for ShadowNode get hit? |
|
I debugged it last week using a debugger, and it was being hit. I will do some more testing. |
afba1de to
424323b
Compare
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
I am gonna open another PR hopefully or fix the current one. |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
This PR was closed because it has been stalled for 7 days with no activity. |


Summary
Continuation of the old PR: #36371
This PR adds font variation settings feature for variable fonts in react native. The
fontVariationSettingsproperty provides low-level control over variable font characteristics, by specifying the four letter axis names of the characteristics you want to vary, along with their values.Registered axes are the most commonly encountered — common enough that the authors of the specification felt they were worth standardizing. Note that this doesn't mean that the author has to include all of these in their font.
Custom axes can be anything the font designer wants to vary in their font, for example ascender or descender heights, the size of serifs, or anything else they can imagine. Any axis can be used as long as it is given a unique 4-character axis. Some will end up becoming more common, and may even become registered over time.
Example
Font characteristics set using
fontVariationSettingswill always override those set using the corresponding basic font properties, e.g.fontWeightregardless of the order.References
Android Documentation
iOS Documentation
MDN Documentation
Specification
Screenshots
This is a part of the other work for iOS that is being done by @davebcn87.
Changelog
[ANDROID] [ADDED] - Add fontVariationSettings support for variable font in Android
Test Plan