Contextual swashes for beginnings.

bvfonts's picture

I'm programming contextual swashes for the beginning and endings of my script face I'm working on and I'm using the info in the fontlab manual. I tried the ending swashes script and it worked fine. The beginning script that I copied directly from the manual doesn't work. Is there a way to make this happen? As you can see from the screen capture the beginnings are being replaced for every letter even though I have an ignore substitute scripted in.

cswh.jpg167.4 KB
elena's picture

I think you should include the swash glyphs in your ignore string:

ignore sub [@letter @start_swash] @start';

to make it work.

elena's picture

Ah, most important, you have to define the context! It's not enough to put the apostroph ;)

ignore [@letter @start_swash] @letter';
sub @letter' @letter by @start_swash;

for example...

bvfonts's picture

That didn't work, it gave me error messages, but thanks for trying! : ) Waaaaa.

paul d hunt's picture

try this

swsh {
ignore sub @ALL @swsh1';
sub @swsh1' by @swsh2;
} swsh;


@ALL = All letters and punctuation
@swsh1 = The letters you want to be replaced by swashes
@swsh2 = swash variants

bvfonts's picture

I just got a reply from fontlab and this is what they said:

"I'm puzzled. It should work but doesn't. I'll do some more tests."
Adam Twardoch
Fontlab Ltd.

So I guess the code isn't the problem.

Miguel Sousa's picture

Have you tried renaming your classes?
I know this suggestion might sound silly, but you never know...

One other thing, have you tried generating a font and test it in InDesign, for example? Does it work?

bvfonts's picture

I tried renaming the classes and that didn't do anything. I also tested the font in Illustrator CS2 and it did exactly what it does in the fontlab ot preview panel.

paul d hunt's picture

as you have things set up now, you need to include all your x.start letters in your @letter class. sorry i didn't make this note earlier (i missed the jpg image somehow)

bvfonts's picture

Thanks Paul! The beggining are working. The only problem is that now the endings aren't working. It's like if one works it cancels out the other one or maybe I should change the code. Here's a capture of what's happening now:

k.l.'s picture

Maybe the first ignore also prevents the end-swash substitution. By defining separate lookups, you also define the boundaries for each "ignore" (only valid within the lookup in which it was defined).

feature calt (

lookup caltstart (
   ignore sub @letter_start @start';
   sub @start' by @start_swash;
) caltstart;

lookup caltend (
   ignore sub @end' @letter_end;
   sub @end' by @end_swash;
) caltend;

) calt;

Mr Hunt's suggestion to include X.start glyphs in the @letter class may also applies for X.end glyph substitution.
Either you include X.end glyphs in @letter too. Or you create separate context-classes for caltstart lookup (including a-z and a.start-z.start) and for caltend lookup (including a-z and a.end-z.end); I indicated this by adding "_start" and "_end" to "@letter" in the sample above. Both may result different substitution behavior with one/two-letter-words, so you should try both ways and see which looks better.

paul d hunt's picture

i believe karsten is correct. you need a separate lookup for your starts and for your finishes.

bvfonts's picture

That was it! Thanks Paul and Karsten! There was one small thing that needed changing. Instead of ( ) it needed to be changed to { } on your code.

paul d hunt's picture

it seems you got everything figured out. Congratulations on Eye Catching, it looks great!

LauraWorthington's picture

Hello everyone! I need some help with this too. I think I'm on the right track but something's missing in my beginnings & endings. I have the exact feature set up that Karsten posted above, so the problem must be in how I have my classes set up, as shown below:

@letter_start: t t.start
@start: t
@start_swash: t.start
@letter_end: t t.end
@end: t
@end_swash: t.end

Thanks! :)

~ Laura

Syndicate content Syndicate content