Bug 70968 - spacing vowel signs in Indic are treated as non-spacing after shift to HarfBuzz in LibO 4.1
Summary: spacing vowel signs in Indic are treated as non-spacing after shift to HarfBu...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
4.1.2.3 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Khaled Hosny
QA Contact:
URL:
Whiteboard: target:4.2.0 target:4.1.4
Keywords: regression
: 69310 70840 71080 71914 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-28 19:06 UTC by camatkara
Modified: 2013-11-22 12:03 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
print view where devanagari short 'i' vowel is rendered incorrectly by several fonts (not the first one) (105.61 KB, image/png)
2013-10-28 19:06 UTC, camatkara
Details
.odt file to go with the .png submitted previously (11.52 KB, application/vnd.oasis.opendocument.text)
2013-10-29 20:30 UTC, camatkara
Details
bug comparison 4.1.2.3 vs 4.2 alpha (129.69 KB, image/png)
2013-11-01 09:56 UTC, Asif Ali Rizvan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description camatkara 2013-10-28 19:06:05 UTC
Created attachment 88249 [details]
print view where devanagari short 'i' vowel is rendered incorrectly by several fonts (not the first one)

I'm assuming this is a libreoffice (or one of its dependencies) bug since the devanagari short 'i' vowel renders correctly in gedit in the fonts which cause libreoffice trouble. I'm attaching a screenshot to demonstrate the problem. In the print view, the short 'i' vowel of several of my devanagari fonts is pushed to the left, practically merging into the character that comes before it. See "devanagari_i_print.png" (the correctly rendered font at the top, Sanskrit 2003, is there just to show that the problem doesn't affect all devanagari fonts). This is not just a display issue, as the pdf of this doc will also show the same problem. On the other hand, if the same doc is switched to web view, the problem goes away and all my devanagari fonts are rendered correctly.

I've tried tweaking (turning off) various autocorrect options, but haven't been able to correct the issue.

I'm on an up-to-date version of (Arch linux-based) Manjaro.
Comment 1 Khaled Hosny 2013-10-29 15:52:59 UTC
Can you attach the document used in the screenshot?
Comment 2 camatkara 2013-10-29 20:30:32 UTC
Created attachment 88322 [details]
.odt file to go with the .png submitted previously

I'd already deleted the file for the .png I uploaded, so I created another which shows the same problem. I added the download sites for a devanagari font which works correctly (the first one, Sanskrit 2003) and one which doesn't (the last one, Uttara). Thanks for looking into this!
Comment 3 Khaled Hosny 2013-10-29 21:11:54 UTC
OK, I can reproduce the issue with Siddhanta and Uttara (no access to the other broken fonts), and interestingly using HarfBuzz directly does not show this issue, so looks like a LibreOffice-specific bug.
Comment 4 Khaled Hosny 2013-10-30 07:40:33 UTC
It is half a font bug, half a LobreOffice bugs. In the broken fonts the devanagari short 'i' glyphs has mark glyph class though they are spacing marks so IMO should not have this glyph class, and we use this glyph class to signal glyphs whose advance width should be ignored (essentially second guessing the layout engine, which why I consider it a LibreOffice bug). I pushed a bandaid that fixes this issue to master.
Comment 5 Commit Notification 2013-10-30 07:50:10 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "master":

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

fdo#70968: Incorrect rendering of Devanagari short 'i' vowel



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 6 Khaled Hosny 2013-10-30 17:58:16 UTC
*** Bug 69310 has been marked as a duplicate of this bug. ***
Comment 7 Khaled Hosny 2013-10-31 10:33:27 UTC
*** Bug 70840 has been marked as a duplicate of this bug. ***
Comment 8 Khaled Hosny 2013-10-31 12:00:36 UTC
*** Bug 71080 has been marked as a duplicate of this bug. ***
Comment 9 Pravin 2013-10-31 12:22:31 UTC
(In reply to comment #4)
> It is half a font bug, half a LobreOffice bugs. In the broken fonts the
> devanagari short 'i' glyphs has mark glyph class though they are spacing
> marks so IMO should not have this glyph class, and we use this glyph class
> to signal glyphs whose advance width should be ignored (essentially second
> guessing the layout engine, which why I consider it a LibreOffice bug). 

First of all thanks for fixing this issue. This was the only issue pending for Lohit2 Beta release of lohit-devanagari.

I tried changing class of first-i matra to base glyph and it did worked with Libreoffice but it resulted in breaking my other lookup where this glyph needed as a mark.

Example:
 u0930 u094d u0915 u093f (र्कि)
 ivowelsigndeva kadeva  rphfdeva  -> ivowelsigndeva_rphfdeva kadeva

 Specifically in above lookup we have to ignore Base glyph (kadeva) to get proper conjunct of "ivowelsigndeva rphfdeva"

https://raw.github.com/pravins/lohit/master/devanagari/Lohit-Devanagari.sfd

Might be you can crosscheck your fix with lohit once else i will definitely test this tomorrow.
Comment 10 Khaled Hosny 2013-10-31 13:05:04 UTC
Changing the glyph class will not be needed after applying this fix, and the new Lohit Devanagari seems to work fine too.
Comment 11 Commit Notification 2013-11-01 09:15:50 UTC
Khaled Hosny committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

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

fdo#70968: Incorrect rendering of Devanagari short 'i' vowel


It will be available in LibreOffice 4.1.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 12 Asif Ali Rizvan 2013-11-01 09:56:23 UTC
Created attachment 88469 [details]
bug comparison 4.1.2.3 vs 4.2 alpha

fixed thanks.
Comment 13 Shriramana Sharma 2013-11-01 10:11:50 UTC
(In reply to comment #7)
> *** Bug 70840 has been marked as a duplicate of this bug. ***

Hi -- I guess the bug is a generic bug in case of spacing vowel signs in Indic -- which is why my bug on Tamil was dupped to this. I am changing the summary of the bug accordingly for future reference.

BTW I tried to install the 4.1 devel DEBs but there are no Linux builds under http://dev-builds.libreoffice.org/daily/libreoffice-4-1/ and so I went to the 4.2 alpha builds from http://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@46-TDF/current/. I found that the Debian packaging is quite messed up so apt could not resolve the dependencies. Apparently Asif did not have any problem with the RPMs. I hope somebody fixes the Debian packaging before 4.2 is released.
Comment 14 Khaled Hosny 2013-11-01 10:43:14 UTC
(In reply to comment #13)
> (In reply to comment #7)
> > *** Bug 70840 has been marked as a duplicate of this bug. ***
> 
> Hi -- I guess the bug is a generic bug in case of spacing vowel signs in
> Indic -- which is why my bug on Tamil was dupped to this. I am changing the
> summary of the bug accordingly for future reference.

Yes. The issue is not even Indic specific, it can happen in any script where HarfBuzz zeros mark width based on Unicode not GDEF glyph classes.

> BTW I tried to install the 4.1 devel DEBs but there are no Linux builds
> under http://dev-builds.libreoffice.org/daily/libreoffice-4-1/ and so I went
> to the 4.2 alpha builds from
> http://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@46-TDF/
> current/. I found that the Debian packaging is quite messed up so apt could
> not resolve the dependencies. Apparently Asif did not have any problem with
> the RPMs. I hope somebody fixes the Debian packaging before 4.2 is released.

I never had much sucess with those DEB packages and I always use self-built binaries, but you may want to report this separately (or wait for the next 4.1 release).
Comment 15 Khaled Hosny 2013-11-22 12:03:14 UTC
*** Bug 71914 has been marked as a duplicate of this bug. ***