I’m trying to use the Replace Feature custom parameter to swap contextual GPOS code (Indic ABVM feature) and it doesn’t seem to be working.
Note: I’m using the # Automatic Code End keywords (but omitting this doesn’t change the result)
in the ABVM feature I have the following code:
# Automatic Code End
lookup contextual_positioning {
pos iMatra-deva base j_ja-deva <anchor 250 250> mark @mark_top';
} contextual_positioning ;
in the Replace Feature parameter of a lighter instance I have:
abvm;
# Automatic Code End
lookup contextual_positioning {
pos iMatra-deva base j_ja-deva <anchor 300 300> mark @mark_top';
} contextual_positioning ;
I’ve tried using Wei’s method of using external .fea files and using the Replace Prefix and include options but this puts the lookup in the beginning (thus getting overwritten by the auto-generated ABVM code) despite me using # Automatic Code End. Also, for the include method I need to specify markClass which may be affecting the order?
This has no effect, the positioning is the same as in every other instance.
@sovichet did you manage to solve your case? Did you try without the Khmer script tag? I noticed also you don’t have the feature tag mark; on your first line.
There’s indeed something very fishy going on. I want to write default positioning values for the regular master, but then add different values for the other weights. In this particular situation (doublemacroncomb + Thai marks) I need to add the Thai script tag to the lookup or nothing happens at all.
If I put the positioning into the mkmk feature, with an # Automatic Code End statement, it works in the regular weight, but when I replace with a custom parameter to adjust those values in the Black master, the Regular values are still used.
If instead I put the positioning into the dist feature, and have the custom parameter to replace it in the other weights, (removing the # Automatic Code End statement, because there is no automatic dist code), only one of the rules is applied in the Regular and Black, and all other contexts are ignored.
Did you try this approach? For what it’s worth, i’ve never gotten this to work. I ended up using fontmake with replace feature custom parameter at master-level (unsupported by Glyphs, but supported by GlyphsLib with the added advantage of the values interpolated automatically for intermediate instances.
Maybe try it out? Let me know if you’re running into issues.
Thanks Kalapi, will try this idea. I already tried putting each instance’s positioning rules in a separate lookup in a prefix and then calling the correct one using ReplaceFeature, but unfortunately that didn’t work. @GeorgSeifert is there a way you can advise, or fix the ReplaceFeature mechanism in G2?
This is working beautifully, thank you. One request, could the colour coding work the same way as in the main features panel? Much easier to work with when the keywords turn blue.
Okay I was able to debug this. Then using the # Automatic ... tag with the dist feature, if a script tag is included, Glyphs fails to include the lookups. If there is no scripts tag, the lookups will be added to all scripts (which I think is still a bug, but it doesn’t affect the work i’m doing now so should be fine).