Custom generated features

I was wondering if it was possible to customize the generators for the OpenType features. This would be an awesome feature (to me at least).
I often have to deactivate the automatic generation just because of one little thing that I don’t like. It would be much easier to just change the generator code instead, like we do for glyph recipes.

Thanks.

What specific thing is bothering you? What is it that you like to change?

  • In contextual alternates I like to put two things (sometimes more, depends on the font of course):
    • The automatic substitution of the colon by the ratio character if it is between two numbers.
    • Automatic capitalization of the german double S when it is between capitals.
  • In stylistic alternates I prefer to have all stylistic sets instead of just the first one.
  • I put all the precomposed fractions that I have into standard ligatures with an intelligent substitution rule.
  • I use the historical forms feature to do an automatic substitution of the long s.
  • When I have all the required glyphs I like to use Tal Lemming’s Fraction Fever 2.
  • In the superiors I often add this:
    sub hyphen by minussuperior;
    sub n by nmod;
  • In the inferiors I often add this:
    sub hyphen by minusinferior;
  • Finally in the localized forms:
    • Should’t all the serbian substitutions also apply to Macedonian? I don’t know if there is a way to name a character so that it does this automatically but there should.
    • To support Guaraní, I need a g with a tilde and since this doesn’t exist in Unicode, I add a glyph and an automatic feature that forms it from g or G with tilde or tildecomb.
    • In Dutch I do this:
      sub [iacute Iacute] [j J J.ss10]’ by [jacute Jacute Jacute.ss10];
      This is for stylistic reasons, otherwise the acute colides with the dot of the j.

I think that’s pretty much it.

[quote=“jeremie, post:3, topic:3309”]
In contextual alternates I like to put two things (sometimes more, depends on the font of course):
The automatic substitution of the colon by the ratio character if it is between two numbers.
Automatic capitalization of the german double S when it is between capitals.[/quote]

Contextual alternates are not auto-generated at all. Because there are no general rules. There where some long discussions about the Germandbls on TypeDrawers jut recently. They concluded to not do that, because it leads to wrong orthography. And the auto-colon can produce strange results, e.g. between ip6 addresses.

[quote=“jeremie, post:3, topic:3309”]
In stylistic alternates I prefer to have all stylistic sets instead of just the first one.[/quote]

That might be a problem if you have more than one alternate for the same glyph, you can have one substitution for each base glyph.

[quote=“jeremie, post:3, topic:3309”]
I put all the precomposed fractions that I have into standard ligatures with an intelligent substitution rule.[/quote]

That is not recommended.

Rename the minussuperior to hyphen.sups and it will work automatically.

nmod looks like a nsupierior but has a totally different meaning. So call it n.sups.

[quote=“jeremie, post:3, topic:3309”]
To support Guaraní, I need a g with a tilde and since this doesn’t exist in Unicode, I add a glyph and an automatic feature that forms it from g or G with tilde or tildecomb.[/quote]

You don’t need to precompose the glyphs. the mark feature will position the tilde correctly. All you need to do is to add the top anchor in the g and G and a _top anchor in the tildecomb.

That doesn’t need to be in the locl feature. That could go calt.

All that said I understand the need to be able to add stuff to the automatic feature code. I’m not sure jet how that could be implemented. The internal code is quite complicated for some features and to make a script/plugin to work alongside it might be difficult. Just adding thing will not work in a lot cases e.g. if the feature already includes substitutions for several scripts.

Better use s.hist in this case. longs has a separate Unicode. With very few exceptions, OT features are supposed to stay on the glyph level and not interfere with the characters.

This wouldn’t be a generator addition, but completely different, precomposed code. In a case like this, I do not see what is wrong with deactivating the automation and pasting this code.