Dominant Opentype ligatures?

claes's picture

I'm working on a typeface at the moment that uses plenty of ligatures (in the style of Ed Interlock) and I'm wondering if there's any way to make certain ligatures be dominant over others? For example, for SHI I have an SH ligature and a HI ligature, and because SH comes first as you're typing, it turns into the ligature and the I is left alone. Without having to make an SHI ligature, can I make the HI ligature dominant over SH in the case of SHI?

And pardon me if that makes no sense at all. I'm just curious if I can make certain ligatures bow down to more dominant ones.. If there's any code or such.

Also, while I'm here and asking, can you include spacebar in ligature replacements? Say, for example, you have an S and when it's at the end of a word (marked by a spacebar following the S) you want it to do a swashy thing, is that possibe? like a "sub S [SPACE] by SSpace.li" thing..?

Thanks!

thierry blancpain's picture

im sure zapfino OT has it, if you type the name all the glyphs change constantly, and there's even a full glyph just to write "zapfino" in a beautiful way :)

i remember a gif showing it, but cant find it anymore. this image is a bit of a preview, as you see the glyphs change.

i cant tell you how to do it, but its possible for sure.

Miss Tiffany's picture

I think you can find some information on the personal site of Tal Leming.

A few threads:
http://www.typophile.com/node/17177 -- http://www.typophile.com/node/6638

paul d hunt's picture

whichever ligature you list first is dominat. so if you want HI to trump SH, in your liga feature put:


liga {
sub H I by H_I;
sub S H by S_H;
} liga;

claes's picture

are you sure about that Paul?

i have the HI ligature earlier in the list than the SH ligature.. they aren't adjacent to each other in the list, so it seems (like i wrote above) that the ligature that's activated first (SH in this case) overrides any such list order.

anyway, i'll check out those links.

dezcom's picture

What if you make 2 groups of liga features? would the first group trump the second?

ChrisL

paul d hunt's picture

so it seems (like i wrote above) that the ligature that’s activated first (SH in this case) overrides any such list order.

the rule is what is first trumps what comes after. this is true of single lookups or of features. do you have the SH ligature lookup in any other feature lookups before you get to the HI ligature lookup?

dezcom's picture

What about:
sub SHI by S H_I;

?

ChrisL

claes's picture

what are lookups? *embarrassed*

all i've got so far is:

feature liga {
sub X Y by XY.li;
sub ...
sub ...
} liga

with all the ligature replacements all under there.

