Bug 477192 - okular selects wrong font for PDF
Summary: okular selects wrong font for PDF
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 21.12.3
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-18 15:35 UTC by Albert Wik
Modified: 2023-11-20 23:07 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Wik 2023-11-18 15:35:26 UTC
SUMMARY
***
okular selects the wrong fonts for a PDF.  The document requests "CourierNew" and "TimesNewRoman".  Both fonts are installed on the system, but okular selects "NimbusMonoPS" and "Times LT".  Illustration:
https://drive.google.com/file/d/178nuOFvWiBOoqmSIs7spAqDrGt2YHAqQ/view?usp=sharing
***


STEPS TO REPRODUCE
1. Download https://gwern.net/doc/psychology/personality/psychopathy/1941-cleckley-maskofsanity.pdf
2. Open it with okular.
3. From the "File" menu, choose "Properties".
4. Choose the "Fonts" tab.

OBSERVED RESULT
Wrong fonts get selected by okular.  Illustration:
https://drive.google.com/file/d/178nuOFvWiBOoqmSIs7spAqDrGt2YHAqQ/view?usp=sharing

EXPECTED RESULT
I would expect the document's requested fonts to be selected.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 6.5.0-1003-oem #3-Ubuntu; Linux Mint 21.2 Cinnamon
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
fc-match selects the correct fonts:
$ fc-match 'TimesNewRoman'
times.ttf: "Times New Roman" "Regular"
$ fc-match 'CourierNew'
cour.ttf: "Courier New" "Regular"
Comment 1 Albert Astals Cid 2023-11-20 23:07:00 UTC
Okular doesn't do any font selection for PDF files, poppler does, so if at all this would be a bug in poppler

https://poppler.freedesktop.org/

But be prepared to be told there that's just your system's fontconfig not being setup