Contextual Alternates (calt) with marks, possible?

Hi Type Professionals !

I am working on a book for children with colored diacritics using InDesign GREP style as it doesn’t support CPAL/‌COLR, my problem is that I have custom glyphs with marks inside it, and I used the Contextual Alternates (calt) feature to generate my custom glyph and I correctly placed anchors on the ligature. The desired glyph I want is like this:

I used the OT code like this:

lookup Ligature1 { # GSUB lookup type Ligature
    lookupflag RightToLeft;
    sub waw-arab arabicfathacomb alef-arab arabicfathatancomb by waw_arabicfathacomb_alef_arabicfathatancomb-arab.calt;
} Ligature1;

I can’t use the Ligature (liga) feature because in my case this custom glyph occurs only with specific marks on the two combined letters.

My question is, can I show the marks on Contextual Alternates (calt)?

Here’s my font with minimal glyphs to demonstrate my issue:

Thank you so much :folded_hands:

It must be with the IgnoreMarks flag then. If the marks disappear, something else is wrong. Can you please send me the .glyphs file to support (at) (this website without ‘www’ or ‘forum’). I will have a look.

1 Like

Thank you so much, the IGNORE MARKS on the Contextual Alternates (calt) makes it impossible to show the anchored diacritics on the custom glyph, it is an OT behavior not GlyphsApp, that’s why I asked if there’s a work around.

Why do you need that custom glyph? If you use a precomposed ligature, you can’t use GREP in Indesign. You might do the opposite by decomposing all marks and rely on mark positioning.

But it supports SVG. So you should still be able to add color.

1 Like

The custom glyph i need occurs only with specific marks on the two combined letters, decomposing all marks using the Ligature (liga) feature in my case doesn’t help, it will replace the ligature every time those two letters occur, while the custom glyph occur with specific diacritics on them only.

And sadly, SVG support breaks diacritics on Arabic text in InDesign, also makes it difficult to deal with long text frames.

If you can use alternate glyphs instead of ligatures, that can make things simple:

lookupflag 0;
sub waw-arab' arabicfathacomb alef-arab arabicfathatancomb by waw-arab.calt;
sub waw-arab.alt arabicfathacomb alef-arab' arabicfathatancomb by alef-arab.calt;

If you really need a ligature, you can ligate the alt glyphs after that:

lookupflag IgnoreMarks;
sub waw-arab.calt alef-arab.calt by waw_alef-arab.calt;

This way, the marks are kept as separate glyphs, but the ligature is formed only when the specific marks are involved.

(BTW, lookupflag RightToLeft; has no effect except in cursive attachment lookups, so you don’t need to set it here.)

4 Likes

Dr. Khaled thank you so much for the valuable input, I will test the code and see the result, infact the huge problem that in OpenType there might be no consideration that in Arabic we may need a custom glyph of bases+marks together but with marks appear on the glyph same way as in (liga), the problem in OpenType is that whenever you involve a mark in a trigger that marks will be invisible in the custom glyph like in (calt) feature.

The trick is to not include the marks in the ligature, so just waw_alef-ar. They attach with ligature anchors top_1 and top_2.

2 Likes

Thank you @mekkablue for your contribution, in my case this ligature happens only when the marks are involved!, they trigger like this: Base+Mark+Base+Mark=Ligature, that’s why it is a huge problem!

Dr. @khaled you are a savior! You saved the children book I am working on! Now I can freely use the GREP styling in InDesign with ZERO worries in coloring the diacritics!. What an extraordinary help at the heart of Arabic typographic engineering! You are a master!. My gratitude :folded_hands:

1 Like