Bug 470091

Summary: Text selection rectangle too large with fonts that have 2000 unitsPerEm
Product: [Applications] okular Reporter: info
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 23.04.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Buggy PDF showing the explained behavior

Description info 2023-05-21 15:51:09 UTC
Created attachment 159166 [details]
Buggy PDF showing the explained behavior

STEPS TO REPRODUCE
1. Open the PDF I attached and select some text

OBSERVED RESULT
The selection rectangle that's drawn over/above the selected text passage is about twice the height of the text.
If there are multiple lines just above each other, the selection breaks because rectangles between lines intersect.

EXPECTED RESULT
The selection rectangle should be just large enough to contain what was collected.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9

ADDITIONAL INFORMATION
The pdf was created using the "printpdf" Rust library. There exists a bug showing the same behavior with Evince (which is also using poppler). The library author did an analysis of what might be going wrong: https://github.com/fschutt/printpdf/issues/108