Bug Hunting Session
Bug 52540 - Ligatures hyphenation bug using graphite font (Linux Libertine G): "ligc" is ignored
Summary: Ligatures hyphenation bug using graphite font (Linux Libertine G): "ligc" is ...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.5.3 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA target:4.2.0 target:4.0.4 target:...
Keywords: bibisectNotNeeded, regression
: 52544 (view as bug list)
Depends on:
Blocks: Font-Rendering
  Show dependency treegraph
 
Reported: 2012-07-26 13:11 UTC by dan980
Modified: 2019-08-14 23:47 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
test document (10.63 KB, application/vnd.oasis.opendocument.text)
2012-07-26 13:11 UTC, dan980
Details
English test file (10.48 KB, application/vnd.oasis.opendocument.text)
2013-04-11 00:51 UTC, László Németh
Details
Not extra, but missing ligature. (9.05 KB, application/vnd.oasis.opendocument.text)
2013-04-12 09:23 UTC, László Németh
Details
New test case (11.27 KB, application/vnd.oasis.opendocument.text)
2015-03-15 22:55 UTC, László Németh
Details
patch for fix (3.50 KB, patch)
2015-03-20 08:58 UTC, martin_hosken
Details
Test file with Graphite and non-Graphite hyphenation (13.47 KB, application/vnd.oasis.opendocument.text)
2015-04-29 21:43 UTC, László Németh
Details
screen shot about the last (reintroduced?) bad break position (19.32 KB, image/png)
2015-04-29 21:51 UTC, László Németh
Details
hyphenation seems OK (28.66 KB, image/png)
2015-06-22 09:49 UTC, martin_hosken
Details
ligature hyphenation test document (12.14 KB, application/vnd.oasis.opendocument.text)
2016-08-22 19:21 UTC, Vera
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dan980 2012-07-26 13:11:45 UTC
Created attachment 64732 [details]
test document

Problem description: 
Linux Libertine G by default handles the standards ligatures, like ff, ffi, ffl, tt.
On hyphenated words, the ligature is not omitted.
Using the test text "Lorem ipsum differenza"
I get this beaviour:

Lorem ipsum diff-
ferenza

while it should be:

Lorem ipsum dif-
ferenza

Linux Libertine offers a variant, "Linux Libertine G:ligc=1" which should correct ligatures on hyphenated words. But apparently it is ignored on the latest version of Libreoffice.

Note: I'm using the Italian hyphenation.

Steps to reproduce:
1. Enable hyphenation on the current paragraph
2. Set "Linux Libertine G:ligc=1" as the current font
3. Paste same test text that gets hyphenated on a standard ligature 

Current behavior:
A ligature is added before the hyphenation line.

Expected behavior:
No ligature should be added.

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1
Libreoffice 3.5.5.3
Linux Libertine G version 2012-01-16
Comment 1 László Németh 2012-08-08 13:03:29 UTC
Confirmed with LibreOffice 3.6.
Comment 2 László Németh 2012-08-13 13:51:27 UTC
*** Bug 52544 has been marked as a duplicate of this bug. ***
Comment 3 László Németh 2013-04-11 00:51:05 UTC
Created attachment 77793 [details]
English test file

Hyphenation of “proofing” in LibreOffice is proofi- ing.
Comment 4 László Németh 2013-04-12 09:22:02 UTC
Workaround: put soft hyphen at the bad break point.

[Note (another, but related bug): there is no kerning before the hyphen and Graphite ligature replacement before extra characters of a special hyphenation, eg. Hungarian cursive gy ligature in roggyan -> rogy=gyan, second test file attached.]
Comment 5 László Németh 2013-04-12 09:23:41 UTC
Created attachment 77854 [details]
Not extra, but missing ligature.

Automatic hyphen and extra characters before the special hyphenation don't handled by Graphite kerning and ligature replacement.
Comment 6 Commit Notification 2013-05-22 07:19:06 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=56ae7a8c50c4040a7634986a055161b3aeb5819a

fdo#52540 fix hyphenation of Graphite ligatures



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2013-05-22 08:06:24 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7d1e6cb0564a1eb886fd8f95adbcc7d8b9aa028f&h=libreoffice-4-0

fdo#52540 fix hyphenation of Graphite ligatures


It will be available in LibreOffice 4.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2013-05-22 08:14:13 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4233b2d5c13887f4b8e68fb59a54aa2b09c9a66b&h=libreoffice-4-1

fdo#52540 fix hyphenation of Graphite ligatures


It will be available in LibreOffice 4.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2013-09-06 14:02:16 UTC
Laszlo Nemeth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=58e1112a6a974b96bb8595e3ee9d08e915d4fd14

fdo#52540 fix Graphite hyphenation (ligat. + combining diac.)



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 10 László Németh 2015-03-15 22:55:19 UTC
Created attachment 114118 [details]
New test case
Comment 11 Commit Notification 2015-03-15 23:45:21 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e2981019cb7ec3befa79a7544cee3d402f458dbf

fdo#52540, fdo#88051: fix Graphite layout

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2015-03-18 20:25:14 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aa543be363ffecf4d8ba9db4b26f0b6e0312b662&h=libreoffice-4-4

fdo#52540, fdo#88051: fix Graphite layout

It will be available in 4.4.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 martin_hosken 2015-03-20 08:57:11 UTC
This bug, and it's embarrasingly long chain of related bugs is due to a slightly wider problem than just what comes after and how to limit the damage. What I think is happening is that sometimes Graphite and libreoffice disagree over what text should be in a run. Libo comes up with two short runs and Graphite converts these into a single cluster. Libo calls the graphite_layout to run the first run, which generates a long cluster, which is fine. In the second call for the second run, the first character in the new cluster is rendered as a base character and so the integration code goes: oh look the cluster is in range, include it.

What needs to happen is that graphite needs to back up when generating its segment and make sure it picks up previous bases so that the second run that is passed to it is seen as being part of the first run cluster and so nothing is rendered.

I've implemented a patch to this end, that also removes László Németh's fine patching to solve the specific problems. I would ask people to apply the patch and test that it does solve all the old problems in a suitably generic way.
Comment 14 martin_hosken 2015-03-20 08:58:33 UTC
Created attachment 114205 [details]
patch for fix
Comment 15 Commit Notification 2015-03-23 09:12:04 UTC
Martin Hosken committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=12168aeea91a57e63159c3103c904d630c44c62e

fdo#52540 refix graphite layout generally

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 martin_hosken 2015-03-24 09:09:47 UTC
Any chance of 4.4.3 promotion for this patch?
Comment 17 László Németh 2015-04-29 21:43:09 UTC
Created attachment 115200 [details]
Test file with Graphite and non-Graphite hyphenation
Comment 18 László Németh 2015-04-29 21:50:56 UTC
Unfortunately, it seems, the patch results bad hyphenation position, eg. "proofi-ng" instead of "proof-ing", see in the attached test file and screen shot.

@Martin: I have checked a recent master with your patch, sorry for my late check!
Comment 19 László Németh 2015-04-29 21:51:46 UTC
Created attachment 115202 [details]
screen shot about the last (reintroduced?) bad break position
Comment 20 László Németh 2015-04-29 21:52:58 UTC
Comment on attachment 115202 [details]
screen shot about the last (reintroduced?) bad break position

Bad Graphite (above) and correct non-Graphite break positions
Comment 21 László Németh 2015-06-14 14:12:49 UTC
@Martin, sorry, I reopened this Graphite bug a month ago, but I didn't notice, that you aren't in the CC list of the bug. It seems, this bug is a side effect of your fix for the Bug 62846. Could you help to fix this one? Thanks in advance, Laszlo
Comment 22 martin_hosken 2015-06-22 09:49:45 UTC
Created attachment 116722 [details]
hyphenation seems OK

