简体   繁体   English

复制时 React-PDF 显示文本具有不同的值

[英]React-PDF Display Text has different value when Copied

The highlight Text is from a short SHA from git summit.突出显示的文本来自 git 峰会的简短 SHA。

This is PDF document generated with React-pdf.这是使用 React-pdf 生成的 PDF 文档。
Even though the display text is 4903677 , when copied, it changed to •G07THH即使显示文本是4903677 ,复制时,它也更改为•G07THH

The font is D-DINPro.otf字体为 D-DINPro.otf

console.log() return the correct value. console.log()返回正确的值。

What is happening here?这里发生了什么? Text Decode bug?文本解码错误?

The Document code is pretty simple文档代码非常简单

<View style={styles.versionControl}>
    <Text>
        { new Date().toISOString()}
        {
            data.sha &&  <>--{data.sha}</>
        }
    </Text>
</View>

显示文本具有不同的值

This is the error from the font package.这是字体 package 的错误。 When in default, the rendered values are correct.默认情况下,呈现的值是正确的。

To fix, I import and export the Free D-Din font from birdfont program, this will fix the value issues in React-pdf.为了解决这个问题,我从birdfont程序导入和导出 Free D-Din 字体,这将解决 React-pdf 中的值问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM