(Opentype) One to many substitution

Tosche's picture

Hi everyone,

I'm trying to write a Opentype code with one-to-multiple glyphs, but Fontlab and FDK won't compile it.
For example, I want to substitute ß by a couple of smallcap S in smcp feature, and I want to make SS separate (spacable, kernable or whatever). Some fonts have smallcap counterpart of ß as SS as a single glyph, but obviously you cannot space it.

There are some other characters that I want to apply this substitution, I really want to figure out how to do it (or whether it is possible or not). I also heard that Adobe apps including FDK do not support this substitution but Microsoft apps do. Is it correct?

I would like to know whatever you know about this.

Thank you.

twardoch's picture

Adobe FDK for OpenType 2.5 should do it fine. Just tested it, works fine.

twardoch's picture

Ps. If you want to make sure that something reasonable will happen in applications that do not support it, you can do the following:

feature smcp {
lookup smcp1 {
sub germandbls by germandbls.smcp;
...all the other smcp substitutions...
} smcp1;
lookup smcp2 {
sub germandbls.smcp by s.smcp s.smcp;
} smcp2;
} smcp;

This way, OpenType engines will have two passes at your text. The first step will replace germandbls with a ligature version of small-cap "ss", which you of course do need to include in your font in that situation, and the second pass (i.e. the second lookup) will replace that one with two small-cap "s"es, but this lookup will be ignored if an application doesn't support one-to-many. So in the newer apps, you'll get two small-cap "s"es, and in older ones, you'll get the "ss" small-cap ligature. An acceptable compromise, I think.

Best,
Adam

Tosche's picture

Thanks Adam, it works! (Why couldn't I solve such a simple problem?)
I do agree that the two-step substitution is a good compromise.

Also, I want to have a stylistic sets that substitutes Arabic figures by Roman figures.
This time FDK refuses to generate otf for sure, saying "Unsupported contextual GSUB replacement sequence".
(If I remove Two Digits section, it works.)
By the way, I do understand such an usage is strongly discouraged, but I want to understand why it doesn't work.

@figures=[zero one two three four five six seven eight nine];

feature ss02 {

#Two digits
sub one zero by Tenroman;
sub one one by Elevenroman;
sub one two by Twelveroman;
sub one' [four five six seven eight nine] by Tenroman;
sub two' @figures by Tenroman Tenroman;
sub three' @figures by Tenroman Tenroman Tenroman;
sub four' @figures by Fiftyroman Tenroman;
sub five' @figures by Fiftyroman;
sub six' @figures by Fiftyroman Tenroman;
sub seven' @figures by Fiftyroman Tenroman Tenroman;
sub eight' @figures by Fiftyroman Tenroman Tenroman Tenroman;
sub nine' @figures by Tenroman Hundredroman;

#One digit
sub one by Oneroman;
sub two by Tworoman;
sub three by Threeroman;
sub four by Fourroman;
sub five by Fiveroman;
sub six by Sixroman;
sub seven by Sevenroman;
sub eight by Eightroman;
sub nine by Nineroman;

sub zero by zero.ghost;
} ss02;

Tosche's picture

Wait, is that because I sould not mix different types of substitutions without specifying each lookups?

Also, the germandbls.smcp is not replaced with two "S.smcp"s in InDesign.
Is there absolutely no way to do it in Adobe Apps?

oldnick's picture

Is there absolutely no way to do it in Adobe Apps?

Ummm...why not simply create an S_S.smcp glyph and be done with the two-pass-on-worky-in-iD song-and-dance?

Tosche's picture

@oldnick I don't know what two-pass-on-worky-in-iD song-and-dance means, but I want those SSes to be spacable or kernable.

@riccard0 Thanks, that solved all the question I had (probably). I still cannot find the way I originally wanted, but the Arabic-to-Roman numeral substitution with full spacability seems impossible at this point.

twardoch's picture

Tosche,

yes, each lookup must be of one particular kind. So all substitutions of one particular type can be in one lookup, but if you have one non-contextual and one contextual sub, they need to be in different lookups. That's how OpenType Layout works.

oldnick's picture

I want those SSes to be spacable or kernable

So, place the S_S.smcp ligature in your s.smcp class...

eliason's picture

I think he means the space between the /S/s.

Tosche's picture

I think he means the space between the /S/s.
Yes, that's what I meant. As far as I learnt there's nothing I can do with it.
Many thanks to everybody who contributed to this topic.

Syndicate content Syndicate content