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.

Hi, I hope this can still help, I searched the post that you mentioned in Typedrawers, I actually have made a completely contextual typeface before, the only downside of it is that the character count is very high, I though of a similar solution as yours first but soon realized that the user had to know how to open or close a word with an extra character, but then I though of a different approach by having individual puzzle like pieces that can be reused with letterforms of similar characteristics (B D E F H I K L M N P R for the left side in your uppercase characters for example, or C G O Q for rounded letters for left and D O for the right, and so on; H I M N, J U, V and W and letters that share some characteristics that you should understand better).

I took the time to simulate and example with your image, you have your default letterforms, for isolated use (or sometimes for use as it is in context, like B G Y in your uppercase alphabet image), then you have your initial and your final contextual forms (although no init or fina feature is needed), you make all the possible forms for all letters that would be used next to any other letter, for example A_o would be an A that will fit the next O (or C G Q also); and you need the complementary a_O to fit that character (in a two letter word AO that would be enough, in your proposed system you would need 3 glyphs to do that.

Then, you’ll need all the intermediate forms like a_O_a in the example, wich would be an O between two A’s, the first a contextual one and the second a default one (AOA, or A_o - a_O_a - A), the names could be changed so you know what other letters fit that glyph, then you group letters and your CALT feature should have first the medial letters replacements in the form of:

sub [A C E F G N O S] A’ V by ACEFGNOS_A_V; for example, but with the @ symbols for the clases, is just that the forum thinks I’m mentioning users and I can’t mention more than 2 users, except for the ones that are being contextualized

then the initial substitutions, for example:

sub A’ M by A_M_;

And then the final subtitutions (their order can also be mixed with the initial), for example:

sub X A’ by _X_A;

I did it with 3102 glyphs, it is not 26^2 + 26^3 + 26^2 (18,928) but actually a lot less than that, I recommend that you give this option some though, but I strongly advice that you explore color and layering alternatives, and you try to achieve a dynamic look, and only a black and white letterform or a duplicated filled layer would give the desired results between two lines of text; but with the method I’m describing you can’t have that effect across two lines of text, you’ll have contours with no background, but if you change the tracking it would break the effect, I think neither solution is elegant but one doesn’t depend on the exact «ligature» half of each pair, I know this is probably not so encouraging but at the end of the day, it is a possible and probed solution, although not very effective as it is a lot more work, but again, just consider that it is another option. Great work by the way.


Iván Moreno

1 Like

hi @IvanMoreno !
Wow, thank you for taking the time to respond and offer up a new suggestion for this!
I inititally began by thinking every combination would be a ligature, but as I was testing and checking my drawings (to make sure that the points of one letter ‘touched’ the points of the next letter) I realized that someone using this typeface might want to color each letter separately without converting them into outlines and realized that this method would not work.
After researching and thinking about my ‘problem’ I figured out a different method (and methodology) and started down that path - i’m now using a ‘one to many’ substitution and am creating individual letter (half) combinations (I’m at about 1000 combinations right now).
Here is the progress:
This screenshot shows my methodology. I’m setting AAA, ABA, ACA, ADA, AEA &c. then making the combinations, just to make sure I’m getting every combination. (this still needs some fine-tuning)

Here are some of the combinations, in color:

Everything was going along well enough, I mean it’s very tedious, but it seemed to be working well, and appeared to be pretty easy for someone who wanted to use this typeface (aside from ticking a couple of ‘world-ready composer’ tickboxes, and not using tracking). Then, I decided to test this in a text box, and bumped into a problem that has me completely stumped and has taken the wind out of my sails a bit. I realized that applications adjust the letter spacing within a text box when a word requires a hyphen. Obviously, this breaks the effect…

I’ve been researching and asking around about how to deal with this issue, but I think the consensus is that it can’t be dealt with, so now I’m trying to figure out another solution. I did think about a variable font, on Georg’s suggestion, but since pieces of my letterforms overlap other letterforms in different ways, I wasn’t able to get my head around how I’d build one. (i’ve also thought about layer fonts, but again, I’m not sure how I’d layer things, and in general, they just seem so clunky to me)
I’m going to look over your suggestion again, but I may end up just adding a big ‘read me’ with this typeface, if i ever finish or release it.
I really appreciate you taking some time and making some effort with this @IvanMoreno, thank you!

1 Like

Wow. Looks pretty good. :clap::clap::clap:

When you release your typeface, you need to add something like this to the explanation: ‘This font is not compatible with tracking, be it automatic or manual.’ And perhaps add one or two short guides about how to make sure that there is no tracking ever in apps like TextEdit, Pages, Keynote, InDesign and Illustrator.

aw, thanks @mekkablue!
Yes, I think you’re right, about the explanation. - for the one or two people that might actually have a use for this type of face, heheh.
thank you!

1 Like

You’re welcome, I think that it looks great from what you have made, except for the text box hyphenation restriction, I don’t know if anyone has tried to avoid it before.

I think that the extended solution should then be a mix of variable and color fonts (or a layered one splited into filled characters and lined characters), I think you could somehow cheat the specification by having at least 3 double layers (the black and the white), for example in the SC combination you could have and S that is just the top right shape of the curve and have the higher index on your font, then the C comes in the middle and the rest of the S at the bottom, the separation of the letter parts is evident and you should be able to track the letters without an extended need for glyphs and code, Glyphs has a great tutorial for it (the comment section only allows me to post two links, so I had to erase this one but it is pretty easy to find).

Then if it is a variable you should be able to even assign a tracking axis, I think I’ve seen some experiments by Typearture were it show that it is possible to hide shapes these are color variable fonts, I think that the extend of the application is limited to the web but I think that it refers to the animated part of those experiments.

On the other side I think that you could also retract shapes so that they «hide» inside themselves but I don’t really know the mechanism for it, Underware did something called High Order Interpolation where a stroke can appear as it is following a path, even if it is curved or more complex, imaging applying than principle but to retract each line as it comes in contact with other letters,, I wouldn’t go there yet but maybe it could get easier with time to think and solve complex problems like this.

I think your typeface looks absolutely ready to use, a little warning shouldn’t discourage anyone from using it, consider that some or most connected script typefaces may have the same problem, so, don’t be discouraged, you can count me as one of the many people that sees a great potential in it.