Bug 135053 - Some letters are cut off, but it is hard to notice
Summary: Some letters are cut off, but it is hard to notice
Status: RESOLVED DUPLICATE of bug 43643
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Rendering
  Show dependency treegraph
 
Reported: 2020-07-22 19:00 UTC by peter_bakic
Modified: 2023-10-13 07:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Collection of words with cutoff letters - copy-pasted from original (sometimes, the error corrects itself on copy-paste) (14.57 KB, text/plain)
2020-07-22 19:07 UTC, peter_bakic
Details
do you see here your bug (74.53 KB, image/png)
2020-07-22 19:10 UTC, BogdanB
Details
Tools - Options (199.14 KB, image/png)
2020-07-22 19:13 UTC, BogdanB
Details
cutoff letters screengrab (182.85 KB, image/png)
2020-07-22 19:22 UTC, peter_bakic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peter_bakic 2020-07-22 19:00:46 UTC
Description:
I have written an entire book, about 80k words. In it, I now find that some letters are missing their right part. Most letter "f" (lower case) but also some other letters. It appears that the blank space that follows is covering the letter. If I delete that letter and the letter after it, it usually reverts to a normal state, so no cut-off any more. But the problem is VERY hard to notice, so I have to sift through entire manuscript to find corrupted letters and, I miss quite a few. Every time I open it, I find new ones. If I print such a page, the print has the same cut-off letters too, true to what is on the screen. So, this is not a display issue. Problem is - it is not reproducible, except in one case where a word "beefcake" will have letter "f" cut off if LibreOffice writer inserts a hyphen to break the word into two (at new line).

Steps to Reproduce:
1. Doesn't seem to be reproducible, can only be found in an already formatted text. Possibly can be reproduced by forcing the word "beefcake" to be split into to at the end of the line with automatic hyphen insertion.
2.
3.

Actual Results:
Didn't notice this problem while typing, only after some edits, and working on the file for a more than a year.

Expected Results:
As it is not reproducible, at least not directly, nothing will happen as one types in libreoffice, only after the same file is opened multiple times, edited and so on. I only noticed the problem with cut-off letters during the final read before I was going to pass the file to the proof-reader for the final edit before printing.


Reproducible: Sometimes


User Profile Reset: No



Additional Info:
The best way to see this bug is to have me send you the file in which I assembled examples of letters that are cut off. They all miss the 20% or so from the right side which is easily missed.
As for OpenGL, I don't see anywhere in options to turn it on or off. Only OpenCL, and that was OFF.
Comment 1 BogdanB 2020-07-22 19:07:06 UTC
You can make a screenshot for a part of the text with problems.

Also what can you do, is to go to Help - Restart in Safe Mode - Restart and see if the problem persist.

If yes, would be nice to have another document, without sensitive info in it, where the bug could be seen.
Comment 2 peter_bakic 2020-07-22 19:07:12 UTC
Created attachment 163418 [details]
Collection of words with cutoff letters - copy-pasted from original (sometimes, the error corrects itself on copy-paste)

This is a sampling of cutoff letters bug - most of them letter "f" but there are others too. More often than not, the cutoff letters do NOT make it through the copy-paste (they correct themselves), but sometimes they do, as is evidenced here. To see the cutoff letters better, you can enlarge the text to 70-80 points.
Comment 3 BogdanB 2020-07-22 19:09:40 UTC
Do you see my problem in my screenshot?
Comment 4 BogdanB 2020-07-22 19:10:07 UTC
Created attachment 163419 [details]
do you see here your bug
Comment 5 BogdanB 2020-07-22 19:13:33 UTC
Also you have some options about F letter here:
Tools - Options - LibreOffice Writer - "Compatibility option for Cutoff F"

