Implementing OpenType calt or init with Latin script in 2024
Hello,
At my job we use a typeface created by an artist on our team for labeling diagrams and illustrations. As part of the style guidelines, there’s a special use around the letter “i”. We always use all caps, and if the letter I is the first letter of a word, then we use the I with crossbars on the top and bottom. If the I is not first and inside a word, we use an I without crossbars. The problem is the default capital I has crossbars, and anytime an “I” is in between the word, we type a lowercase L.
I thought it might be possible to bake in a rule like that, to change the default upper case i to have zero crossbars, and for the font to identify when an I is at the beginning of a word, and change it to use the glyph with crossbars. However it is unclear to me if something like that is supported for Latin script and the English language in OpenType.
Glyphs says that opentype positional features do not apply to Latin: https://glyphsapp.com/learn/features-part-4-positional-alternates
Fontforge documentation says support for calt in latn has possibly improved over time: https://fontforge.org/docs/tutorial/editexample6-5.html
However the Opentype cookbook doesn’t mention any support issues with init/word boundary detection: https://opentypecookbook.com/common-techniques/
I’m new to font editor software so I want to try to edit the .otf file in fontforge, and maybe try glyphs if that doesn’t work. Each guide I look at also does it in a different way. Is there a method anyone recommends? Is there even opentype support for what I want to do?
Comments
-
You can use the “ignore” method in, for instance, the Contextual Alternates feature.
This is how the Swash feature is used to make initial cap letters swash.
ignore sub @capitals I';
sub I' by I.crossbarred;
This means that unless I is preceded by a capital (e.g. in all-cap text) the crossbarred alternate will be substituted.2 -
Glyph positioning is irrelevant in this case, as your request is about glyph substitution.
You haven’t mentioned which software you're using, so it’s unclear how well it supports OpenType features.
If it does support contextual substitutions, Nick's approach should work effectively.
Here is a complete Adobe fea feature file:languagesystem latn dflt; # Latin default @capitals = [A-Z Agrave Ccedilla I.crossbarred Macute]; feature calt { # Contextual Alternates ignore sub @capitals I'; sub I' by I.crossbarred; } calt;
You can import it directly into the OpenType Designer dialog in FontCreator (both Windows and Mac).1 -
The init, medi, fina, and isol features are now explicitly defined as implementing Unicode joining behaviour for e.g. Arabic. The earlier descriptions of these features in the OT features registry mistakenly described them as being applied based on position in a word, but that was never actually how they were implemented in layout engines* because that is not how Arabic and other scripts with joining behaviour actually work.
So now the feature descriptions reference ArabicShaping.txt which is the Unicode standard that defines joining behaviour, and this conforms to how the features are actually implemented in shaping engines.
This means that if you want to apply word-positional glyph substitutions in scripts—including scripts like Arabic if, for example, you wanted to apply a specific swash form at the end of a word—, then you would need to do this via contextual substitutions. As Nick suggests, the ignore key word is useful in capturing the beginnings and ends of things in FEA code.
You could put the substitutions in the calt feature if you want users to have the opportunity to disable them, or put them in the rclt feature if you want them to be active by default and on all the time.
_____
*With the unique exception of a couple of prescript vowel signs in Bengali, which get init applied at the beginning of words; this behaviour is maintained for backwards compatibility reasons.3 -
Given that the OP states that the default I in the font is currently the one with crossbars, intended for use at the beginning of a word, it seems to me it would be easier in this case to simply have an OpenType Layout substitution to accomplish the deployment of the alternate I when not at the beginning of a word. Something like this:@letters = [A-Z];fea calt {sub @letters I' by I.unbarred;} calt;This eliminates the need to rearrange the glyphs in the existing font (which comes with other potential dependencies).@durkdurk — This code substitutes the default I (as targeted by the single tick mark) with the alternate unbarred one (the object of the by operator) when directly preceded by any of the members of the @letters class.This code assumes the simplest case as described where everyone already types in all-caps. The definition of @letters should be adjusted to include any other letters (e.g., accented caps in the font) or punctuation after which you don’t want the default crossbarred I.Also, the I.unbarred in the code should be adjusted to reflect the actual naming of the existing alternate glyph.[Edit: wow, the “code” formatting on this site is seriously borked. And the inaccurate previewing doesn’t help.]3
-
Good point, Kent. But whichever method is chosen, don’t forget to include an exception for AI!0
-
That's a good point normally, but since they are only setting in caps, maybe not necessary in this case.0
-
Thank you for all the help.
I used FontCreator to import the fea file and used:
languagesystem latn dflt;
languagesystem DFLT dflt;
@letters = [A-Z];
feature calt { # Contextual Alternates feature
sub @letters I' by I.unbarred;
} calt;
I can toggle the calt feature for the font on and off in photoshop but it is not working in illustrator. Nick, is that what you meant by an exception for AI? Is there something else I need to add or some setting that Illustrator cares about?
0 -
No, I meant Artificial Intelligence.
But perhaps not a problem for all-cap setting.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