Bug 1969736 - Accents on uppercase characters (think É) do not show on the first line in pdf annotations in okular
Summary: Accents on uppercase characters (think É) do not show on the first line in pd...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: poppler
Version: 35
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Marek Kašík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-09 07:25 UTC by Éric Brunet
Modified: 2022-11-18 14:20 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-11-18 14:20:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
screenshot (66.43 KB, image/jpeg)
2021-06-09 07:25 UTC, Éric Brunet
no flags Details
Czech characters not shown (50.34 KB, image/png)
2021-06-29 20:35 UTC, frasou
no flags Details

Description Éric Brunet 2021-06-09 07:25:59 UTC
Created attachment 1789509 [details]
screenshot

There is a display problem in the first line of annotations in pdf: the accents on É, À, Î Ö, etc. do not show if they are on the first line. The do show correctly starting on the other lines, and accents on lowercase letters (à, é, ...) look fine everywhere.

The attachment is a screenshot of okular. On the left, the annotation. On the right, an open box to edit the annotation. In the editing box, all accents are correctly displayed. In the annotation itself, some are missing.

(This is on an uptodate fedora 34, okular-20.12.2-2.fc34.x86_64, poppler-21.01.0-7.fc34.x86_64.

This issue has been a little bit discussed in bug 1958673. A comment that was made there is:

> It is an issue in poppler when drawing upper case glyphs which have 
> diacritical mark (those which come from an external font). The position of the 
> first line is too high. This is probably caused by the way the annotation font 
> is handled here. It uses font size as height of the glyphs so it probably does 
> not count with the diacritical mark.

> I am looking for the piece of code where I could influence this but it is 
> possible that this would need a fundamental change in how fonts are treated 
> (the not embedded ones).

Comment 1 frasou 2021-06-29 20:35:56 UTC
Created attachment 1795999 [details]
Czech characters not shown

Comment 2 frasou 2021-06-29 20:37:27 UTC
There are more characters which are not shown.

ď ť ň ě č ř ů

These are from czech alphabet.

Comment 3 frasou 2021-06-29 21:03:55 UTC
I forgot, versions where problem persists:

poppler-21.06.1
okular-21.04.2

Comment 4 Éric Brunet 2021-06-30 17:07:52 UTC
I suspect it is a different issue; For the present bug, the characters (É, À, etc.) show, but without their accent if they are on the first line. In your snapshot, the characters don't show at all.

There are unfortunately many characters that do not show in okular's annotations; in fact I think that okular only show latin1 characters. I wish I could use the whole unicode and enter greek and math characters, as in for instance ΔU=∫(δQ+δW). If I try to type that, I only get U=(Q+W)...

Comment 5 Marek Kašík 2021-07-01 09:25:54 UTC
Hi,

Éric is right, the issue with the czech characters is a different one. This bug is about wrong positioning of the uppercase characters. Basically, poppler is missing "leading" value when computing positions of such characters so it places it too high and the diacritical marks are clipped out (you can see that consecutive lines in the annotation are too close - missing leading). Or it can be described as discrepancy between height of bounding box of the used font and sum of descent and ascent (which is usually close to the "leading" value).

I don't have much time now but one of the solutions I'm thinking about is to add a new member to "BuiltinFont" structure named "leading" and use it in "AnnotFreeText::generateFreeTextAppearance()" or we can just compute the difference between the height of the bounding box and "descent + descent" and use it.

I look at the issue with czech characters (and others of course too :) ) for some time but it is much more difficult to solve.

Comment 6 Ben Cotton 2022-05-12 16:53:58 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '34'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 7 Éric Brunet 2022-05-12 20:41:40 UTC
The problem is still present in an uptodate fedora 35.
Relevant packages:
okular-21.12.2-1.fc35.x86_64
poppler-21.08.0-1.fc35.x86_64

I am bumping the fedora version number to 35

Comment 8 ozeszty 2022-11-17 12:25:15 UTC
Should be fixed since poppler 22.05 (F37+) https://gitlab.freedesktop.org/poppler/poppler/-/issues/362#note_1372657

Comment 9 Éric Brunet 2022-11-18 14:20:36 UTC
Hi,

I confirm that this bug is now fixed.

Unfortunately, while checking this, I found now two new bugs affecting the "Inline Note" tool which where not present in previous versions of okular. I have just opened two new issues:

Bug 2143951: now some space is missing in between lines: a "g" on the top line and a "É" just below will overlap.

Bug 2143960: in fact, I have some difficulty typing "É" in an inline note. My usual keybinding shift-AltGr-2 (french keyboard) is no longer working, and instead it allows me to highlight text in a non-standard color. I can still type "È" with shift-AltGr-7, though.

I have assigned these bugs to okular; maybe I should have assigned them to poppler. I don't know.

Thanks for all the work!

Éric Brunet


Note You need to log in before you can comment on or make changes to this bug.