Need little help with ending swash.

Eimantas Paškonis's picture

Hi! My very first post - logged in because of this question.
I want to make the following rule in OT font:

(in human language) If the word ends with "r", it should be substituted with "r.alt"

So far I've been trying to understand FL manual, search this forum and google for tutorials, but with no luck at all.

daverowland's picture

set up a class which contains all letters, eg @letter, then code it with an ignore sub:

ignore sub r' @letter;
sub r by r.alt;

Nick Shinn's picture

It might be better to name it "r.end".

Arno Enslin's picture

You may not put the space into the class "letters". Otherwise the r is replaced in the end of the last word only. What’s better, is probably dependent from the font. And there is a registered feature for your purpose, the fina-feature. So you also can name the terminal form of the r "r.fina".

Eimantas Paškonis's picture

ignore sub r' @letter;
sub r by r.alt;

Is this all I need? I get "expecting EOF (text was "ignore") " error. I suppose class name should be without "@"?

And there is a registered feature for your purpose, the fina-feature. So you also can name the terminal form of the r "r.fina".
Could you tell more about it?

Arno Enslin's picture

Could you tell more about it?

http://www.microsoft.com/typography/otspec/features_fj.htm#fina
and
http://www.typotheque.com/fonts/opentype_feature_support

In the German version of Indesign CS3 it can be activated by "Opentype/Positionalform/Finalform".

And I think this should be the code:
ignore sub r'
sub r' by …

As far as I remember, it does not work if ' is missing in the substitution rule because of the ignore rule with the "context indicator" (') in it.

Eimantas Paškonis's picture

It works. All that was missing was opening and closing lines :)
But while swash comes up in preview and apps, it doesn't in metrics window.

Eimantas Paškonis's picture

And one more question - how do I export my kerning values with font to be usable by applications?

Arno Enslin's picture

In case of OpenType the kerning is in the GPOS-table (kern feature) or in the KERN-table. I am not sure, what you mean. You don’t have to export anything separated from the font. Go to FontLab options/generating OpenType and TrueType/Kerning.

Eimantas Paškonis's picture

After exporting FL asks me if I "want to rebuild Kern OpenType feature?"

daverowland's picture

Press yes.

With regards to kerning the end swashes, I would set up class based kerning, eg @r [r r.end] assuming the left hand side of the glyphs are the same. If not, and you need to kern the swashes separately, you can copy and paste the resultant sring from the OpenType Preview window into the Metrics/Kerning window.

I have suggested on the Fontlab forum that it would be good if the Metrics window could be set to apply OpenType substitutions, to make this process less of a hassle.

Eimantas Paškonis's picture

Thanks for the info, but problem is that ALL kerning is lost when font is exported.

daverowland's picture

Make sure you're updating the kern feature before exporting. In Tools - Kerning Assistance - Update [kern] feature.

One other thing to remember - the kern feature only works if there is another OpenType feature in the font. Simple enough to put in liga - sub f i by fi.

Then when you export it will say something like, 'kerning has changed.... blah blah blah'

Click yes

Arno Enslin's picture

One other thing to remember - the kern feature only works if there is another OpenType feature in the font.

That’s true only for old versions of the Adobe Creative Suite up to version 1 or 2. In version 3 the problem is solved.

Eimantas Paškonis's picture

So now I know how to export kerning and create ending swash.
What needs to be changed in the code if I want to make a start swash or a swash that comes up only after specified character?
Sorry for lots of questions but it's my first experience with FL.

Arno Enslin's picture

Phoenixed

That’s explained in the FLS manual. Read it, please.

sub x' y z by x.alterSchwede

If x is followed by y and z, it will be substituted. And x, y, z and x.alterSchwede can be single characters, lists of characters (in brackets) or classes (@classname) or lists of classes (in brackets). But it is better explained in the manual. You will not learn, if you don’t try to solve problems by yourself at first. If anything does not work, you can still ask. And I recommend to study the feature files, that Adobe provides for Minion (along with the AFDKO, as far as I remember).

Eimantas Paškonis's picture

What's what I said in first post - I've googled for tutorials (found one in League's Typelog, but about ligatures) and read the manual. (FL5 Manual, "Substitution lookups", pages 864-873).

What's the point in studying the code if you don't know the language? Like in your post - what do "alterSchwede, Minion and AFDKO" mean?

Arno Enslin's picture

"x.alterSchwede" was a joke. Name the substituted character or class as you want, r.alt or r.fina for example.

Minion is an Adobe font. And the AFDKO is the abbreviation for Adobe Font Development Kit for OpenType, that is available for free. You can download the AFDKO and the Minion feature file at "http://www.adobe.com/devnet/opentype/afdko/".

What needs to be changed in the code if I want to make a start swash or a swash that comes up only after specified character?

That is answered on page 860 of the FontLab manual (Context Dependent Substitutions).

What's the point in studying the code if you don't know the language

I don’t think, that it is possible to learn a programming language without studying code parallel. In case of OpenType I am even not sure, if the feature file syntax is a language.

Syndicate content Syndicate content