Bug 83819 - FORMATTING: Ligatures spaced out inappropriately
Summary: FORMATTING: Ligatures spaced out inappropriately
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
(earliest affected) release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
Whiteboard: BSA target:5.3.0
Depends on: HarfBuzz
Blocks: Font-Rendering
  Show dependency treegraph
Reported: 2014-09-13 15:52 UTC by JC Ahangama
Modified: 2017-03-03 20:56 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

ODT file demonstrating the problem (25.17 KB, application/vnd.oasis.opendocument.text)
2014-09-13 15:52 UTC, JC Ahangama
Screenshot under Windows 8.1 (46.85 KB, image/png)
2014-09-13 20:05 UTC, Adolfo Jayme
Screenshot under Ubuntu 14.04 (84.08 KB, image/png)
2014-09-14 02:03 UTC, Adolfo Jayme

Note You need to log in before you can comment on or make changes to this bug.
Description JC Ahangama 2014-09-13 15:52:23 UTC
Created attachment 106217 [details]
ODT file demonstrating the problem

Problem description: 

Steps to reproduce:
1. ....Install this font: smartfonts.net/ttf/samagana.ttf
2. ....Open the attached file in Linux and Windows systems
3. ....Observe that the letters are spread out when viewed inside Windows
4. ....Copy the text in the file and put it inside Windows Notepad and view it using 'samagana' font above. You will see the text perfectly formed.

Current behavior: Font rendering is improper inside Windows

Expected behavior: The text should show correctly spaced as in my Puppy Linux and all browsers including smart phones. This is a problem with rendering of 'liga' feature of OpenFont. According to the standard, 'liga' is implemented by default. Word developer group at MS misreads this. (MS wrote the OpenType standard identical to OpenFont).
Please read this:

I have been developing fonts since 2004. The above font is an OpenFont font made for Romanized Singhala. It is a template font, not typographically nice looking. It uses the 'liga' feature of OpenFont to the extreme with thousands of ligatures (as opposed to 5 in Calibri). It works everywhere else except in Windows. 

Romanized Indic is intuitive to type and as easy as typing English. Orthographic smart fonts like 'samagana' above will eliminate digital gap in South Asia. Proper support of OpenFont affect future of Billion people.

OpenFont is implemented two ways. Some programs use the rendering engine provided by the OS. Others use rendering devices independent of the OS. Right now, recent versions of all major browsers show OpenFont fonts correctly at least for Latin-1 based fonts. The last one is Internet Explorer. Please see this web site where complex Singhala (an Indic language) is shown perfectly:

I suspect that LibreOffice depends on OS supplied rendering engine. The case is the same with AbiWord. AbiWord showed ligatures perfectly until some update to Windows ruined it. The first release of Windows 8 had MS Word showing ligatures perfectly. Then a Windows update reversed it.

I hope the above information helps developers locate the problem.


Operating System: Windows (other)
Version: release
Comment 1 Adolfo Jayme 2014-09-13 20:05:09 UTC
Created attachment 106234 [details]
Screenshot under Windows 8.1
Comment 2 Adolfo Jayme 2014-09-14 02:03:18 UTC
Created attachment 106238 [details]
Screenshot under Ubuntu 14.04
Comment 3 JC Ahangama 2014-09-14 03:49:17 UTC
Thank you Jayme.

My Puppy Linux (branched[?]from Slackware) and your Ubuntu makes the ligatures perfectly. So, my suspicion that increasingly applications depend on the OS to render fonts looks to be true. Gnumeric (a gnome project) has this identical problem.

Windows Notepad uses Uniscribe (USP10.DLL). OpenType was gradually implemented inside Uniscribe and tested on Notepad. It could be that Writer is using Uniscribe but makes wrong calls when justifying lines. Notice that the ligatures actually get constructed but spacing is incorrect. Internet Explorer 8 had this same problem and Google Chrome too to a lesser degree.

Samagana font has 2500 ligatures and constructs ligatures up to 3 levels (iterates constructing ligatures upon ligatures) needed for Sanskrit orthography, but has no problem inside Windows Notepad, all browsers, Macintosh and smart phones.

I have tried since 2004 to get MS to fix Word. In 2004 they said they won't do it as a business decision. Next two fonts I want to make are for Devanagari and Fraktur. We should preserve human history when we can. OpenFont is the perfect vehicle to liberate Indian languages and cultures along with them.

Comment 4 Urmas 2014-09-14 06:30:36 UTC
Do normal Sinhala fonts render OK on your system?
Comment 5 JC Ahangama 2014-09-14 11:30:57 UTC
Normal Sinhala?

This is by far nearest to normal Singhala. Some more ligatures are needed. (Modern Singhala is called Mishra Singhala. It mixes in Sanskrit into Singhala).

It is romanized Singhala, somewhat like Icelandic, displayed using a smart font containing substitution tables that implement Singhala and Sanskrit orthography. This is what comes closest to the way Singhala has been written for a long time. I use Rev. Fr. Theodore G. Perera's grammar book in constructing the orthography. (https://openlibrary.org/books/OL21020M/Sim%CC%A3hala_bha%CC%84s%CC%A3a%CC%84va). That book has been out of print since 1950s. Most Buddhist temples have it.

