How do Glpyhs manage the diacritics for alternate characters? for example I got a and a.ss01. I cant get it working to have a.ss01 acute? is that automatic?
An /a with an acute should be named aacute so you would need an aacute.ss01.
ah, its a manual process… ok, thanks!
You could separate the base glyph and the accent in the ccmp feature. Then you only need the alternate base glyphs. This approach is very convenient but not working everywhere or need some special setting (you need to activate the World Ready Composer in Indesign).
I’m having a similar situation
Aiming to create different design for a few marks/diacritics that are supposed only to appear over specific class of SWSH glyphs. (called lettersLongMarks)
Trying via CALT and SWSH features
it results those specific marks overwrite all text when choosing the relevant OpenType feature.
lookup lettersLongMarks {
lookupflag RightToLeft;
lookupflag 0;
sub @lettersLongMarks fatha-ar' by fatha-ar.swsh;
sub @lettersLongMarks shadda-ar' fatha-ar' by shaddaFatha-ar.swsh;
sub @lettersLongMarks damma-ar' by damma-ar.swsh;
sub @lettersLongMarks dammatan-ar' by dammatan-ar.swsh;
sub @lettersLongMarks shadda-ar' fatha-ar' by shaddaFatha-ar.swsh;
sub @lettersLongMarks shaddaFatha-ar' by shaddaFatha-ar.swsh;
sub @lettersLongMarks shadda-ar' damma-ar' by shaddaDamma-ar.swsh;
} lettersLongMarks;
By-now I can only activate this feature manually to the targeted glyphs in order to get the sought result.
Wondering if any suggestions to resolve it.
The last attempt … was another class ( @targetMarks) integrated with UseMarkFilteringSet
Did not work also ! ![]()
When you want marks to be substituted in swsh feature, with or without context, you can just write that in swsh feature. If the contents of @lettersLongMarks are supposed to be a .swsh variant of a letter, just put those in swsh.
If this is supposed to happen automatically, calt/swsh is not the ideal feature.
Also, the lookupflags are best used within a lookup (no hard rules, but it makes your intention clearer in my opinion).
Having said all that, I think your calt/swsh code:
@swashMark_0 = [fatha-ar damma-ar dammatan-ar sukun-ar shaddaFatha-ar shaddaDamma-ar shaddaDammatan-ar];
@swashMark_1 = [fatha-ar.swsh damma-ar.swsh dammatan-ar.swsh sukun-ar.swsh shaddaFatha-ar.swsh shaddaDamma-ar.swsh shaddaDammatan-ar.swsh];
lookup swashMark {
lookupflag RightToLeft;
sub @lettersLongMarks @swashMark_0’ by @swashMark_1;
} swashMark;
Your code didn’t work probably because you didn’t add ’ to the marks in SWASH_MARK_REPLACEMENT lookup, but I think it’s ultimately unnecessary to have a separate lookup like that.
and you don’t need lookupflag RightToLeft;. And remove the script arab, too.
Just tested with a few software
It is giving the same above results:
@swashMark_1 dominates all text
not only the class @lettersLongMarks.
Toshi’s sample should work correctly and only substitute in the context of what you have in @lettersLongMarks. What lookup did you place the code in?
For your original attempt with the two lookups split apart, you may need change the lookup heading line to:
standalone lookup SWASH_MARK_REPLACEMENT {
Without it, the first looup is treated as part of the feature and all marks get substituted. When you add standalone the first lookup isn’t processed as a “feature” per se, but only accessed when called by the function below. The other option is to remove standalone and put this section in the Prefix area of the OT, where the keyword isn’t necessary. I do think Toshi’s suggestion of having all in one is easier to manage in this case.
Thanks @Aida @Tosche @GeorgSeifert @mekkablue
for your assistance;
Eventually I tried all options
the “Standalone” literally eliminated the CALT feature ! (Calt shows dimmed on OpenType menu on Adobe Illustrator & Indesign)
It worked for me only when repeating the code in both SWSH & CALT features:
lookup diacriticsSwash {
sub @lettersLongMarks dammatan-ar’ by dammatan-ar.swsh;
sub @lettersLongMarks fatha-ar’ by fatha-ar.swsh;
sub @lettersLongMarks damma-ar’ by damma-ar.swsh;
sub @lettersLongMarks shaddaDammatan-ar’ by shaddaDammatan-ar.swsh;
sub @lettersLongMarks shaddaFatha-ar’ by shaddaFatha-ar.swsh;
sub @lettersLongMarks shaddaDamma-ar’ by shaddaDamma-ar.swsh;
sub @lettersLongMarks sukun-ar’ by sukun-ar.swsh;
} diacriticsSwash;
Obviously with different lookups !
Not sure why that is.
But you can repeat a lookup. In the first feature, you put the full lookup lookup diacriticsSwash {…} diacriticsSwash, and in the second you put this like lookup diacriticsSwash;`.
The diacriticsSwash lookup needs to be applied after the swsh feature lookups are applied, but calt lookups are always applied before lookups of user-enabled features (i.e. features that are not enabled by default, like swsh).
One way to fix this is to put the diacriticsSwash lookup in a feature that does not have a fixed application order (I usually use rclt) and make sure the lookup is defined after swsh lookups. Another option is to put the lookup in swsh feature after the lookup that substitutes the base glyphs.

