Bug 367959 - Okular mangles some characters (non embedded fonts)
Summary: Okular mangles some characters (non embedded fonts)
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.24.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-29 14:45 UTC by Sergio
Modified: 2022-06-08 10:13 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Demo file (41.92 KB, application/pdf)
2016-08-29 14:46 UTC, Sergio
Details
How okular shows the demo file (8.81 KB, image/png)
2016-08-29 14:47 UTC, Sergio
Details
How other pdf readers show the file on the same platform (10.73 KB, image/png)
2016-08-29 14:48 UTC, Sergio
Details
The demo file rendered by okular (with arial font installed) (20.11 KB, image/png)
2018-11-18 10:19 UTC, Jaime Torres
Details
Bad Fonts selected (69.86 KB, image/png)
2020-04-26 10:50 UTC, stefano.d
Details
The actual selected fonts (134.96 KB, image/png)
2020-04-26 10:51 UTC, stefano.d
Details
Micro Character not shown correctly (60.25 KB, image/png)
2022-06-08 09:47 UTC, Martin
Details
Page 8 of the Intel manual on Linux (81.82 KB, image/png)
2022-06-08 09:59 UTC, Yuri Chornoivan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio 2016-08-29 14:45:27 UTC
In some occasions, Okular mangles some chars that are reproduced correctly by other PDF readers (e.g. acroread, masterpdfeditor) on the very same platform. Inkscape also imports the PDF correctly. Might be a poppler problem since xpdf has the same issue. The problem seems to be related to substitution rules for fonts that are not embedded in the PDF document nor available on the platform with exactly the same name.

Reproducible: Always
Comment 1 Sergio 2016-08-29 14:46:11 UTC
Created attachment 100839 [details]
Demo file

A demo file to reproduce the problem
Comment 2 Sergio 2016-08-29 14:47:28 UTC
Created attachment 100840 [details]
How okular shows the demo file
Comment 3 Sergio 2016-08-29 14:48:11 UTC
Created attachment 100841 [details]
How other pdf readers show the file on the same platform
Comment 4 Oliver Sander 2016-08-29 20:21:38 UTC
Confirmed on

Qt: 4.8.7
KDE: 4.14.23
Okular: 0.25.0
poppler 0.44.0
Debian Testing
Comment 5 Sergio 2017-06-19 14:54:48 UTC
Still seen in kubuntu 17.04 with the KDE PPA, that is

Okular 1.0.3
Framework 5.35
QT 5.7.1
Poppler 0.48.0

Please, mark as confirmed
Comment 6 Christoph Feck 2017-06-26 17:35:08 UTC
Unless a developer confirms if the issue is caused by Okular code, poppler code, or just because of a font or configuration issue, it does not make sense to change the status.
Comment 7 Jaime Torres 2018-11-18 10:19:27 UTC
Created attachment 116379 [details]
The demo file rendered by okular (with arial font installed)
Comment 8 Sergio 2018-11-19 15:24:02 UTC
Can you please specify better on which platform you made the last screenshot?

I am on kubuntu 18.04 and I still see the issue.

The demo file is clearly *not embedding* its fonts and okular has to pick some fonts that it finds on the system for its rendering, which is the factor triggering the font mangling.  However, the requested font is `TimesNewRomanPSMT`, so the fact that you have an *arial* font installed on the system should not make any difference and if it does, this looks like one more weirdness. Nonetheless, the font that is being substituted for the required `TimesNewRomanPSMT` is `dejavusans.ttf` on my system, which is a sans font, just like your arial so it looks like the system font machinery does not correctly match TimesNewRomanPSMT to a Times New Roman font.

The document uses `TimesNewRomandPSMT` with two different encodings, one is `WinAnsi` and the other one is `Identity-H` with some internal mapping to unicode.

It looks like it is this Identity-H encoding to be troublesome to Okular.
Interestingly, also MasterPDFEditor recently mangles the fonts in the same way as okular.
Comment 9 Patrick Silva 2019-03-25 19:51:40 UTC
Bug persists.
I tested okular 1.6.3, inkscape 0.92.4, evince 3.32 and foxit pdf reader 2.4.4.0911 on Arch Linux. Only inkscape renders the attachment from comment 1 correctly.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Comment 10 Sergio 2019-03-26 08:47:29 UTC
Firefox integrated PDF viewer based on pdf.js is also fine.
Comment 11 stefano.d 2020-04-26 10:50:44 UTC
Created attachment 127886 [details]
Bad Fonts selected
Comment 12 stefano.d 2020-04-26 10:51:04 UTC
Created attachment 127887 [details]
The actual selected fonts
Comment 13 stefano.d 2020-04-26 10:52:33 UTC
I have similar problems, see
"Bad Fonts selected" and "The actual selected fonts".
I can provide you the PDF per email.
I'm using Okular 1.10.0
Comment 14 Sergio 2020-09-10 09:06:40 UTC
Still an issue as of Okular 1.10.0 on 

Operating System: Kubuntu 20.04
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.4.0-47-generic
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-10510U CPU @ 1.80GHz
Memory: 15,3 GiB of RAM

The PDF viewer in Firefox renders the demo file correctly, okular does not. The rendering is not as bad as in the attachment "how okular shows the demo file" right now.
Comment 15 Martin 2022-06-08 09:47:17 UTC
Created attachment 149550 [details]
Micro Character not shown correctly
Comment 16 Martin 2022-06-08 09:48:10 UTC
Comment on attachment 149550 [details]
Micro Character not shown correctly

okular: Version 22.03.70
OS: Win10
https://res.cloudinary.com/openmicrolab/raw/upload/v1487645777/hs_usb_pdg_r1_0_zjnjtx.pdf
Comment 17 Yuri Chornoivan 2022-06-08 09:59:19 UTC
Created attachment 149551 [details]
Page 8 of the Intel manual on Linux

(In reply to Martin from comment #16)
> Comment on attachment 149550 [details]
> Micro Character not shown correctly
> 
> okular: Version 22.03.70
> OS: Win10
> https://res.cloudinary.com/openmicrolab/raw/upload/v1487645777/
> hs_usb_pdg_r1_0_zjnjtx.pdf

Cannot confirm on Linux (22.07.70, poppler 20.12.1).
Comment 18 Sergio 2022-06-08 10:13:32 UTC
OK also here: Linux with okular 22.04.1 and poppler 22.05.0 (from Manjaro packages).