There is a deviation between written Singhala and printed Singhala because of limitations in the printing industry and the typewriter. Unicode Sinhala completely ignores the grammar and is damaging common understanding of the writing tradition. (The writing system is part of the grammar).
Comment 6 Urmas 2014-09-20 20:12:58 UTC
I will repeat the question. Are fonts like Iskoola Pota display fine on your system?
Comment 7 JC Ahangama 2015-01-26 06:57:52 UTC
(In reply to Urmas from comment #6)
> I will repeat the question. Are fonts like Iskoola Pota display fine on your
> system?


Thank you. Iskoola Pota shows well on Windows machines. It is double-byte Sinhala. Each OS has its own font that shows Unicode Sinhala. It is sort of the default font like we see Times Roman as the default font. Unfortunately, Unicode Sinhala fonts behave differently in each OS, and the standard itself is flawed and ignores grammar. (Yes, Singhala grammar starts with writing rules).

The only thing common between Iskoola Pota and my font Aruna.ttf:
is that they both show the Singhala script.

What I did was to first romanize Singhala (I spell it with a 'g'. Just bear with me. It is a habit). Romanized Singhala looks similar to a European language. That makes it acceptable in programs that were perfected over decades before Unicode. My next step was to make an Open Type font following Singhala /Sanskrit grammar. Libre Office is the best Office package out there very useful for those who are migrating to Linux. Sri Lanka is trying that and I promote it. The Science ministry there thinks favorably of my solution because of unsurmountable problems with Unicode Sinhala.

In any case, your version for Windows cannot show the text properly as you saw. It is not a problem with Singhala script or rendering rules that Unicode specifies for Unicode Singhala fonts. My font follows Open Type / Open Font rules and simply makes Singhala ligatures, about 2500 (!) of them, No browser has the problem your program displays. However, it is exactly the way MS Word behaves. IMHO, Microsoft is not the best example for rendering LATIN script. Mozilla (that used Apple as their example) is a better source for advice.

Chrome went through this stage too. You are using an older rendering engine or something like that. This is not specific to my Singhala font. I think there must be other fonts that display this problem.
Comment 8 Buovjaga 2015-04-27 19:01:44 UTC
Setting back to NEW.
Comment 9 QA Administrators 2016-09-20 09:33:54 UTC Comment hidden (obsolete)
Comment 10 Khaled Hosny 2016-11-04 12:34:06 UTC
This isn’t fixed yet, but one can disable ligatures manually now.
Comment 11 Khaled Hosny 2016-11-04 12:35:16 UTC
Sorry, wrong bug. This needs to be checked against master.
Comment 12 Khaled Hosny 2016-11-04 14:01:10 UTC
The font is hack font (assigning glyphs to unrelated Unicode characters). We do not support this, but the issue is fixed nevertheless.
Comment 13 JC Ahangama 2016-11-06 18:20:44 UTC
This issue is NOT resolved.

Please see comments 1 and 2 by Adolfo Jayme to understand the bug.

I installed the latest version of LibreOffice available ( after uninstalling previous two versions I had and even having cleared the system registry in Windows 10.

The problem exists exactly the same way. I used the '.odt' file originally submitted here for testing. Changed the solitary Greek Phi to capital L.

The situation in short is that all browsers, all Linux systems, all Macintosh systems, Windows Notepad, iPhone and Android phones plus Microsoft Excel and most importantly, Microsoft Word later than 2013 show the text perfectly.

LibreOffice is the odd girl standing out in the cold.

I see the comments went meandering into deeper and deeper abyss, which is understandable because it flowed for 3 years. That caused someone to name my request OBSOLETE.

The original font we used is 'samagana'. After some updates, we are now using the 'aruNa' font available here: http://smartfonts.net/ttf/aruna.ttf
Please use that font to test. (remember to change the Greek Phi into a capital L)

May I most humbly mention that you are not properly implementing ligatures either. This could be the root cause of the problem. Standard Ligatures are in the province of the font, not the application using the font. (MS Office Group also misunderstands it. English that MS wrote is clear in the standard).

The simple test is to use Calibri to show the word 'difficult' in a very large size inside Write and Notepad. the f+f+i ligature does not bind inside Write. This means that the fundamentals of OT standard are not understood as it applies to the SIMPLE SCRIPT used by Western European languages. 'aruNa', believe or not, is also a 'funny' rendering of the SIMPLE SCRIPT. The underlying code set is NOT complex Indic. Just look at the text in the ODT file to understand it. It is ROMANIZED SINHALA.

This is a rescue effort, an eminently successful one, for all South Asians. So, please let's give them LibreOffice overcoming the massive misunderstanding of Indic by Unicode so that they stop stealing Microsoft Windows by habit.

Thank you.

Comment 14 Khaled Hosny 2016-11-06 18:25:53 UTC
(In reply to JC Ahangama from comment #13)
> This issue is NOT resolved.

The issue is fixed in the next version of LibreOffice, 5.3, and I verified it. Please ask before re-opening.
Comment 15 JC Ahangama 2017-03-03 20:56:19 UTC
Thank you most profusely, Khaled. May I honor you with highly Sanskritized Sinhala that you are a prophet of godly wisdom (try Monier-Williams Sanskrit dictionary for aizvaryavat and ISva. Use the aruNa font to read it in the Singhala script)

khaaled aizvaryyavaþ iixvarayeki!

It was a 5-year task to hack Singhala into a Latin font and redraw 2500 hidden ligatures in it. The people say it looks like real Sinhala though not certified by Europeans. Another miracle!