Bug 119940 - Bolding a Hebrew word in a sentence with some embedded Hebrew fonts changes the intra-word spacing of surrounding words
Summary: Bolding a Hebrew word in a sentence with some embedded Hebrew fonts changes t...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks: Font-Rendering RTL-Hebrew
  Show dependency treegraph
 
Reported: 2018-09-17 20:17 UTC by Idan Miara
Modified: 2023-04-19 06:46 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
test odt (10.30 KB, application/vnd.oasis.opendocument.text)
2018-09-17 20:18 UTC, Idan Miara
Details
before bolding (72.53 KB, image/png)
2018-09-17 20:18 UTC, Idan Miara
Details
after bolding (72.77 KB, image/png)
2018-09-17 20:18 UTC, Idan Miara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Idan Miara 2018-09-17 20:17:29 UTC
Description:
The following bug is related to Hebrew text on LibreOffice 6.1.1.2. it was reproduced on Windows and Linux.
I could not reproduce the problem on MS-Office or with LO-Impress with the same font.
The text is not justified.

Steps to Reproduce:
1. start new document
2. write some Hebrew sentence using the David CLM font (which is the default font on Windows)
3. bold some random word
4. notice that some intra-word spacing on some surrounding words have changed
5. try to bold some other word, other spaces would change...
David CLM font. It can’t be reproduced with English font or with MS-Office with the same font.

Actual Results:
some intra-word spacing on some surrounding words have changed

Expected Results:
no change of intra-word spacing of any other words


Reproducible: Always


User Profile Reset: No



Additional Info:
I'm attaching to pictures, before with a random word bold/not bold
Comment 1 Idan Miara 2018-09-17 20:18:06 UTC
Created attachment 144962 [details]
test odt
Comment 2 Idan Miara 2018-09-17 20:18:24 UTC
Created attachment 144963 [details]
before bolding
Comment 3 Idan Miara 2018-09-17 20:18:42 UTC
Created attachment 144964 [details]
after bolding
Comment 4 Eyal Rozenberg 2018-09-17 20:23:56 UTC
What happens with other Culmus fonts? Other non-Culmus fonts? At different zoom levels?
Comment 5 Idan Miara 2018-09-17 20:37:19 UTC
Different zoom levels - on some zoom levels the bug persists, on others the bold word expands and all the following words move, which I guess is acceptable.
Other fonts: Checking on Windows: I didn't install any specific fonts, just the ones that come with the default installation.
I'm not sure how can I tell which font is from Culmus as I can't find most of them (http://culmus.sourceforge.net/culmus.pdf) I can't find.
For instance, There is a font named Miriam, which doesn't reproduce the problem, and a font named מרים (Hebrew for Miriam) which does reproduce.
Comment 6 Maxim Iorsh 2018-09-17 21:45:06 UTC
The bold word במסמך is 3% narrower than the regular one. It looks like the change in width due to emboldening moves the successive glyphs by a fraction of a pixel, thus making some glyphs move a pixel and others just stay in place.

This is probably a limitation of the renderer which would take some effort to resolve.

Some higher-end TrueType fonts employ subpixel instructing technique to overcome this issue at small font sizes (i.e. where glyph height doesn't exceed 12-15 pixels). This technique requires a huge amount of work on the affected font, and you would probably buy a retina display long before I get to do it.
Comment 7 Xisco Faulí 2018-09-18 19:57:32 UTC
So, this problem started to happen after David CLM was embedded into LibreOffice in https://cgit.freedesktop.org/libreoffice/core/commit/?id=4099b7628405e0ad16844eb59a916aa56ffa76ad.
Before that, the spacing didn't change.

@Heiko, is it a problem in the font or in LibreOffice ?
Comment 8 Xisco Faulí 2018-09-18 20:02:35 UTC
Reproduced with

* David CLM
* David Libre
* Frank Ruehl CLM
* Frank Ruhl Hofshi

but not with

* Alef
* Miriam CLM
* Miriam Libre
* Miriam Mono CLM
* Nachlieli CLM
* Rubik
Comment 9 Heiko Tietze 2018-09-19 06:05:14 UTC
Pretty sure that's an issue of harfbuzz. Khaled, you are the expert here.
Comment 10 ⁨خالد حسني⁩ 2018-09-19 23:19:53 UTC
No idea what would be going here, but might be rounding errors duo to lack of subpixel glyph positioning.
Comment 11 QA Administrators 2019-09-20 03:05:06 UTC Comment hidden (obsolete)
Comment 12 Eyal Rozenberg 2021-02-12 22:46:16 UTC
Bug still manifests with David CLM font and:

Version: 7.1.0.3 / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 4; OS: Linux 5.9; UI render: default; VCL: gtk3
Locale: he-IL (en_IL); UI: en-US

but note that it depends on the zoom factor! When I zoom in a lot, the intra-word spacing does not seem to change. (I'm not sure whether that's a new phenomenon or not).
Comment 13 Eyal Rozenberg 2021-02-15 10:07:30 UTC
I wonder if someone sees this with Arabic fonts as well.