Contextual swashes for beginnings.

bvfonts
9.May.2006 2.34pm
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.

AttachmentSize
cswh.jpg167.4 KB

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

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

to make it work.


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...


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


try this

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

where

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


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.


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?


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.


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)


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: http://www.bvfonts.com/livejournal/begins.gif


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.


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


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.


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


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