()
| 19 | const Text = customText<'customVariant'>(); |
| 20 | |
| 21 | const TextExample = () => { |
| 22 | const { isV3 } = useExampleTheme(); |
| 23 | |
| 24 | const fontConfig = { |
| 25 | customVariant: { |
| 26 | fontFamily: Platform.select({ |
| 27 | ios: 'Noteworthy', |
| 28 | default: 'serif', |
| 29 | }), |
| 30 | fontWeight: '400', |
| 31 | letterSpacing: Platform.select({ |
| 32 | ios: 7, |
| 33 | default: 4.6, |
| 34 | }), |
| 35 | lineHeight: 54, |
| 36 | fontSize: 40, |
| 37 | }, |
| 38 | } as const; |
| 39 | |
| 40 | const theme = { |
| 41 | ...MD3LightTheme, |
| 42 | fonts: configureFonts({ config: fontConfig }), |
| 43 | }; |
| 44 | return ( |
| 45 | <ScreenWrapper> |
| 46 | <View style={styles.container}> |
| 47 | {!isV3 && ( |
| 48 | <> |
| 49 | <Caption style={styles.text}>Caption</Caption> |
| 50 | <Paragraph style={styles.text}>Paragraph</Paragraph> |
| 51 | <Subheading style={styles.text}>Subheading</Subheading> |
| 52 | <Title style={styles.text}>Title</Title> |
| 53 | <Headline style={styles.text}>Headline</Headline> |
| 54 | </> |
| 55 | )} |
| 56 | |
| 57 | {isV3 && ( |
| 58 | <> |
| 59 | <Text style={styles.text} variant="displayLarge"> |
| 60 | Display Large |
| 61 | </Text> |
| 62 | <Text style={styles.text} variant="displayMedium"> |
| 63 | Display Medium |
| 64 | </Text> |
| 65 | <Text style={styles.text} variant="displaySmall"> |
| 66 | Display small |
| 67 | </Text> |
| 68 | |
| 69 | <Text style={styles.text} variant="headlineLarge"> |
| 70 | Headline Large |
| 71 | </Text> |
| 72 | <Text style={styles.text} variant="headlineMedium"> |
| 73 | Headline Medium |
| 74 | </Text> |
| 75 | <Text style={styles.text} variant="headlineSmall"> |
| 76 | Headline Small |
| 77 | </Text> |
| 78 |
nothing calls this directly
no test coverage detected
searching dependent graphs…