Multiple substitutions without decompose?

Hello

I want to substitute letter ‘R’ with letters ‘r’+'h’, this can be done with the lookup Multiple Substitution (decompose) in the OpenType Designer, but the result comes in one ‘Merged’ character in MS Word, how can I make the substitution result separated as regular characters? (i.e: r & h each one independent NOT rh merged).

Thanks

A Multiple Substitution should output two separate glyphs (e.g. r and h). FontCreator will export it that way.

If MS Word shows it as one “merged” unit, that usually means there is also a ligature substitution (e.g. r h → rh) or another lookup that ends up combining them again. Please check your liga / dlig / rlig (and any contextual features like calt) for an r+h ligature, and also verify the lookup order in the OpenType Designer.

If you can share a reduced FontCreator project that reproduces the issue (just the relevant glyphs and OpenType features), we’ll be happy to take a closer look and point out what causes Word to merge it.

1 Like

Thank you @ErwinDenissen for your reply, in my situation the substitution is still result in one merged glyph not two separate glyphs :roll_eyes: and here is a test font :

FontTest.ttf (1.8 KB)

Obviously I made substitution using ccmp:

lookup MultipleSubstitution {
  lookupflags RightToLeft;

  sub "alefmaddaabove-arab" -> "alef-arab" arabicmaddahcomb;
}

In your case the input is one character (alefmaddaabove-arab), but your ccmp rule decomposes it into two separate glyphs (alef-arab + arabicmaddahcomb). So the shaping engine really does draw two individual glyphs, as intended by your OpenType features.

However, word processors like MS Word typically handle the caret/selection by character clusters (a base plus any combining marks). So when you move the cursor or select text, it will often behave as if it’s “one unit”, even though it is rendered using separate glyphs.

So what you’re seeing in Word is normal behavior: separate glyph rendering, but clustered editing/navigation.

1 Like

Thank you @ErwinDenissen for the great technical information you provided, so to understand in my little tech knowledge, the Multiple Substitution (decompose) doesn’t produce seperate characters in real only visually? i.e. no possibility to change the color of one of them?

Yes, exactly: a Multiple Substitution/decomposition changes what glyphs are drawn, but it does not change the underlying text into two separate characters. So in Word you typically can’t color just one of the decomposed parts, because formatting is applied to the original character/cluster.

If you want different colors, one option is to make a color font in FontCreator (COLR or SVG color) so the font itself defines the colors for the base and mark.

1 Like

@ErwinDenissen thank you again for the comprehensive information. The only obstacle is that Adobe until now doesn’t want to support Microsoft CPAL/CLR Layered Fonts and I mainly use InDesign, and OTF-SVG doesn’t support Arabic diacritics very well, they get disposed and corrupted.

Yes, unfortunately color-font support is still pretty fragmented across apps. InDesign currently doesn’t handle COLR/CPAL (Word does), and OTF-SVG can indeed be problematic for Arabic (there are known reports of shifting/corrupted positioning).

The good news is: for Arabic diacritics you usually don’t need a color font at all. Your approach (decompose in ccmp + position in mark) is the “correct” OpenType way, and InDesign actually has a built-in option to color Arabic diacritics separately:

  • In InDesign go to Edit → Find/Change
  • In the Query dropdown choose “Change Arabic Diacritic Color”
  • Set the desired color and apply

So the practical workaround is: keep the font as a normal (non-color) Arabic font, and let InDesign apply diacritic coloring.

See at the bottom of this page:
https://helpx.adobe.com/indesign/using/arabic-hebrew.html

1 Like

This is very useful for all the diacritics BUT the problem is with the letters Arabic Letter Alef with Madda Above “آ” (U+0622) and Arabic Letter Alef with Hamza Above “أ” (U+0623) their diacritics are integrated and can not be colorized using GREP find/change in InDesign :roll_eyes: that’s why I tried with the lookup Multiple Substitution (decompose) with no avail :pensive_face: