Automatic Crossbar I

From Yuri Project
Revision as of 16:48, 5 December 2024 by Valence (talk | contribs) (Created page with "A font is said to have '''automatic crossbar I''' if it ensures that “I”s have a crossbar when they are alone, but do not have a crossbar when they are next to another letter. This page instructs how to add crossbar I to fonts that do not have it. Be aware that making modifications to fonts that are not licensed under a copyleft, public domain or permissive license (such as the [https://openfontlicense.org/ Open Font License / OFL]) violates copyright. == FontForg...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A font is said to have automatic crossbar I if it ensures that “I”s have a crossbar when they are alone, but do not have a crossbar when they are next to another letter.

This page instructs how to add crossbar I to fonts that do not have it. Be aware that making modifications to fonts that are not licensed under a copyleft, public domain or permissive license (such as the Open Font License / OFL) violates copyright.

FontForge

FontForge is a free and open source piece of software for editing fonts. Unfortunately, it can’t handle fonts using newer features, like variable fonts, but basic fonts work fine.

  1. Set the default “I” glyph to the crossbar version, and set non-crossbar I to something like the bar character.
  2. Go to “Element” → “Font Info” (or press Ctrl+Shift+F) and click on “Lookups” in the sidebar. You should remain on the “GSUB” tab.
  3. Making the uncrossbar substitution
    Click on “Add Lookup” and make a single substitution, with no features. We call it “uncrossbar”.
  4. Adding a subtable to the uncrossbar substitution
    Select this substitution and click on “Add Subtable”. This substitution converts crossbar into non-crossbar I, so the base glyph is our crossbar “I” character, and the replacement is the non-crossbar I.
  5. Adding the uncrossbar-rules lookup
    Add another lookup, but this time have it be a Contextual Chaining Substitution. Add the features RQD and clig (note that there is a space at the start in RQD; alternatively, select it from the dropdown). Just adding RQD makes it work in most programs, but it only works in Photoshop CS6 if you also use clig.
  6. Adding a subtable to the uncrossbar-rules substitution
    Add a subtable to this new substitution. Select “By Classes” and “Complex”.
  7. In the “Match Classes” section, add a class whose name is “letter” and whose contents is every letter in the font except capital I: A B C D E F G H J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z. You may want to add more for accented letters. Add another class whose name is “I” and whose contents is capital I.
  8. Add a new “Matching rule based on a list of classes” in the top half of the dialog. In the “Match” section, list “I” as the class name, and add the simple substitution “uncrossbar” to the applied lookups. In the “Backtrack” section, list “I” as the class name.
  9. All the matching rules
    Do it again, except in the “Backtrack” section, list “letter” as the class name. Do it twice more, except using the “Lookahead” section instead of the “Backtrack” section. By the end, you should have four rules as follows. Select “OK”.
  10. Testing automatic crossbar I
    Go to “File” → “Print” or press Ctrl+P to test your changes. Ensure that strings like “III”, “I”, “It”, “HI”, etc all work correctly.
  11. You might want to change the name of the font, so it’s clear it’s a modified version. You can do this in the “PS Names” and “TTF Names” sections of the Font Info dialog.
  12. Now you can export your font. Go to “File” → “Generate Fonts” (or Ctrl+Shift+G), choose where you want to save it, and click “Generate”. Warnings will likely pop up; you can ignore these and click “Generate” again.

For Uppercase Fonts

The process for uppercase fonts is father similar; the only part of interest is the “letter” match class, which should use every letter except lowercase “I” instead: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h j k l m n o p q r s t u v w x y z.

When Non-Crossbar is the Default

The instructions above assume that the default glyph for I is crossbar, and the non-crossbar version is given as the bar character. However, one can do it the other way around. The main differences are that

  • the single substitution lookup should be called “crossbar” instead of “uncrossbar”, and the contextual chaining substitution should be called “crossbar-rules” instead of “uncrossbar-rules” (this doesn’t affect the process itself, but it’s good to give them accurate names);
  • when adding the matching rules, the single substitution (which is now named “crossbar”) shouldn’t be applied in the “An ordered list of lookups and positions” section; in fact, nothing should be applied there ( FontForge will give you a warning about this, but one may click through with “OK”);
  • The result after following this step
    a final matching rule must be added at the end (the order is important) whose match is “I” and with no backtracks or lookaheads – here the “crossbar” single substitution in the “An ordered list of lookups and positions” section can finally be used.