Proper technique(s) for scripting OT/CFF
Alex Kaczun
Posts: 163
I'm very close to completing a new italic font family and I want to have 2 alternate capital A(s), such that the main cap A works with set (all) capitals. And, the alternate (more slanted version) is substituted, on the fly, when typeset with lower case (in regular text). The italic angle of this font is slanted at about 16 degrees, and the regular cap A works well with the slanted capitals, but the lower case overall is even more slanted and thus requires a suitable alternate cap A to flow better visually.
I'm thinking that this should work as a ligature substitution, like any ffi ligature. If you typeset a cap A with (all) capitals the regular cap A is used, but if you typeset a cap A followed by lower case string, the alternate cap A (more slanted) version is used.
I know how to script for standard type stuff. But, this seems different somehow.
I remember reading somewhere (online) about scripting an elegant way for just this type of situation, but for the life of me, I cannot remember completely.
Can anyone supply this code and/or point me to the resource online.
Many thanks in advance.
I'm thinking that this should work as a ligature substitution, like any ffi ligature. If you typeset a cap A with (all) capitals the regular cap A is used, but if you typeset a cap A followed by lower case string, the alternate cap A (more slanted) version is used.
I know how to script for standard type stuff. But, this seems different somehow.
I remember reading somewhere (online) about scripting an elegant way for just this type of situation, but for the life of me, I cannot remember completely.
Can anyone supply this code and/or point me to the resource online.
Many thanks in advance.
0
Comments
-
What you need is a contextual alternate feature (
calt
). It would look like this:feature calt {
sub A' @lowercase by A.alt;
} calt;
where "@lowercase" is a class containing all your lowercase characters and "A.alt" is your alternate A. (The tick mark indicates which glyph gets the substitution.)
Assuming you also want to include the accented forms, you would put all your A's into classes as well, and it would look like this:feature calt {
sub @normalA' @lowercase by @altA;
} calt;
(Note to James: The formatting of the code tag is terrible. Does it really need that box around it? Could the text size be a little larger?)0 -
Thanks Mark. Very helpful indeed. Much appreciated.
This will work just fine.
I can't help but feel that there are several different ways to achieve this.
What I seem to recall reading online somewhere worked a little differently. I think?
If anyone else has an alternative approach, I would be interested in hearing it.
Thanks again Mark for your quick reply.0 -
As far as I know, this is the usual way to do it, and I can't think of a way that's more straightforward.
You do have to pay attention to the order of your features. For instance, if you have ac2sc
(caps to small caps) feature, and don't have an alternate small cap A, you would want it to come before this particularcalt
feature.1 -
I would make the more slanted version the default, and put the all-cap version in the case feature. That way, it will be activated whenever text is set with the caps-lock key down, the all-caps feature selected, or “command-shift-k” (Mac) implemented.
It would not be implemented only in all-cap situations where text is input holding down the shift key all the time, which is not how people type.
IMO, this method is more basic and sturdy than using calt.
For instance, it doesn’t fail when tracking is increased.0 -
That happens with
calt
? I thought it was justliga
that was affected.0 -
No, it happens in calt too.
calt was originally conceived for connected scripts, Caflisch in particular, which is why it was thought this behaviour was desirable. Unfortunately, it fucks up “pseudo random” etc. that also use the feature.
It’s particularly annoying for all-cap settings, which are often letterspaced.0 -
feature case { sub @A_source by @A_target; } case;
A_source will be all your cap A letters, including those with accents, and A_target will be the corresponding all-cap versions. Name them A.case, Aacute.case, etc.0 -
I faced a similar situation recently when making a baskerville italic.
Ended up putting the alternates inss01
so people can decide when they want the traditional more slanted /A /V /W and when to use the updated, less slanted alternates.0 -
That way, it will be activated whenever text is set with the caps-lock key down,
Nick — I think you misspoke. {case} is not activated by the caps-lock key. Capitals input as capitals, whether through shift key or caps-lock, will not engage the {case} feature.
One has to apply a feature that specifically engages {case}, such as the other two options you mentioned — basically All-Caps (which is what the shortcut shift-command-K activates).
Even a Change Case conversion does not activate {case}, as it just substitutes the underlying character encoding.0 -
Yes, my mistake.0
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 803 Font Technology
- 1K Technique and Theory
- 622 Type Business
- 444 Type Design Critiques
- 542 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 485 Typography
- 303 History of Typography
- 114 Education
- 68 Resources
- 499 Announcements
- 80 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 270 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports