diegomura / diegomura/react-pdf
Multiple custom fonts not working
Open
- Dominant language
- TypeScript
- Stars
- 16.8k
- Forks
- 1.3k
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 52
Description
**Describe the bug**
I am following the documentation to register two fonts, but only the one can be utilized.
Here is the code:
`Font.register({
family: 'TeleNeoWeb-Regular',
src: '/assets/fonts/TeleNeoWeb-Regular-font.woff',
})
Font.register({
family: 'TeleNeoWeb-Bold',
src: '/assets/fonts/TeleNeoWeb-Bold-font.woff',
})
const globalStyles = StyleSheet.create({
h1: {
fontFamily: 'TeleNeoWeb-Regular',
},
h2: {
fontFamily: 'TeleNeoWeb-Bold',
}
})
`
The Regular font is shown on both h1 and h2. It seems that multiple custom fonts can not be rendered.
Contributor guide
Assessment
This issue has not been assessed yet.