Typophile

Trouble with initial and ending alternative letter

Mario arturo0 votes

Hello
I am having trouble figuring out what I am doing wrong. I designed a script typeface where there is an alternative letter "s" for the beginning of words and another "s" for the end. In FontLab it does work, but when I go to InDesign and Illustrator ONLY the initial "s" works. Please see image attached where I show the way I have written it in Classes and in Open Type windows (please, scroll below to see everything). I have to turn this typeface on Monday to my client and I am running out of time. Please help!!!!!

Can you show us the code in the calt feature; also fina? Some Adobe applications prior to CS6 do not support everything.

CALT IS THE FOLLOWING:
feature calt {

ignore substitute @LETTER s';
substitute s' by s.init;

} calt;

...AND FINA IS THE FOLLOWING:
feature fina {

ignore substitute s' @LETTER';
substitute s' by s.fina;

ignore substitute b s' @LETTER';
substitute b_s' by b_s.fina;

ignore substitute o s' @LETTER';
substitute o_s' by o_s.fina;

ignore substitute ograve s' @LETTER';
substitute ograve s' by ograve_s.fina;

ignore substitute oacute' @LETTER';
substitute oacute s' by oacute_s.fina;

ignore substitute ocircumflex' @LETTER';
substitute ocircumflex s' by ocircumflex_s.fina;

ignore substitute otilde' @LETTER';
substitute otilde s' by otilde_s.fina;

ignore substitute odieresis' @LETTER';
substitute odieresis s' by odieresis_s.fina;

ignore substitute v s' @LETTER';
substitute v_s' by v_s.fina;

ignore substitute w s' @LETTER';
substitute w_s' by w_s.fina;

ignore substitute ograve s' @LETTER';
substitute ograve_s' by ograve_s.fina;

ignore substitute ocircumflex s' @LETTER';
substitute ocircumflex_s' by ocircumflex_s.fina;

ignore substitute otilde s' @LETTER';
substitute otilde_s' by otilde_s.fina;

ignore substitute odieresis s' @LETTER';
substitute odieresis_s' by odieresis_s.fina;

ignore substitute o' @LETTER';
substitute o' by o.fina;

ignore substitute ograve' @LETTER';
substitute ograve' by ograve.fina;

ignore substitute oacute' @LETTER';
substitute oacute' by oacute.fina;

ignore substitute ocircumflex' @LETTER';
substitute ocircumflex' by ocircumflex.fina;

ignore substitute otilde' @LETTER';
substitute otilde' by otilde.fina;

ignore substitute odieresis' @LETTER';
substitute odieresis' by odieresis.fina;

} fina;

There are some ligatures that contain the final "s" so that are the extra code you see in fina. THANKS!!!

I completed a connecting script a few months ago. My first attempts at making it more automatic worked but since there are some inherent weaknesses in OpenType feature code it would have led to frustration on the part of the end user so I abandoned that.

To simplify it, I set it up to make using the beginning alternate glyphs and the ending alternate glyphs easier for the end user. I used the code in a Stylistic Set, as follows:

For ending strokes: sub zcaron' space by zcaron.fina;
For beginning strokes: sub space a' by a.init;

You will have to have a similar line for each alternate glyph you wish to substitute. You don't need the /ignore line you currently have.

Your client must have software that supports Stylistic Sets too.

It does not work. If I want to a period after my final "s" there no space between the s and the period so I will not get the desired final "s". The same for the initial "s" if there no space before it will not work.
Thanks anyways!

George, one thing the "ignore" tactic covers that the space-testing tactic doesn't is swashes at the beginnings or endings of lines.

Hi again

OK, I can live with the «sub space s' by s.init;» and it works as long as I don't start the word without a space before it.

BUT there is something is not working and I can't put my finger on it. It is happening in FontLab and it only happens with anything related with "o and s.fina": os , ós , òs , ös , õs , ôs .

b_s.fina
v_s.fina
w_s.fina
THE THREE ABOVE WORK BEAUTIFULLY

I am pasting what I have under liga and under calt in OpenType window

LIGA:

feature liga {

sub b s by b_s;
sub b s.fina by b_s.fina ;

sub v s by v_s;
sub v s.fina by v_s.fina ;

sub w s by w_s;
sub w s.fina by w_s.fina ;

sub o s by o_s;
sub o s.fina by o_s.fina ;

sub ograve s by ograve_s;
sub ograve s.fina by ograve_s.fina ;

sub oacute s by oacute_s;
sub oacute s.fina by oacute_s.fina ;

sub ocircumflex s by ocircumflex_s;
sub ocircumflex s.fina by ocircumflex_s.fina ;

sub otilde s by otilde_s;
sub otilde s.fina by otilde_s.fina ;

sub odieresis s by odieresis_s;
sub odieresis s.fina by odieresis_s.fina ;

} liga;

