Completely Contextual Typeface pt. 02

Ok, I must be doing something wrong, or probably going about this the wrong way.

I’d like to have a typeface where every character is dependent on the character that precedes, or follows it.

I’m beginning very simply - just two characters ‘A’ and ‘O’.
In addition to ‘A’ and ‘O’ I have made these .alt:
AL.alt <-(A left side)
AR.alt <-(A right side)
OL.alt <-(O left side)
OR.alt <-(O right side)
AROL.alt <-(A right side, O left side)
ORAL.alt <-(O right side, A left side)
OROL.alt <-(O right side, O left side)

in Features, under calt I have this code:
sub A by AL.alt AR.alt;
sub O by OL.alt OR.alt;
sub AR.alt OL.alt by AROL.alt;
sub OR.alt AL.alt by ORAL.alt;
sub OR.alt OL.alt by OROL.alt;

when I type:
AOAOOA (with contextual alternates turned on in the viewer)
i get this:

but when I type that same string in either Illustrator or InDesign (with contextual alternates on by default) the alternates aren’t being substituted…

I’m sure I’m doing something wrong, or there is an easier way to do this.

thank you in advance

In Illustrator and Indesign, you need to activate the “World Ready Composer”. The normal composer doesn’t support one to many substitutions.

Thank you for the tip @GeorgSeifert . I didn’t know about World Ready Composer.

I’m looking into how to activate it - I’m in Illustrator CC 2018. is it as simple as checking these two boxes, under ‘Language Options’?


The other question I have, before I really start to get into this, is do you think this is something Glyphs, or Adobe products can handle?

If I separate each letter (26 English capitals only, at this point, for the sake of simplicity) into two halves, then do substitutions based on letter combinations, i think i’m getting into 52 x 52 combinations - somewhere around 2704 substitutes + lines of code.

and, while I’m at it, would you know of an easier way, in terms of the scripting part of it, to do this?

again, thank you in advance, I really appreciate the help.

You might like to use classes. I’m not sure what exactly you are trying to do but you shouldn’t need 2700 lines of code. Read the feature tutorials (all four):

I have read the tutorials on substitutions, but I’ll read them again. Maybe I’m just thinking about what I’m trying to do in the wrong way. What I’m trying to avoid is making ligatures for every word.

This is what I’m trying to achieve:

Your tip on the ‘World Ready Composer’ seems to do the trick, so in any case, as long as Adobe or OT can handle many lines of substitutions I think I should be good to go…

thank you again

How do the individual pieces look? And how many pieces do you have?

You should be able do to something like this:

sub [all possible pieces before] [pieceA pieceB pieceC]' by pieceA.alt1 pieceB.alt1 pieceC.alt1;

heheh, that’s the thing, all I have right now are a bunch of letters drawn in illustrator, and an idea…

I’m thinking the pieces would look like this:

x the whole alphabet. then, I’d do a substitution between the halves, so each letter combination would have a ‘ligature’ of the two halves. Does that sound feasible to you?

Ideally I’d like to do upper/lower/figures/punctuation, but I’ll just start with the caps for now…

Then you need a lot letters. Probably 676 (26*26).

And use different names:
A A.left A.right O O.left O.right A_O O_A

1 Like

yes, ok, i’m willing to do the work, for sure. i think the idea is fun enough.

so in my Features, would I have one that is cleft (contextual left) and cright (contextual right)?

You will end up with a lot ligatures and not much contextual stuff. But maybe you can find solutions that can be used in different places. So D.right and O.right might look the same. And depending where you cut, all glyphs with a flat stem on the left might share a glyph, too.

I am pretty sure the process can be automated. Can you write Python scripts?

unfortunately it don’t know how to write Python scripts, i wish i did.
i’m curious though, which part could be scripted?
i ask, because as i think about it, it would be nice to allow the user to adjust the kerning. would you know whether it might be possible to have a shape, or two, create a ‘hole’ in the next character?
thank you

The only way to change the tracking is to build a variable font.

@GeorgSeifert i’m finally coming around to your suggestion about making this as a variable font. thank you. it’s taken me some time to realize how that could work.