Chevin font corrupts text copy pasted from PDF
See original GitHub issueDescribe the bug Chevin font corrupts text copy pasted from PDF.
To Reproduce
const Test = () => (
<Document>
<Page>
<View>
<Text style={styles.roboto}>
The Portable Document Format (PDF) (redundantly: PDF format) is a file format developed by Adobe in the 1990s to present documents,
including text formatting and images, in a manner independent of application software, hardware, and operating systems.[2][3]
Based on the PostScript language, each PDF file encapsulates a complete description of a fixed-layout flat document, including the
text, fonts, vector graphics, raster images and other information needed to display it. PDF was standardized as an open format,
ISO 32000, in 2008, and no longer requires any royalties for its implementation.
</Text>
<Text style={styles.chevin}>
The Portable Document Format (PDF) (redundantly: PDF format) is a file format developed by Adobe in the 1990s to present documents,
including text formatting and images, in a manner independent of application software, hardware, and operating systems.[2][3]
Based on the PostScript language, each PDF file encapsulates a complete description of a fixed-layout flat document, including the
text, fonts, vector graphics, raster images and other information needed to display it. PDF was standardized as an open format,
ISO 32000, in 2008, and no longer requires any royalties for its implementation.
</Text>
</View>
</Page>
</Document>
);
Font.register(
{src: 'https://pdf-font-test.s3.eu-central-1.amazonaws.com/Chevin-Light.ttf',
family: 'Chevin' },
);
Font.register(
{src: 'https://pdf-font-test.s3.eu-central-1.amazonaws.com/Roboto-Light.ttf',
family: 'Roboto' },
);
const styles = StyleSheet.create({
roboto: {
fontFamily: 'Roboto'
},
chevin: {
fontFamily: 'Chevin'
}
});
ReactPDF.render(<Test />);
Expected behavior Text copy pasted from PDF from Chevin font paragraph should equal the Roboto version:
The Portable Document Format (PDF) (redundantly: PDF format) is a file
format developed by Adobe in the 1990s to present documents, including
text formatting and images, in a manner independent of application software,
hardware, and operating systems.[2][3] Based on the PostScript language,
each PDF file encapsulates a complete description of a fixed-layout flat doc-
ument, including the text, fonts, vector graphics, raster images and other in-
formation needed to display it. PDF was standardized as an open format, ISO
32000, in 2008, and no longer requires any royalties for its implementation.
Actual behavior Copy pasted text from PDF from Chevin paragraph is corrupted:
The Portable Document Format (PDF) (redundantly: PDF format) is a vle format depeloAed
by 1dobe in the 900,s to Aresent documentsg includinx tewt formattinx and imaxesg in a
manner indeAendent of aAAlication soft.areg hard.areg and oAeratinx systems[2]32B3 Sased
on the Post-criAt lanxuaxeg each PDF vle encaAz sulates a comAlete descriAtion of a
vwedzlayout Iat documentg includinx the tewtg fontsg pector xraAhicsg raster imaxes and
other information needed to disAlay it[ PDF .as standardiOed as an oAen formatg 8-q B],,,g in
],,g and no lonxer reuires any royalties for its imAlementation[
Edit: rendering is also corrupted for Chevin paragraph:
Desktop: * OS: MacOS * Browser: Firefox 67 * React-pdf version: REPL at 2019-06-06 v1.6.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Copying and pasting text turns to gibberish
Hi quintonv,. As mentioned, you are getting gibberish text when copying and pasting text from pdf, it seems the issue seems to be...
Read more >PDF has garbled text when copy pasting - adobe reader
In Acrobat, click File -> Properties, then click the Fonts tab to see encoding, and the Security tab to see whether it's encrypted....
Read more >Problem with Font .. Copy and paste into Word
I have a pdf file, including a font called "AdvP405B6" (from document properties). it caused problems when copying and pasting into Word ...
Read more >Full font list
... Century Kurrent Start copy 1 18th Century Kurrent Text 18thCentury 19 000 ... Bold PDF AlphaBravo Light PDF AlphaBravo Medium PDF AlphaBravo...
Read more >Untitled
Imposed sanctions syria, Andrew loomis creative illustration pdf, Bloons td 4 free. ... Crusade against corruption, Morckhovenlei antwerpen, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not sure why some fonts are not loaded correctly by
fontkit
. Something that worked for me is opening the font with a font editor (such as birdfont) and export it again without changesExporting font with Birdfont fixed the problem on Chevin. I had tried to do the same fix with FontForge font editor but with no luck this time.
I had the same problem with react-pdf 1.4.3 but then exporting the font again with FontForge fixed it. Strange that different re-export tricks are needed for different versions of this library.