One swash to rule them all

Hi,

I have two problems that I can’t solve.

I’m trying to make a single swash for the beginning of a word and another one for the end of a word. Also I want that two swashes to be compatible with all letters.


I don’t want to use the positional alternates feature because I’m going to use it for something else. And same for swashes feature.

So I tried another way.

I made a glyph for the beginning of a word and named it sws_str which is compatible for a group of letters (m, n, p, r, u, etc.)

Another glyph for another group (b, h, k etc.) and named it sws_str.alt.

sws_str
sws_str.alt
sws_str.alt.001
sws_str.alt.002
.
.
.


I created classes for the letter groups. str_bhk, str_acd, etc.

Then I add the calt feature and use the code below.

sub sws_str @str_bhk by sws_str.alt;
sub sws_str @str_acd by sws_str.alt.001;

When I test it in Illustrator, something work good something not. I try to explain visual.


My second problem is about the font weight. The font is variable. When I test it in Illustrator, it works for all glyphs but not working for the glyphs that I write above (sws_str, sws_str.alt, etc…)

I’m not sure that it has a solution.
Any help will be great.

You need to specify which glyph should be replaced with ', otherwise it replaces both:

sub sws_str' @str_bhk by sws_str.alt;
sub sws_str' @str_acd by sws_str.alt.001;

Illustrator doesn’t interpolate non-unicode glyphs which you add from the glyphs panel. Accessing them through features should solve that.

Wow. What a simple solution.

About the second problem. I guessed that it would be something about Unicodes and put some values from the Unicode section at the bottom-left corner. It didn’t work.

I don’t know how to do that. Is there any tutorial or a source that I can read?

Depending on how you plan to enable those swashes.
You could add a contextual one to many substitution to automatically add those swash glyphs (that will work in most places, the most important that is not working is the Default Composer in Indesign, the World Ready composer is fine).

And instead of all those alternates, you could position the swash with mark positioning and use some contextual spacing to give it the space it needs.

Something like this:

standalone lookup swashIn_subs {
	sub A by A swashIn;
	sub V by V swashIn;
} swashIn_subs;

lookup swashIn {
	ignore sub @AllLetters @AllLetters';
	sub @AllLetters' lookup swashIn_subs @AllLetters ;
} swashIn;

lookup swashInPos {
	pos [A V] <600 0 600 0> swashIn;
} swashInPos;

(I can’t get the ignore line to work properly. Do I miss something here?)