Can I implement this in opentype: an overbar if a "t" is in a word

Pomax's picture

I'm prototyping a cursive font where, at least on paper, any word with a "t" in it has the crossbar on the t extended to the left and right over letters as long as this fits; verticals in h, l, d, etc. will cut off the bar, so something like:

becomes something like:

I'm not entirely sure how to implement this, though. I was thinking of using many-to-many GSUB rules based on glyph classes, but no matter how I look at it, it turns into needing recursive GSUB behaviour...

1) t [low] ->[t with bar that continues right] [low with left-connecting overbar]
2) [low with left-connecting overbar] [low] ->[low with fully connecting overbar] [low with left-connecting overbar]
3) [low with left-connecting overbar] [high] -> [low with fully connecting overbar] [high with lef-connecting overbar stub]

and rule 2 would have to recursively kick in... and that's just in one direction.

Has anyone every tried something like this before? Or does anyone have thoughts on how this might be achieved?

JanekZ's picture

My feature file:
https://dl.dropboxusercontent.com/u/19437300/Exp1.fea

Something like this?


Of course it is POC, you need to add some glyphs and substitute i,j with dotless i,j

Pomax's picture

awesome, thanks! although I'm curious why the feature cuts off on the 'u' in ligatures, but not the 'u' in features.

JanekZ's picture

Because I was lazy and did not make one line of the code and one glyph (3 letters, t, 4 letters)...
To be honest, much more is required, e.g. "transparency" - t11.

Pomax's picture

If I'm reading this correctly, the substitutions are simpy t's with longer bars, right? They're fixed length and you might have iiiiit have an overhang to the left compared to aaaaat due to the glyph width of 'i' being a fraction of 'a'?

JanekZ's picture

Yes; I don't know any better solution to do this..

Pomax's picture

Another option I was considering was a substitution for every low class glyph with a macron counterpart, so that [t] + [low] contextually becomes [t-extended] + [low with macro], then simply have a huge block that goes [low macron] + a → [same] + ā, and repeat the block a stupid number of times to get the "recursive" length desired, with terminations like ā + l → [l with a left-terminator], etc.

But they're both not ideal solutions =/

Syndicate content Syndicate content