I may well be missing something but building today from master seems to work for me.
Comment 23 László Németh 2015-06-23 10:24:20 UTC
(In reply to martin_hosken from comment #22)
> Created attachment 116722 [details]
> hyphenation seems OK
> 
> I may well be missing something but building today from master seems to work
> for me.

@Martin: For me, too, thanks for checking! I will check with a recent libreoffice-5-0, too, and close this issue.

Unfortunately, it seems, there is a bigger problem now, LibreOffice has lost conditional Graphite feature support, for example, extended font name "Linux Libertine G:smcp=1" doesn't result small capitals. I will bibisect it soon, and report the problem.
Comment 24 László Németh 2015-06-26 13:16:12 UTC
It seems, the lost conditional Graphite feature support is related to the GTK3 transition of master.

In the master branch, start LibreOffice with the following parameter to reproduce the ligature hyphenation problem of libreoffice-5-0 (this fixes the lost optional features, for example, the extended font name "Linux Libertine G:smcp=1" will result small capitals again):

SAL_VCL_PLUGIN=gen instdir/program/soffice
Comment 25 László Németh 2015-07-04 13:28:52 UTC
@Martin: I have reverted your commit  "fdo#52540 refix graphite layout generally" in libreoffice-5-0 to fix the hyphenation for LO 5.0:

https://gerrit.libreoffice.org/#/c/16755/

The master still have the hyphenation problem.
Comment 26 martin_hosken 2015-07-04 14:00:49 UTC
Please don't. That patch fixes way more problems than just not fixing this one. Please put it back. If that patch doesn't fix this problem (as you say, it doesn't introduce it). That is no reason to kick it out. It's every reason to look deeper. If you remove this patch it is up to you now to fix all the bugs that that patch fixed in addition to this one. Those bugs are now yours to fix and to do so in a timely fashion.

I am not at all pleased that you have done this without any kind of diagnosis that these patches are causing a problem. Please put the patches back, as soon as possible.
Comment 27 martin_hosken 2015-07-04 14:13:54 UTC
In fact, I will go further. The patch does seem to fix 52540. You stated in comment 23 that the problem was fixed. You then introduce a different issue (that I suspect has nothing to do with the patch) and rip out a perfectly good solution to the actual bug because it doesn't fix a different issue.

I strongly suggest you put the patch back and then raise a separate issue for disabling graphite for a particular font or whatever under a different bug number rather than hijack an existing bug and its fix and holding it to ransom.

If not, then you have the responsibility of solving this bug, all the other bugs that reference this bug that are fixed by this patch and also the new issue you raise, all on your own. Alternatively, put the patch back, raise a new bug and I'll take a look.

Of course my understanding of this issue and the others may be wrong, in which case I am happy to be enlightened.
Comment 28 Commit Notification 2015-07-04 16:13:01 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=eef0577c5e90ca5c48d58793945d2d8684644cc0&h=libreoffice-5-0

tdf#52540 Revert "fdo#52540 refix graphite layout generally"

It will be available in 5.0.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 29 Commit Notification 2015-07-04 16:13:04 UTC Comment hidden (obsolete)
Comment 30 tommy27 2015-10-04 10:08:38 UTC
@Lazlo
can we set back status to fixed after your last committ?
Comment 31 Robinson Tryon (qubit) 2015-12-10 07:52:42 UTC Comment hidden (obsolete)
Comment 32 Vera 2016-08-22 19:21:09 UTC
Created attachment 126974 [details]
ligature hyphenation test document

Hi,

The LibreOffice still can't handle the hyphenation correctly with Linux Libertine G.

I attached a test document with tt, ff, fb, fl and fi ligatures.

Linux Libertine G version 5.1.3
LibreOffice 5.1.4.2
Xubuntu 16.04.1
Comment 33 Xisco Faulí 2017-07-13 09:19:04 UTC
Setting Assignee back to default. Please change it back if you're still working on this issue
Comment 34 Thomas Lendo 2019-08-14 06:59:16 UTC
Adding Khaled Hosny to CC list. As font specialist maybe he knows something helpful. No changes since summer of 2015.
Comment 35 Khaled Hosny 2019-08-14 23:47:42 UTC
If I change the font size in https://bugs.documentfoundation.org/attachment.cgi?id=77854 or https://bugs.documentfoundation.org/attachment.cgi?id=115200 I get hyphenation in:

Version: 6.2.5.0
Build ID: 9883e6d6b2d958db6253e7b973987bb92094bd0d
CPU threads: 6; OS: Mac OS X 10.14.6; UI render: GL; VCL: osx; 
Locale: en-EG (en_EG.UTF-8); UI-Language: en-US
Calc: threaded