See my new screenshot
Comment 6 BogdanB 2020-07-22 19:13:50 UTC
Created attachment 163420 [details]
Tools - Options
Comment 7 peter_bakic 2020-07-22 19:18:58 UTC
(In reply to BogdanB from comment #1)
> You can make a screenshot for a part of the text with problems.
> 
> Also what can you do, is to go to Help - Restart in Safe Mode - Restart and
> see if the problem persist.
> 
> If yes, would be nice to have another document, without sensitive info in
> it, where the bug could be seen.

Just made a screen shot, with letters set at 80pt. I circled the errors in red. Where do I upload it?
Comment 8 peter_bakic 2020-07-22 19:22:23 UTC
Created attachment 163423 [details]
cutoff letters screengrab

Here is the screengrab showing letters F and italic letter "e" also cut off.
In reply to your earlier question - yes, I see the cutoff F in your example, although it is less noticeable with that font.
I have examples of some other letters too, so it is not limited to letter "F".
Also, I do not see the option that you mention for dealing with cutoff letter F in libreoffice writer - at least not in the path you submitted here.
Comment 9 peter_bakic 2020-07-22 19:25:02 UTC
To be more precise: I do see the option for "cutoff_F_" but don't know which one of the long list of options should be on or off for it to work. Besides, letter "F" is not the only problematic letter, but I would hope that fixing that one should fix others too.
Any idea what causes this behavior? It seems that the blank space of the following letter overlaps the previous one...
Comment 10 peter_bakic 2020-07-22 19:33:16 UTC
I just went through the entire list of options, turning them on and off one by one. None of the options solved the problem - only one letter "F" got corrected, and that was the automatically hyphenated one. The rest, including the cutoff letter "e" stayed the same no matter how I set the options for "cutoff letter F".
Comment 11 Buovjaga 2020-11-30 14:39:06 UTC
In your screenshot we can see you are using some Garamond font. Is this the only font that shows the problem? Ideally some free font would show the problem, so we could test.
Comment 12 Mike Kaganski 2021-03-10 05:51:22 UTC
Ref: https://ask.libreoffice.org/en/question/297452/will-this-cut-off-letters-bug-ever-be-solved/

As noted there, the problem is not a font, but the character background color. Clearing direct formatting (or just manually assigning "no fill") "fixes" the problem.

So the question is - what to do with the character rectangles that do not match the glyphs when effects like italics or bold are used.

Simple srom-scratch steps:

1. In a new text documents, type "ff".
2. Select all, make Italic.
3. Select all, apply a Highlight color.
4. Select the second "f", make Bold.

Tested with Version: 7.1.1.2 (x64) / LibreOffice Community
Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 13 Mike Kaganski 2021-03-10 06:03:09 UTC
... and it seems that the problem is in the sequence that is used for painting the characters backgrounds. Wherever a new run of characters is started (i.e., a formatting of characters is somehow different from the previous), the rectangle for this new run is filled with its background (if exists) *after* the previous run is fully painted, so the new area fill may erase parts of earlier characters that happened to overlap.

It looks like an obvious fix would be to postpone drawing foreground character glyphs only after all backgrounds were painted... no idea how difficult could that be.
Comment 14 ajlittoz 2021-03-10 07:21:47 UTC
From experiments, it appears the clipping appears only when there is no original font file (e.g. an italic variant is requested) and the font renderer has to create one from the available ones.

To check my intuition, I played with a cursive font which has hooks protruding outside the glyph bounding box so that adjacent characters look attached together.

As long as the "regular" variant is unaltered by "effects", highlighting colour will not clip the glyphs. I apply italic to the text and clipping shows up.

The font I used has only a "regular" file and none else (no italic, nor bold) so that the font renderer is forced to generate one. It is likely that it distorts the bounding rectangle into a slanted parallelogram so that the sides are no longer "vertical".

Another necessary condition is a break into formatting variants. Clipping occurs only at the boundary of italics, not in the middle of the sequence.

Tested with 7.0.4.2
Comment 15 Mike Kaganski 2021-03-10 09:57:30 UTC
(In reply to ajlittoz from comment #14)
> From experiments, it appears the clipping appears only when there is no
> original font file

No. Please check the steps from comment 12. It uses only "stock" fonts (namely, in my testing, I used Liberation Serif, definitely present on system).
Comment 16 QA Administrators 2023-03-11 03:24:46 UTC Comment hidden (obsolete)
Comment 17 BogdanB 2023-09-21 05:36:14 UTC
Also in
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a34dcd03254480927c403d904c0e754802d97b90
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 18 BogdanB 2023-09-21 05:38:39 UTC

*** This bug has been marked as a duplicate of bug 43643 ***
Comment 19 Mike Kaganski 2023-10-13 07:07:14 UTC
*** Bug 157249 has been marked as a duplicate of this bug. ***