I am generating PDFs in my project using libraries such as @react-pdf/renderer
and pdf-lib,
and I am encountering significant challenges with font compatibility for multilingual text. In my use case, parts of the PDF may contain content in language A (e.g., Korean), while other parts are in language B (e.g., English). I have attempted to use fonts like Helvetica, Roboto, and Noto, but certain characters from various languages or scripts either fail to render or result in inaccurate glyphs.
Additionally, even when a PDF renders the text correctly, copying and pasting the content elsewhere often results in gibberish, likely due to mismatched glyphs or incorrect Unicode encoding. This issue becomes particularly problematic since the text content is dynamically fetched from a backend API, where messages are iterated over to build the PDF.
I am looking for a solution or a recommendation for a font that can seamlessly handle multilingual text—including complex scripts like Korean, Chinese, Japanese, Arabic, and Hindi—while maintaining accurate rendering and proper Unicode mapping for copy-paste functionality. Ideally, the solution should not require extensive fallback font configurations or embedding multiple font files. I have attached reference images to illustrate the issue further.
[![Here the text in different language is missing][1]][1]
Here the text in different language is missing
[![The numbers in the PDF are not rendered correctly, and when I attempt to copy and paste content in another language, the pasted text appears as gibberish.][2]][2]
2ND IMAGE
The numbers in the PDF are not rendered correctly, and when I attempt to copy and paste content in another language, the pasted text appears as gibberish.
0