I can’t figure out how to code this the way I’d like to.
Suggestions would be welcome!
The premise of the font is to alternate characters between roman and italic.
The basic code is very simple.
@default = roman glyphs
@alts = italic glyphs (e.g. A.alt etc.)
sub @default @alts' by @italics;
The result:
Inserting a space before the sentence produces another option for the user:
However, I’m not happy that the letters on either side of the space have the same inclination.
It occurs to me that alternating the slant across the word space would be better.
This I achieve by adding a line of code at the beginning, to put two characters between words:
sub space by space.half space.half;
But his means that when the user inserts a space at the beginning, it becomes two characters and will thus not produce the optional look, merely moving the image to the right. A period or any other single character would do the job:
I would rather that the user achieve this effect by inserting a space—but how?
Is there some method involving “ignore” or lookups?
Or some other method entirely?
Any ideas?
Comments
So you want to continue with the concept of using a preceding space to trigger the optional behaviour, you can perhaps add contextual code to your two-half-space substitutions that disables it when not preceded by any other glyph? [Sorry, I can’t remember how to do this in AFDKO syntax.]
Or maybe:
@default = roman glyphs
I don’t understand that, Simon, could you please put it into feature code?
lookupflag IgnoreLigatures;
sub @default @alts' by @italics;
but to make it work you would need to set the GDEF categories. If you are using Glyphs, select all the glyphs you want to be ignored (space, punctuation, etc.), press command-option-I (or Edit menu > Info for selection), and click on the check boxes next to Category and Subcategory, filling in the information like this:
I’ve actually opted for “none of the above”, and will make two separate fonts, one which starts with roman, the other with italic.
The impetus was John’s comment about the insertion of a space at the beginning, which messes up layouts.
I’ve never considered this two-font method in my previous, pseudo-random typefaces (Fontesque, Duffy, Neology), perhaps because they all have large-ish families and duplicating them would create menu clutter, and I’ve always used the “add space at beginning” method in cycling through the alternates in prototyping such designs.
However, rather than burying the option in a Stylistic Set, having a separate “B” font up front in a layout app menu makes sense here.
lookupflag 0;
ignore sub [ A.alt B.alt C.alt ... a.alt b.alt c.alt ] [ space ] [A B C ... a b c ... ]' ;
sub [space exclam quotedbl numbersign ... A B C ... a b c ... ] [A B C ... a b c ... ]' by [A.alt B.alt C.alt ... a.alt b.alt c.alt ...];
} caltflip;