Bug 150132 - Draw corrupts characters and layout when opening PDF
Summary: Draw corrupts characters and layout when opening PDF
Status: RESOLVED DUPLICATE of bug 85295
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.2.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PDF-Import-Draw
  Show dependency treegraph
 
Reported: 2022-07-25 06:42 UTC by Dan Dascalescu
Modified: 2022-12-22 08:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
PDF that gets corrupted when opened by Draw (928.22 KB, application/pdf)
2022-07-25 06:42 UTC, Dan Dascalescu
Details
2. Notice the corrupted characters and layout (210.79 KB, image/png)
2022-07-25 06:43 UTC, Dan Dascalescu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Dascalescu 2022-07-25 06:42:48 UTC
Created attachment 181394 [details]
PDF that gets corrupted when opened by Draw

1. Open the attached PDF in LibreOffice Draw
Comment 1 Dan Dascalescu 2022-07-25 06:43:15 UTC
Created attachment 181395 [details]
2. Notice the corrupted characters and layout
Comment 2 Rafael Lima 2022-07-25 14:56:10 UTC
It seems only the letter "i" is not being recognized during the PDF import. Also the numbers are not being imported.

It seems the problem is not actually with Draw, but rather that the original PDF uses weird encoding for some characters.

Try copying the text from the PDF and paste it in a text editor and you'll see B�tco�n.
Comment 3 Dan Dascalescu 2022-07-25 16:59:09 UTC
The PDF is "Saved As" from the Print dialog in Firefox. There's no corruption when opened in Firefox or Krusader's viewer. Also, the "English" block and the bottom are not offset.
Comment 4 Roman Kuznetsov 2022-07-26 19:47:55 UTC
confirm the problem in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 8580cbdc19224bc2a467535cc527cd28b0f30879
CPU threads: 4; OS: Mac OS X 12.5; UI render: Skia/Metal; VCL: osx
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: threaded Jumbo

and the PDF looks fine in default PDF viewer in macOS and in some other too

and yes if try to copy some text from PDF and then paste it into text editor (I tried in to Sublime Text) then text looks wrong and has some � symbols

So I'm not sure it's our bug
Comment 5 Rafael Lima 2022-07-26 21:53:17 UTC
(In reply to Roman Kuznetsov from comment #4)
> So I'm not sure it's our bug

I would say this is not our bug. Take a look at the embedded fonts in the PDF.

Because these fonts are not installed at the system level, LibreOffice can't reach them and this causes the text to be rendered this way.
Comment 6 Telesto 2022-07-26 23:49:35 UTC
(In reply to Rafael Lima from comment #5)
> (In reply to Roman Kuznetsov from comment #4)
> > So I'm not sure it's our bug
> 
> I would say this is not our bug. Take a look at the embedded fonts in the
> PDF.
> 
> Because these fonts are not installed at the system level, LibreOffice can't
> reach them and this causes the text to be rendered this way.

Mostly, if a font is unavailable a font-substitute being used. If a the replacement font is lacking certain characters you get question marks. 
The question is - as far i'm aware -, is the replacement font picked by LibreOffice for the CairoFont the next best thing?
Comment 7 Heiko Tietze 2022-07-27 07:20:00 UTC
(In reply to Telesto from comment #6)
> ...is the replacement font picked by
> LibreOffice for the CairoFont the next best thing?

Obviously not, and looking at https://fonts.adobe.com/fonts/cairo none shipped seems to fit. AFAIR, a list of popular fonts and their replacement is defined in the code but this has of course limits. Use tools > options > fonts for special cases, see https://blog.documentfoundation.org/blog/2020/09/08/libreoffice-tt-replacing-microsoft-fonts/ (and many other).

=> NAB (the actual problem is lack of feedback, something like an infobar "The font 'Cairo' used in this document is not available and is being replaced by 'Liberation Sans'", ideally with the option to install the missing font; we have man tickets around this topic)
Comment 8 Timur 2022-07-27 07:53:27 UTC
F�rst F�ghter in LO is CairoFont-0-0 which is Embedded Subset. 
I think this can be marked as a duplicate of a bug that will hardly be fixed.

*** This bug has been marked as a duplicate of bug 85295 ***
Comment 9 ⁨خالد حسني⁩ 2022-12-22 08:06:50 UTC
(In reply to Heiko Tietze from comment #7)
> (In reply to Telesto from comment #6)
> > ...is the replacement font picked by
> > LibreOffice for the CairoFont the next best thing?
> 
> Obviously not, and looking at https://fonts.adobe.com/fonts/cairo none
> shipped seems to fit.

I think CairoFont name in the PDF is from https://cairographics.org/, it is a name it uses for embedded fonts under certain circumstances where it is unable to determine the real font name.