bugFree UCS Outline Fonts - Bugs: bug #50982, Diacritics interrupt lam alif...


bug #50982: Diacritics interrupt lam alif ligature

Submitted by:  David Corbett <dscorbett>
Submitted on:  Tue 09 May 2017 03:30:42 PM UTC  
Category:  individual character(s) Severity:  3 - Normal
Item Group:  glyph(s) incorrect Status:  Fix posted
Privacy:  Public Assigned to:  Steve White <Stevan_White>
Open/Closed:  Open Release:  development

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Mon 21 May 2018 02:04:49 PM UTC, comment #13:

OK now we're getting somewhere. We have been laboring under different notions of what is what. This needs to be sorted out before we can continue.

For me, the vertical stem of the alef-lam ligature is the alef, and the diagonal is the lam. Without the ligature, due to the left-to-right writing direction, the lam would be to the right of the alef, but in the ligature, its stem is bent to the left so that it crosses over the stem of the alef.

I am not alone in this conception: see the illustration at the top of

A possibly related question is where diacritics should be placed over the ligature, since, as I pointed out in report #53954, some diacritics are appropriate for consonants only, and others for vowels.

A different issue is how to accomplish the placement.

The report you cite says "When marks are placed over Laam Alef ligatures in Al-Dani style, then right side stroke is considered as Alef and left side stroke is considered as Laam". This does not imply to me that there exists a style in which Alef and Laam are considered reversed in the ligature. It seems to me to be saying that the placement of the marks is in accordance with that conception -- but it doesn't mention there being some other rule for placement of the marks.

And as I see, the madda and hamza in that report are placed over the left vertical stem, which would be consistent with that being the alef. The Unicode samples show those accents over the rightmost diagonal stem in some ligatures.

At the same time, other fonts I have looked at place all applied diacritics over the leftmost, vertical stem in the ligature -- although they too contain the Unicode ligatures that incorporate the U+0653 madda over the left diagonal stem.

It's still unclear to me what's going on. Do we really have two different styles of diacritic placement for this ligature?

I see from your example that FreeFont is behaving in a different way from other fonts -- although the madda can placed over the vertical stem by use of proper encoding, and over the diagonal stem by a different encoding, there isn't any way to place fatha over the diagonal stem, where it should be assuming that is the consonant in the ligature
data:text/html;charset=utf-8,<div style="font: 200px FreeSerif">%D9%84%D9%93%D8%A7 %D9%84%D8%A7%D9%93 %D9%84%D9%8E%D8%A7 %D9%84%D8%A7%D9%8E</div>

OK, I'll consider how your lookup settings will achieve that.

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Mon 21 May 2018 01:12:55 PM UTC, comment #12:

Actually, in most fonts, and in the Unicode code charts, the top of the lam is on the right and the top of the alef is on the left. The reverse convention is used in Al-Dani Quranic notation (page 8 of L2/16-056) but is not appropriate for a general-purpose font.

David Corbett <dscorbett>
Mon 21 May 2018 10:24:37 AM UTC, comment #11:


I am utterly confused about the placement of the diacritic. See report #53954. Other fonts place some diacritics of the lam-alef over the alef part, while the standard shows some ligatures containing diacritics with the diacritic placed over the lam.

Also, when you made your comment, I had not yet committed the change to put the diacritic anchor over the alef part -- it was placed over then lam. Yet you say that at the time the diacritic appeared over the alef! That is: as of today, the diacritic does appear over the alef (right or wrong) but yesterday it was over the lam.

You do understand that in the ligature, the lam is the diagonal line, whose top is to the left, and the alef is the vertical line, whose top is to the right, don't you?

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Mon 21 May 2018 01:45:59 AM UTC, comment #10:

That is the first part of the fix; it still needs a MarkToLigature lookup. The diacritic between the lam and the alif should be positioned relative to the lam, but it is now positioned relative to the alif.

Compare lam + fatha + alif to lam + alif + fatha. They should not look identical.

data:text/html;charset=utf-8,<div style="font: 200px FreeSerif">%D9%84%D9%8E%D8%A7 %D9%84%D8%A7%D9%8E</div>

David Corbett <dscorbett>
Sun 20 May 2018 07:42:47 PM UTC, comment #9:

Hi David.

