Skip to content

Commit

Permalink
chore: improve font family fallback test to include available fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
bdkopen committed Apr 27, 2024
1 parent 9a1f971 commit e2afe2c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/examples/src/fontFamilyFallback/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ const styles = StyleSheet.create({
},
regular: {
fontFamily: ['Roboto', 'NotoSansArabic'],
fontSize: '14',
fontWeight: 900,
},
default: {
fontFamily: ['Courier-Bold', 'NotoSansArabic'],
fontSize: '14',
},
});

Font.register({
Expand All @@ -43,7 +48,19 @@ Font.register({
const MyDoc = () => {
return (
<Page style={styles.body}>
<Text style={styles.regular}>Test امتحان</Text>
<Text style={{ fontFamily: 'Courier', marginBottom: '10px' }}>
This font is default Courier
</Text>
<Text style={{ fontSize: 10 }}>
The following is partially Roboto and Noto Sans Arabic
</Text>
<Text style={[styles.regular, { marginBottom: '10px' }]}>
Roboto / امتحان
</Text>
<Text style={{ fontSize: 10 }}>
The following is partially Courier-Bold and Noto Sans Arabic
</Text>
<Text style={styles.default}>Courier-Bold / امتحان</Text>
</Page>
);
};
Expand Down

0 comments on commit e2afe2c

Please sign in to comment.