Custom parameter to inject code into existing feature

I know there is an Add Feature and Replace Feature, however, I am wondering if it possible to have a custom parameter where a user can manually can add some snippets of code then have it injected into an existing feature.

For example, say I wanted to have snippets like this in the CPs of instances then have it be injected/added into the CALT feature.

Light
**pos** T [period comma] quoteright' <100 0 100 0>;

Regular
**pos** T [period comma] quoteright' <50 0 50 0>;

Bold
**pos** T [period comma] quoteright' <25 0 25 0>;

  1. Is this possible now or useful to add?
  2. In a case like this, would it also be possible to use Number Values as tokens ( pos T [period comma] quoteright’ <$shft 0 $shft 0>; ) ?
  3. Or, is there a better way to achieve to be able to control the values at specific instances.

I tried something like this like this
pos T [period comma] quoteright’ <100 0 100 0 (wght:100) 50 0 50 0 (wght:500) 25 0 25 0 (wght:800)>;

but was getting these types of errors

Expected x placement value
Expected y placement value
Variation position overrides origin position

This is possible when exporting static instances, but not for variable fonts.

This is possible for variable fonts, but not when exporting static instances. However, there is an issue with your code: There is no location at the end, so the (wght:800) must be removed. Each (…) location is written before its values. The first set of values is using the origin location.

Have a look at the Handbook for details:

Ah I see so if Origin is Regular 500 then that is put first and the (…) is omitted. Then for the same to happen in statics, a Number Value variable can be added to the masters and then a separate piece of code is added using that number value variable.

  1. Would this be the correct order with variable first then static?
  2. With variable portion wrapped with ifdef VARIABLE #endif?

Aside: In the future, what do you anticipate the formatting will produce the same result for variable and static using one piece of code.

#variable
#ifdef VARIABLE
pos T [period comma] quoteright' <
    0 50 0 50 0 
    (wght:100) 100 0 100 
    (wght:800) 25 0 25 0
>;
#endif

#static
pos T [period] quoteright' <$shft  0 $shft 0>;	

Ok I got something working with Latin but a similar thing isn’t working when it is Armenian.
Any idea what might be the issue?

#Latin
pos T [period] quoteright' <
    200 0 200 0
    (wght:40) 500 0 500 0
    (wght:135) 100 0 100 0
    (wght:220) 50 0 50 0>;

#Armenian
pos men-arm [period] quoteright' <
    200 0 200 0
    (wght:40) 500 0 500 0
    (wght:135) 100 0 100 0
    (wght:220) 50 0 50 0>;

Did you check what script/language tags you need?

I remember there is some tricky stuff with getting language tags to work.

Tried adding Armenian tags in language systems but I fear it might not be as simple as that.

languagesystem DFLT dflt;
languagesystem latn dflt;
languagesystem armn dflt;
languagesystem armn HYE;

Won’t veer this topic off anymore than it already has.

You also need to add “script armn” next to the pos statement.

Tried all sorts of combinations with script armn, language HYE/dflt…etc. but still not working.

#ifdef VARIABLE
pos T [period] quoteright' <
    200 0 200 0
    (wght:40) 500 0 500 0
    (wght:135) 100 0 100 0
    (wght:220) 50 0 50 0>;

#script latn;
script armn;
#language HYE;
#language dflt;
pos men-arm [period] quoteright' <
    200 0 200 0
    (wght:40) 500 0 500 0
    (wght:135) 100 0 100 0
    (wght:220) 50 0 50 0>;
#endif

Tried placing in a lookup.

lookup armn_test_1 {
    script armn;
    pos men-arm [period] quoteright' <
        200 0 200 0
        (wght:40) 500 0 500 0
        (wght:135) 100 0 100 0
        (wght:220) 50 0 50 0>;
} armn_test_1;

Should I start a new topic?

Realized what I was missing. Okay got it to work.
Thanks!