I'm encountering an issue with @react-pdf/renderer in one of my React projects. While it works perfectly fine in other projects, I'm getting an "Unknown encoding x-mac-roman" error in this particular project.
Error Details:
The error occurs in the encodingWidth method (line 106) of the String.js file. I suspect this file is used by @react-pdf/renderer for text rendering.
Font Registration:
Here's how I'm registering the font:
Font.register({
family: 'MyFontFamily',
src: 'http://my-cdn-path/MyFontFamily.ttf',
format: 'truetype'
})
Font Usage:
And this is how I'm including the font family in styles:
const styles = StyleSheet.create({
label: {
fontSize: 12,
color: 'red',
fontFamily: 'MyFontFamily'
}
})
Question:
Has anyone else encountered this issue with @react-pdf/renderer? Any insights or solutions would be greatly appreciated.
Furthermore
It looks like is an issue with the font I'm using (Gilmer), I try with a random one and works.