should i STFU and RTFM? (;

i only got FontLab yesterday, literally, so i am a complete newbie.

oh, by the way the "sub SHI by S HI.li;" didn't work. it gave me an error message when i compiled.

paul d hunt's picture

can you post your ligature featue exactly as you have it now? it'll be easier to spot problems that way.

claes's picture

oh it's a complete disarray (i've basically added them on on top of another as i've made the ligatures.. no order at all). everything works though, i can compile and the ligatures work.. i'm just wondering if there are any other tricks to use which might put certain ligatures in a higher level of sorts and override other combinations.

anyway.. here it is.

feature liga {
sub R O by RO.li;
sub E R T by ERT.li;
sub H I by HI.li;
sub L E Y by LEY.li;
sub I T C by ITC.li;
sub H U M by HUM.li;
sub M A C by MAC.li;
sub L A by LA.li;
sub I N by IN.li;
sub T W O by TWO.li;
sub F O by FO.li;
sub T H by TH.li;
sub E E S by EES.li;
sub A W by AW.li;
sub E R by ER.li;
sub L L by LL.li;
sub H E by HE.li;
sub R A by RA.li;
sub K I by KI.li;
sub W A by WA.li;
sub E E by EE.li;
sub H T by HT.li;
sub L E by LE.li;
sub E A by EA.li;
sub O H by OH.li;
sub H A by HA.li;
sub T T by TT.li;
sub M O by MO.li;
sub O N by ON.li;
sub N O by NO.li;
sub H A M by HAM.li;
sub L M by LM.li;
sub L N by LN.li;
sub U N by UN.li;
sub W U by WU.li;
sub R T by RT.li;
sub W R by WR.li;
sub E L by EL.li;
sub F A by FA.li;
sub I T by IT.li;
sub I T I by ITI.li;
sub T T A by TTA.li;
sub A T T A by ATTA.li;
sub R Y by RY.li;
sub L O by LO.li;
sub E H by EH.li;
sub T S by TS.li;
sub I T S by ITS.li;
sub A T S by ATS.li;
sub K A by KA.li;
sub T W by TW.li;
sub F F by FF.li;
sub M O N by MON.li;
sub N I by NI.li;
sub O T T by OTT.li;
sub S T by ST.li;
sub S P by SP.li;
sub E D by ED.li;
sub U T by UT.li;
sub D R by DR.li;
sub L D by LD.li;
sub F I by FI.li;
sub B Y by BY.li;
sub W I by WI.li;
sub T O by TO.li;
sub S H by SH.li;
sub W R Y by WRY.li;
sub E Y by EY.li;
sub M A by MA.li;
sub A N by AN.li;
sub M A N by MAN.li;
sub O W by OW.li;
sub W S by WS.li;
sub I P by IP.li;
sub R U by RU.li;
sub P R by PR.li;
sub P R O by PRO.li;
sub P R A by PRA.li;
sub W N by WN.li;
sub F R by FR.li;
sub F R E by FRE.li;
sub R E by RE.li;
sub D U by DU.li;
sub U C by UC.li;
sub C K by CK.li;
sub O Y by OY.li;
sub O Y S by OYS.li;
sub A Y by AY.li;
sub A Y S by AYS.li;
sub O F by OF.li;
sub A T T by ATT.li;
sub A V by AV.li;
sub A V A by AVA.li;
sub V A V by VAV.li;
sub B E by BE.li;
sub E S by ES.li;
sub S N by SN.li;
sub S N T by SNT.li;
sub N T by NT.li;
sub E N T by ENT.li;
sub A P by AP.li;
sub V O by VO.li;
sub A T by AT.li;
sub I V by IV.li;
sub I V E by IVE.li;
sub S U by SU.li;
sub U B by UB.li;
sub S U B by SUB.li;
sub J E by JE.li;
sub I E by IE.li;
sub I E S by IES.li;
sub I D by ID.li;
sub U P by UP.li;
sub I F by IF.li;
sub T I by TI.li;
sub T Y by TY.li;
sub N T Y by NTY.li;
sub Y T by YT.li;
sub Y T H by YTH.li;
sub F L by FL.li;
sub F L A by FLA.li;
sub F L O by FLO.li;
sub F L E by FLE.li;
sub N G by NG.li;
sub I R by IR.li;
sub U S by US.li;
sub W A Y by WAY.li;
sub T A by TA.li;
sub A G by AG.li;
sub E V by EV.li;
sub E V E by EVE.li;
sub V E by VE.li;
sub E N by EN.li;
sub V E N by VEN.li;
sub V E R by VER.li;
sub E E N by EEN.li;
sub R M by RM.li;
sub O U by OU.li;
sub M E by ME.li;
sub E M by EM.li;
sub S T U by STU.li;
sub U M by UM.li;
sub U M P by UMP.li;
sub M P by MP.li;
sub A S by AS.li;
sub Y P by YP.li;
sub I T T by ITT.li;
sub O R by OR.li;
sub T R by TR.li;
sub T O R by TOR.li;
sub A D by AD.li;
sub O T by OT.li;
sub L O T by LOT.li;
sub M B by MB.li;
sub R N by RN.li;
sub N A by NA.li;
sub A N T by ANT.li;
sub E T by ET.li;
sub V A by VA.li;
sub T E by TE.li;
sub Y M by YM.li;
} liga;

should the triple/quad ligatures be in their own section, or ordered above the doubles..? alphabetized perhaps?

paul d hunt's picture

a few suggestions:

naming: name a ligature of X & Y X_Y;
put longer ligatures first so quads, triples and then doubles.
if you have no preference of order, alphabetise ligatures just for easy (human) referencing

do you recompile your OT features after adding new lookups to test how they're working? you need to do this each time you change your code before you preview.

claes's picture

so it's better to use "A_B" instead of "AB.li" for the A B ligature? or it doesn't really matter?

and yes, i promise to alphabetise in due time. right now i'm just adding them as a go along/come up with new ones and that means they're added in random chunks so i can see what i've go so far.. and yeah, i recompile after each (chunk) addition.

sergeym's picture

Alphabetic ordering is for your own convenience. Ordering ligatures by length in descending order, however, is a generic rule. If f_f ligature would be in the list before f_f_i, latter one would never be substituted.

But ordering does not solve your problem of prioritization. If your lookup contains ligatures A_B and B_C, whatever goes first in the list -- "A B C" will be substituted to "A_B C". To allow B_C to work over A_B two separate lookups are required (or contextual substitutions, which seem to be overkill here).

In VOLT you create two lookups and put ligatures into them according to their priority. FDK also allows to specify separate lookup for the feauture, but I am not sure if it won't compile them into subtables of a single lookup. Syntax would look like this:

feature liga {
lookup liga.Pri1 {
sub B C by B_C
} liga.Pri1;
lookup liga.Pri2 {
sub A B by A_B
} liga.Pri2;

} liga;

Thanks,
Sergey

claes's picture

yep. i just reorganized the whole list, which should definitely make it much easier to overview and figure out which ligatures i should do next.. speaking of that, does anyone know of any free web tool that can sort lines alphabetically? (o: kind of a hassle to sort out all those lines alphabetically.

but anyway, Sergey, i will look into making priority lists. thanks for the tip!

dezcom's picture

TexEdit Plus

http://www.tex-edit.com/

ChrisL

claes's picture

thanks, i'll look that up.

by the way, i've put up a sample of the font i'm working on (that this thread is in regards to). here's the thread.

gthompson's picture

oh, by the way the “sub SHI by S HI.li;” didn’t work. it gave me an error message when i compiled.

sub S H' I' by S H_I.li;

Chris is right, but you have to tell it what is getting substituted in the string by adding ' after. Get an OpenType font and open it in FontLab and look at the code. That's the easiest way to figure it out.

George

I felt bad because I had no shoes, until I met a man who had no Bodoni

claes's picture

aha! okay. i'll try that out as well. thanks for the help.

paul d hunt's picture

But ordering does not solve your problem of prioritization. If your lookup contains ligatures A_B and B_C, whatever goes first in the list — “A B C” will be substituted to “A_B C”. To allow B_C to work over A_B two separate lookups are required (or contextual substitutions, which seem to be overkill here).

duh. i wasn't thinking. i shouldn't reply when i'm preoccupied.

gthompson's picture

feature liga {
lookup liga.Pri1 {
sub B C by B_C
} liga.Pri1;
lookup liga.Pri2 {
sub A B by A_B
} liga.Pri2;
} liga;

If you Type A B first I doubt the B C sub will work. The lookup for A B will kick in before you get to B C and if you don't have a sub for A B C you don't change anything. You should start with the sub of the long (complete) string first. I think it should be:

feature liga {
lookup liga.Pri1 {
sub A B' C' by A B_C
sub A B by A_B
} liga.Pri1;
} liga;

Once the B C sub is done the following A B sub won't change it since it's now A B_C, not A B C. It's the same as the f ligatures, f_f_i comes first, then f_i and f_f.

At least this is my understanding of how the GSUB works.

George
I felt bad because I had no shoes, until I met a man who had no Bodoni

John Hudson's picture

oh, by the way the “sub SHI by S HI.li;” didn’t work. it gave me an error message when i compiled.

You can't do many-to-many substitutions in OpenType. So if your input is multiple glyphs, then the output has to be a single glyph (i.e. a ligature lookup).

Regarding ligature names, you should definitely use the underscore notation, so H_I, not HI.li

A period . indicates that the glyph is a variant of a glyph, e.g. a.alt is an alternate form of a. But there is not HI glyph for HI.li to be a variant of.

The underscore _ notation is parseable by an application that implements the Adobe glyph naming rules.

sergeym's picture

No. Processing is going like this:

For each lookup
For each position where lookup is applied,
For each 'rule' in the lookup.
If rule matches the context do what it says, move to the next position
If rule does not match the context, try next rule.

So lookup order has higher priority than position.

About your approach, it won't work because 'position' in your contextual substitution starts from B' (A is just backtrack context). So A_B will work first according to the algorithm above.

It also misses another entry for B_C ligature, without context. And this example contains only two ligatures, in the real font more contexts may be needed for ligatures conflicting with B_C -- looks like supportability case for me. Adding one ligature may cause changing everything around.

Thanks,
Sergey

claes's picture

i just tried out the

"sub S H' I' by HI.li;"

command and it works like a charm. very nice that it can do that without having to create a SHI ligature. it sure opens up a whole new can of worms (or possibilities) though, but at least now i know how to pull off that trick.

thanks everyone for the help!

twardoch's picture

Claes,

still, you should name your ligature H_I or H_I.li or H_I.liga, but *not* HI.li. It does matter. Please read the FontLab Studio 5 manual for extensive glyph naming suggestions.

Regards,
Adam Twardoch
Fontlab Ltd.

claes's picture

i already did. (o:

claes's picture

i just thought i'd let you all know that i tested the use of seperate lookup groups, and it gives me just the effect i was looking for. if i place the H_I ligature in the top group and have the S_H ligature in the one below it'll override the S_H ligature and go to the H_I ligature even when writing SHI.

so thanks again everyone who helped out! it's much appreciated.

by the way, why isn't there some resource with examples of various effects one can achieve with Opentype? i had an idea about having the upper and lowercase alternate (LiKe So AnD sO oN, though i'd use it as a sort of randomizer), and i actually figured out how to achieve it eventually.. but it's stuff like that you'd wish there was some website resource for where people could send in their tricks and tips. too bad, really. very little about Opentype out there it seems, or everyone's sitting on their own coding and not wanting to share.. maybe? or wanting money for it, perhaps..

uh.. anyway.

stw's picture

Hi kesh!

I found the image you were talking about: (its from Linotype.com)

Bye: Steven

gthompson's picture

by the way, why isn’t there some resource with examples of various effects one can achieve with Opentype? i had an idea about having the upper and lowercase alternate (LiKe So AnD sO oN, though i’d use it as a sort of randomizer), and i actually figured out how to achieve it eventually.. but it’s stuff like that you’d wish there was some website resource for where people could send in their tricks and tips. too bad, really. very little about Opentype out there it seems, or everyone’s sitting on their own coding and not wanting to share.. maybe? or wanting money for it, perhaps..

Your best source is workshops at the conferences like SOTA and ATypI. People are happy to show you how to do stuff. Nick Shinn did one on stylistic alternates in a script font and Thomas Phinney has demoed some amazing stuff with relatively easy code including random things. He also has an OT font that replaces profanity in text.

George
I felt bad because I had no shoes, until I met a man who had no Bodoni

.00's picture

If your interested in learning more on this subject, there is still time, and there is still room at the TDC Font Tech Weekend starting this Friday evening.

Miguel Sousa's picture

> Thomas Phinney has demoed some amazing stuff with relatively easy code including random things. He also has an OT font that replaces profanity in text.

Are you talking about Amy Papaelias' TypeTalk Fonts?

dezcom's picture

Amy showed her work at TypeCon NY last summer. She has a thread here somehere where she discusses it. Interesting stuff and she was an entertaining speaker as well as informative.

ChrisL

amyp's picture

you’d wish there was some website resource for where people could send in their tricks and tips. too bad, really. very little about Opentype out there

true...and typophile's the best place for that on the web...

PicLig by Christina Schultz is a great project too.

Thomas Phinney has demoed some amazing stuff with relatively easy code including random things. He also has an OT font that replaces profanity in text.

Tom used the TypeTalk project as inspiration to build his example using some very excellent contextual alternates...and to think i wasted away hours upon hours of grad school making ligatures! :)

she was an entertaining speaker as well as informative.

thanks chris! it was a great experience, although i don't remember any of it (i was too busy being paralyzed with fear!)...BTW, we met briefly, i believe, when you and gerry leonidas were shaming me for my abysmal knowledge of Greek...

i'll be making a short presentation next week at SUNY New Paltz (where I developed the typetalk project) on 5/5. see the promo poster...

dezcom's picture

"...BTW, we met briefly, i believe, when you and gerry leonidas were shaming me for my abysmal knowledge of Greek…"

I remember it well. I was surely joking (which is most of the time in my case). My Greek vocabulary is very limited and I would be the last person to point shame at anyone else. I really did enjoy your presentation and your "paralized with fear" part did not show.

BTW, I just attended a Fontech session in NYC at TDC where Thomas Phinney was one of the presenters. He was bragging on you and showing your work to some of the attendees who had not seen it. Your many hours in graduate school did not go in vein!

Hope you will be able to come to TypeCon Boston and join us all.

ChrisL

Syndicate content Syndicate content