CALT:

feature calt {

sub space s' by s.init;

ignore sub s' @LETTER';
sub s' by s.fina;

ignore sub b s' @LETTER';
sub b_s' by b_s.fina;

ignore sub v s' @LETTER';
sub v_s' by v_s.fina;

ignore sub w s' @LETTER';
sub w_s' by w_s.fina;

ignore sub o' @LETTER';
sub o' by o.fina;

ignore sub ograve' @LETTER';
sub ograve' by ograve.fina;

ignore sub oacute' @LETTER';
sub oacute' by oacute.fina;

ignore sub ocircumflex' @LETTER';
sub ocircumflex' by ocircumflex.fina;

ignore sub otilde' @LETTER';
sub otilde' by otilde.fina;

ignore sub odieresis' @LETTER';
sub odieresis' by odieresis.fina;

ignore substitute o s' @LETTER';
substitute o_s' by o_s.fina;

ignore sub ograve s' @LETTER';
sub ograve s' by ograve_s.fina;

ignore sub oacute' @LETTER';
sub oacute s' by oacute_s.fina;

ignore sub ocircumflex' @LETTER';
sub ocircumflex s'by ocircumflex_s.fina;

ignore sub otilde' @LETTER';
sub otilde s'by otilde_s.fina;

ignore sub odieresis' @LETTER';
sub odieresis s'by odieresis_s.fina ;

} calt;

What am I missing?
PLEASE, I have until tomorrow morning to solve this. Regards to all.

The way to go (which works with FontForge, there should be a way with Fontlab) is to give yourself two lookups, one to substitute the first letter, which is just

lookup subfirst {
ignore sub @LETTER s';
sub s' by s.init;
} subfirst ;

The second lookup, for the last letter can simply take the form

lookup sublast {
ignore sub @LETTER' @LETTER ;
sub s' by s.fina;
[...]
sub otilde' by otilde.fina;
sub odieresis' by odieresis.fina;
} sublast;

The first line says not to substitute a letter when followed by a letter. Then you list the substitutions for the last letters. Then you simply use the feature calt as follows

feature calt {
lookup subfirst ;
lookup sublast ;
} calt;

where the first lookup takes care of the first letter, and the second lookup takes care of the last letter (they are applied one after the other line by line). Of course you need to include in LETTER s.init if ss may occur at the beginning of a word, and maybe other characters. Be careful, there is just one apostrophe per line which corresponds to the glyph (or class of glyphs) that is to be substituted.

Will this solve my problem with o_s.fina and it's diviations: ós , òs , ös , õs , ôs ? As you see in the screenshopt above, that is my priority now!

It would not work without some corrections, for instance for oacute because your rule is

sub oacute s' by oacute_s.fina;

which asks to substitute the final s by oacute_s.fina when preceded by a oacute. You probably meant

sub oacute_s' by oacute_s.fina;

The rule for o_s does not have that problem and does not work either. Here is what I would try. I would simply put the rules for o_s in a third lookup, that would take o_s and replace it with o_s.fina, otilde_s by otilde_s.fina etc. That would give three passes for each line of input text, a first lookup that fixes the initials, a second lookup that fixes the final o, b_s w_s etc and a third lookup that fixes the o_s etc.

Be careful. The lookups are the actual code that is executed. If you want the three lookups to be executed in some order, you need to put them in that order in your feature file. The order they are listed in calt is irrelevant.

Hello Michel
Thank you so much for trying to help me....
When you say "give yourself lookups". I try your first sugestion in the OpenType window, putting the coding you suggest and I get an error. What am I doing wrong? Please, see image attached. Regards

I don't use fontlab; I don't know the interface. I have seen people using fontlab use such code elsewhere on typophile. Eliason or George should be able to answer.

Here is an example http://typophile.com/node/65109#comment-383530

So, one solution is just to write the code of the three lookups inside feature calt.

Hello Michel

You are a gentleman and a scholar. It finally worked. I am so greatful. If you need any advise on design of help in a design of a font, please contact me through my profile, my webside is on it and you can contact me. I feel I am in dept to you. Thanks again.

Kind regards

Mario Arturo

Great that it worked, and good luck with your font.

Hi Michel, I am back, i may need your help again. I turned in the font to my client and as I was getting on a plane to go see my parents, he contacted me telling it it worked great except for the fact the every time he types "oh" (meaning regular o and then the h) the o turns into final "o" next to a regular h. Do you know what's wrong? I could post my coding again. But I have to wait for someone at home to get into my computer. Regards

Hello. Hard to guess. You may just have forgotten to list h in @LETTER. Finding such bugs is much faster using Fontforge on the ttf or the otf than verifying the feature file.

Problem solved. Thanks Michel

Captured from web.archive.org on 11 Sep 2019. view this capture