Bug 477192

Summary: okular selects wrong font for PDF
Product: [Applications] okular Reporter: Albert Wik <awik32>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: RESOLVED UPSTREAM    
Severity: normal CC: aacid
Priority: NOR    
Version First Reported In: 21.12.3   
Target Milestone: ---   
Platform: Mint (Ubuntu based)   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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