Automatic Crossbar I: Difference between revisions
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..." |
No edit summary |
||
Line 2: | Line 2: | ||
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. | 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. | ||
== Fonts That Have It Already == | |||
Some fonts have it already (most of the CC/Comicraft fonts are like this), and others have existing modifications that add it. Some of these modifications may be found on the [https://yuri-project.net/tools/fonts Fonts section of the scanlation tools website]; notably | |||
* '''CantonCat''' adds support to [https://www.dafont.com/chinacat.font Chinacat]; | |||
* '''Halogen 2''' adds support to [https://www.dafont.com/halogen.font Halogen]; | |||
* '''Patrick Hand 2''' adds support to [https://fonts.google.com/specimen/Patrick+Hand Patrick Hand]; | |||
* '''Swanky and Moo Moo 2''' adds support to [https://fonts.google.com/specimen/Swanky+and+Moo+Moo Swanky and Moo Moo]. | |||
== FontForge == | == FontForge == |
Latest revision as of 16:55, 5 December 2024
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.
Fonts That Have It Already[edit]
Some fonts have it already (most of the CC/Comicraft fonts are like this), and others have existing modifications that add it. Some of these modifications may be found on the Fonts section of the scanlation tools website; notably
- CantonCat adds support to Chinacat;
- Halogen 2 adds support to Halogen;
- Patrick Hand 2 adds support to Patrick Hand;
- Swanky and Moo Moo 2 adds support to Swanky and Moo Moo.
FontForge[edit]
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.
- Set the default “I” glyph to the crossbar version, and set non-crossbar I to something like the bar character.
- Go to “Element” → “Font Info” (or press Ctrl+Shift+F) and click on “Lookups” in the sidebar. You should remain on the “GSUB” tab.
- Click on “Add Lookup” and make a single substitution, with no features. We call it “uncrossbar”.
- 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.
- Add another lookup, but this time have it be a Contextual Chaining Substitution. Add the features
RQD
andclig
(note that there is a space at the start inRQD
; alternatively, select it from the dropdown). Just addingRQD
makes it work in most programs, but it only works in Photoshop CS6 if you also useclig
. - Add a subtable to this new substitution. Select “By Classes” and “Complex”.
- 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. - 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.
- 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”.
- Go to “File” → “Print” or press Ctrl+P to test your changes. Ensure that strings like “III”, “I”, “It”, “HI”, etc all work correctly.
- 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.
- 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[edit]
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[edit]
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”);
- 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.