Text: superscripts and font features
<Text>
E = mc<Text style={{ verticalAlign: 'super', fontSize: 7 }}>2</Text>, H
<Text className="align-sub text-[7pt]">2</Text>O
</Text>
<Text style={{ fontFeatureSettings: "'tnum' 1, 'ss01'" }}>1,111.10</Text>
<Text className="tabular-nums slashed-zero">10,000</Text>
- Superscripts and subscripts.
verticalAlign: 'super'or'sub'on aText(the classesalign-superandalign-sub) raises or lowers its baseline by the offsets the font gives for superscripts and subscripts, for text of its size;'baseline'puts it back. The size stays the one you set: give the superscript a smallerfontSize. The line grows to fit it, as in CSS. ATextinside a superscript stays on its baseline. On aCell,verticalAlignplaces the content (top,middle,bottom), andsuperorsubthere is an error. - OpenType features.
fontFeatureSettingstakes a CSS string ("'tnum' 1, 'liga' off"), a list of tags to turn on (['tnum', 'smcp']), or an object of tags to values or switches ({ tnum: 1, liga: false, salt: 2 }): 1 turns a feature on, 0 off, and a larger number picks an alternate.fontVariantNumeric('tabular-nums','oldstyle-nums slashed-zero', …) and its Tailwind classes turn on the matching features, andfontFeatureSettings(orfont-features-[…]) wins over them. Both are inherited like the other text properties; aTextthat sets its ownfontFeatureSettingsreplaces the inherited one. A feature does something only when the font has it: Inter hastnum,zero,ss01toss08,frac,caseand more, but no small capitals; Noto Sans hassmcp. A run takes at most 32 features, and a document at most 64 different sets of them. PageNumberandTotalPagesdraw their digits without the features.
Synced from packages/render/GUIDE.md in the inkoxide repository.