I finally just set the IgnoreMarks flag on the ligature lookups. It had an effect that sounds like what you wanted. Have a look!
(Sorry again for the delay getting back to this stuff.)

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Sun 19 Nov 2017 09:00:25 PM UTC, comment #8:

Because FreeFont implements i’jam with mark glyphs, lam–alif ligatures are not formed if the lam has i’jam, as in ⟨ڶا⟩.

David Corbett <dscorbett>
Tue 23 May 2017 06:55:20 PM UTC, comment #7:

You can read about IgnoreMarks and other flags in the OpenType spec. https://www.microsoft.com/typography/otspec/chapter2.htm says, “For example, in Arabic text, a character string might have the pattern base mark base. That string could be converted into a ligature composed of two components, one for each base character, with the combining mark glyph over the first component. To produce this ligature, the font developer would set the IgnoreMarks bit of the ligature substitution lookup to tell the client to ignore the mark, substitute the ligature glyph first, and then position the mark glyph over the in a subsequent GPOS lookup.” The spec is often unclear, but this is one of the well-written parts.

I found https://sourceforge.net/p/fontforge/mailman/message/6164906/ helpful when making a proof of concept in FontForge.

https://github.com/search?utf8=%E2%9C%93&q=baselig+extension%3Asfd provides plenty of examples of what the SFD should look like.

That’s basically all you have to do: read the spec and consult prior art.

David Corbett <dscorbett>
Tue 23 May 2017 04:02:37 PM UTC, comment #6:

David, who are you who are so wise in the ways of fonts?

You know, I've spent a lot of time experimenting with the IgnoreMarks (etc) flags. The Fontforge doc and the MS Typography sites are unhelpful as to how it's supposed to work -- the Fontforge doc lauds its usefulness for Arabic, but really says nothing about how it's supposed to work.

And I have thought those things might be useful in other scripts, but so far, I have seen them do only useless things. I don't get it.

Where do we read about this?

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Tue 23 May 2017 02:41:42 PM UTC, comment #5:

Here is how to make this work. On the lookup that creates the lam+alif ligature, set the IgnoreMarks flag. Create a MarkToLigature GPOS table. For every Arabic anchor, e.g. "arab-above", define a MarkToLigature counterpart, e.g. "arab-above-lig". Define "baselig" anchor points for these new anchors on lam+alif; since that ligature has two components, that means two anchor points above and two anchor points below. Define "mark" anchor points for these new anchors on mark glyphs; for example, any mark glyph with an "arab-above" anchor point should have an "arab-above-lig" anchor point at the same coordinates.

David Corbett <dscorbett>
Tue 23 May 2017 05:39:03 AM UTC, comment #4:

Update: I haven't even figured out how it is possible to implement the feature as stated in the standard. Changing the order of glyphs is a very tricky business in OpenType, which, as far as I know, can be done only on a case-by-case basis.

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Tue 23 May 2017 01:31:32 AM UTC, comment #3:

This bug does not just apply to lam+alif, though that is the most important case: it applies to all Arabic ligatures. For example, in FreeSerif, ⟨تم⟩ uses the ligature glyph teh_meemisol.lig, but adding a vowel mark as in ⟨تَم⟩ breaks the ligature.

David Corbett <dscorbett>
Mon 15 May 2017 04:45:56 PM UTC, comment #2:

See The Unicode Standard 9.0, chapter 9, section “Ligature Rules”, rule L1.

David Corbett <dscorbett>
Mon 15 May 2017 02:40:01 PM UTC, comment #1:

I am surprissed that it is correct to put diacritics between two letters to be ligated. Where do I read about that?

Steve White <Stevan_White>
Project AdministratorIn charge of this item.
Tue 09 May 2017 03:30:42 PM UTC, original submission:

In FreeMono and FreeSerif, Regular and Bold, diacritics prevent a lam and an alif from ligating.

data:text/html;charset=utf-8,<div style="font: 300px FreeSerif">%D9%84%D9%8E%D9%91%D8%A7

David Corbett <dscorbett>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by Stevan_White (Posted a comment)
  • -email is unavailable- added by dscorbett (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-20 Stevan_White StatusNeed info => Fix posted
    2017-05-15 Stevan_White StatusNone => Need info
        Assigned toNone => Stevan_White

    Back to the top

    Powered by Savane 3.3