inter icon indicating copy to clipboard operation
inter copied to clipboard

Text copied from a PDF is reversed when pasted

Open DReigada opened this issue 3 years ago • 8 comments

Describe the bug Text copied from a PDF is reversed when pasted. This only happens with PDFs that are generated from Chrome/Chromium and opened with macOS Preview.

To Reproduce Steps to reproduce the behavior:

  1. Save https://rsms.me/inter/ as a PDF file in Chrome/Chromium
  2. Open PDF file with Macos Preview
  3. Copy any text block from the page
  4. Paste the text somewhere

Expected behavior The pasted text block should be the same as the copied one.

Screenshots

https://user-images.githubusercontent.com/11428771/128847161-ff252f7a-d5d9-417b-9b94-d446aaab04d1.mp4

Environment

  • OS: macOS 11.4
  • App that renders the font: macOS Preview (exported by Chrome)
  • Version of font [e.g. "Inter Regular 3.018;git-588b23468" — you can use fontdrop.info to find out the version]

Additional context I'm not sure if the issue is in the font, Chromium or macOS preview.

DReigada avatar Aug 10 '21 10:08 DReigada

This doesn’t sound like an issue with the Inter fonts but rather with the software combination.

rsms avatar Aug 15 '21 10:08 rsms

This is not related to font If you can reproduce this issues with other pdf files, please close your issue

ZerdoX-x avatar Sep 17 '21 19:09 ZerdoX-x

Stumbled upon this issue.. happens with a PDF generated with the marp vscode extension as well.

cathalnoonan avatar Nov 22 '21 22:11 cathalnoonan

Same problem here when printing to PDF from Chrome. PDF looks normal when viewed in MacOS "Preview" app, but selected & copied text pastes characters in reverse order.

kimhill avatar Jan 11 '22 23:01 kimhill

Same problem here when printing to PDF from Chrome.

Please attach an example PDF which exhibits this behavior.

kenmcd avatar Jan 12 '22 00:01 kenmcd

Please attach an example PDF which exhibits this behavior.

Thanks!

FreeBSD Users Group _ Howdy folks.pdf

kimhill avatar Jan 12 '22 08:01 kimhill

Please attach an example PDF which exhibits this behavior.

Thanks!

FreeBSD Users Group _ Howdy folks.pdf

The PDF is quite a mess. No fonts embedded properly at all. And the text is kind of a jumble, and depending on which PDF editor is used I got differing text. Some looked OK, some was caps only. Just a mess. Says it was created by: Skia/PDF m97 So as @rsms mentioned above - appears to be an issue with the software. Not a problem with the fonts.

kenmcd avatar Jan 12 '22 22:01 kenmcd

So as @rsms mentioned above - appears to be an issue with the software.

Thanks for the feedback! Doesn't always happen, but weird when it does…

kimhill avatar Jan 13 '22 02:01 kimhill

I have the same issue. PDFs created with Skia/PDF are corrupted in Preview & Safari, but work fine in other apps like PDF Expert & Chrome.

OptimusPrime91 avatar Mar 30 '23 12:03 OptimusPrime91

The error is only reproductible with MacOS finder preview for PDF and it is related to variable fonts. In my case it was with Mulish font https://fonts.google.com/specimen/Mulish. I downloaded the source.ttf and included the non variable version to make it work properly.

trinketmage avatar Sep 07 '23 21:09 trinketmage

I downloaded the source.ttf and included the non variable version to make it work properly.

Thanks for the feedback!

kimhill avatar Sep 08 '23 08:09 kimhill

related to variable fonts

Confirming that the non-variable Inter Display worked when exported as PDF from Chrome on MacOS. Copied text is not reversed.

Note: for strange reasons, some symbols (e.g. +, -, (, ~) are not copied properly from the exported PDF in Mac Preview (see screenshot), which wan't the case when using other fonts. image

egorvinogradov avatar Nov 28 '23 11:11 egorvinogradov

Same issue happen for us. We noticed PDF created from Chrome when various font-feature-settings are on, those alternate chars replaced with ? when copied from PDF. We had to disable font-feature-settings specifically for printing because of that. Happens with both v3.19 and v4.

oleksify avatar Nov 29 '23 20:11 oleksify

Sounds like the Chrome PDF library is not properly handling embedding the characters when an OpenType substitution has been made. If the glyph does not appear at all, that is one problem. If the copy-and-paste is wrong (even if the correct glyph appears), that means the ToUnicode table is not correct. Either way that is a Chrome issue which should be reported there.

And the work-around is to disable the OpenType features.

kenmcd avatar Nov 29 '23 21:11 kenmcd