Multiple Substitution Without Being Merged?

Hello

I want to break the ‘ARABIC LETTER ALEF WITH MADDA ABOVE’ (U+0622) so as I can get ALEF and MADDA both seperated into their constituent glyphs (base and mark).

In Unicode this letter is consisted of one character (integrated Alef with Madda):

IMG_20260115_050304

So I substituted the glyph ‘AlefWithMadda’ with glyphs ‘Alef’ and 'Madda’, using the lookup Multiple Substitution (decompose), but the result comes in another ‘Merged’ character, so what’s the method to have the substitution result in two separated glyphs (base and mark) without being merged?.

Thanks

I just tried and it seems to work fine:
I put this in ccmp:

sub alefMadda-ar by alef-ar madda-ar;

and get this in FontGoggles:

How do you test. Make sure to read Eliminating font cache problems | Glyphs
and Testing your fonts in Adobe apps | Glyphs

1 Like

Decomposing alef’s in ccmp should work fine indeed, many fonts do this already.

1 Like

@GeorgSeifert , @khaled Thank you for mentioning ccmp however the substitution result still in one merged glyph :roll_eyes:

I tested it in both Adobe InDesign and MS Word, and here’s the font test:

FontTest.ttf (1.8 KB)

The test font works fine in FontGoggles and Indesign for me.
Did you read the tutorials I posted above?
Indesign:

FontGoggles:

1 Like

Hi @GeorgSeifert

Visually it works but I can’t change the color of the mark, the two glyphs ( alef, madda) when selected behave as one clust in InDesign and MS Word :worried:

You can’t change the styling of individual glyphs after substitutions. The text selection only knows about the characters, not the glyphs.
If you like to have different colors, you need a color font.

1 Like

For something that has Unicode decomposition like alef with madda above, you can use the decomposed form in input text i.e. instead of inputting U+0622 you input U+0627 + U+0653. But, since the two forms (composed and decomposed) are canonically equivalent in Unicode, the decomposed form can get composed again at any stage of the text processing, and to prevent that you need to insert U+034F (combining grapheme joiner) between the two. In other words, copying and using this “ا͏ٓ” should give you two glyphs that can be colored independently without any changes to the font:

If there is no Unicode decomposed form, then, like George said, you can’t style individual glyphs after substitution, since the styling is applied per input characters.

1 Like

Dr @khaled thank for the idea of adding this magic combining grapheme joiner that it’s the first time I heard of, and as you and @GeorgSeifert thankfully confirmed that there’s no possibility to change the style of decomposed glyphs, and taking into consideration that the character in question will get back in its Unicode format whenever copied again, so I don’t have but to FIND AND REPLACE in despite I work on a children book with colored diacritics that goes back and forth for reviewing all the times, so I got replace again and again… I wish oneday in OpenType they give us the possibility of styling multiple substitution results individually.

Thank you all for your generous assistance.

This is a really good use case for a color font. Then all diacritics have their color automatically.

1 Like

Sadly, InDesign doesn’t support CPAL/CLR only SVG color font which doesn’t support Arabic very well, the diacritics get badly corrupted and dispositioned in OTF-SVG in InDesign. And until now Adobe doesn’t want to support Microsoft CPAL/CLR Layered Fonts :worried:

SVG color fonts are regular OpenType fonts. They are not the old svg fonts you might have heard about. So you can build proper arabic color fonts.

1 Like

Your reply made me discover something very serious! InDesign 2025-26 doesn’t support OTF-SVG Arabic fonts when it comes to color diacritics nor even regular OTF/TTF!! Now I am testing InDesign 2020 and I think things are working well !!! This is clearly A BUG in newest InDesign versions concerning adding colors to Arabic diacritics whether inside InDesign itself (GREP) or OTF-SVG colors!!.

InDesign handles Arabic fonts with SVG table in a very buggy way, all anchor attachments (whether mark or cursive) are messed up. It effects even monochromatic glyphs in the font (all you need is to include and SVG table in the font, even if it has no glyphs). I reported it to Adobe on multiple occasions, but it hs not been fixed so far.

See:

Maybe if people would upvote the issue, it would get some attention. For a while it seemed like I’m the only person whoever tried Arabic fonts with SVG table in InDesign.

I used to include SVG table as fallback for COLR table, but now since Illustrator and Photoshop support COLR table, and its handling in InDesign is so buggy, I don’t include it anymore.

2 Likes

Uff.

@khaled i also noticed that in InDesign 2025-26 when adding color to diacritics using GREP replace using regular fonts (not SVG), the marks are all gone wild when exported to PDF, and sometimes this error occur when export more than a page to PDF:

But this doesn’t happen in InDesign 2020, even now I am experiemting with SVG fonts and they work very well, I will try long text documents and export to PDF to see. So the problem might be recent in new InDesign versions.