diegomura / diegomura/react-pdf

Multiple custom fonts not working

Open
#3,185 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.