Adding OpenType Features Using FontCreator 7

Before asking a question on FontCreator look here for possible solutions and tutorials. Please do not post support requests here.
Post Reply
Bhikkhu Pesala
Top Typographer
Top Typographer
Posts: 9891
Joined: Tue Oct 29, 2002 5:28 am
Location: Seven Kings, London UK

Adding OpenType Features Using FontCreator 7

Post by Bhikkhu Pesala »

FontCreator now has built-in support for scripts to add OpenType features. The Professional Edition (but not the Standard Edition) can import scripts from existing fonts, which lets you see how features are designed. The Home Edition can add a default set of features. Home Edition users can add custom features using the OpenType Compiler as explained in the Adding OpenType Features Tutorial thread.

Please see the help file for Syntax Help

The built-in editor has line numbering, and can be customised to use a font and colours of your choice. The font size can also be zoomed directly using the mouse scroll-wheel.
OpenType Layout Features.png
OpenType Layout Features.png (44.79 KiB) Viewed 13480 times
Although there is a lot to learn about OpenType features, once you have created a script to suit your fonts, its a simple process to build an OpenType font from a TrueType version. If there are any syntax errors in compiling a script, the messages will help you to debug your script or fix the glyph names in your fonts to match the script. As with all coding, syntax has to be 100% correct — miss a semicolon, or use the wrong capitalisation, and the script will fail to run. Below are a few examples of features you might like to add. My scripts use meaningful glyph names to make them easier to read and edit — they will need editing if you want to use the glyph names generated by FontCreator.

<Omit the comments in angled brackets>.

Standard Ligatures

feature Ligatures liga { <Feature name and OpenType layout tag “liga”.>
lookup ligaSub; <Lookup table to use for this feature.>
} lookup ligaSub { <Feature definition is {within braces}, lookup table name, { begins lookup>

sub f f i -> ffi; <If user types f, f, i, then substitute ligature ffi.>
sub f f l -> ffl; <“f” and “l” are the glyph names for lowercase “f” and “l”.>
sub f f -> ff; <“ff” is the glyph name for the ligature “ff”.>
sub f i -> fi; <If user types f, i, then substitute ligature fi.>
sub f l -> fl; <If user types f, l, then substitute ligature fl.>
} <End of lookup table. Lookup table is within {braces}.>

Scientific Inferiors
OpenType Lookup Table.png
OpenType Lookup Table.png (35.98 KiB) Viewed 13480 times
feature ScientificInferiors sinf { <Feature definition, layout tag>
lookup ScientificInferiors;
lookup ScientificInferiors {
sub zero -> zero.sinf; <If user types 0 substitute a scientific inferior zero.>
sub one -> one.sinf; <“one.sinf” is the glyph name of the glyph to substitute.>
sub two -> two.sinf; <“two” is the default glyph name for digit 2.>
sub three -> three.sinf; <“.sinf” is the name suffix I chose for scientific inferiors>.
sub four -> four.sinf; <There is no rule that says one must use the feature tag as a suffix.>
sub five -> five.sinf; <It is just a convention that makes the script easier to understand.>
sub six -> six.sinf;
sub seven -> seven.sinf;
sub eight -> eight.sinf;
sub nine -> nine.sinf;
sub plus -> plus.sinf;
sub minus -> minus.sinf;
sub equal -> equals.sinf;
sub parenleft -> parenleft.sinf;
sub parenright -> parenright.sinf; <Substitute a subscripted right parenthesis.>


feature Ordinals ordn { <Feature name and layout tag.>
lookup Ordinals;
group @Ordinals [zero one two three four five six seven eight nine A.sups B.sups C.sups D.sups E.sups F.sups G.sups H.sups I.sups J.sups K.sups L.sups M.sups N.sups O.sups P.sups Q.sups R.sups S.sups T.sups U.sups V.sups W.sups X.sups Y.sups Z.sups a.sups b.sups c.sups d.sups e.sups f.sups g.sups h.sups i.sups j.sups k.sups l.sups m.sups n.sups o.sups p.sups q.sups r.sups s.sups t.sups u.sups v.sups w.sups x.sups y.sups z.sups]; <Glyphs to be followed by ordinals.>
group @Alphas [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 i j k l m n o p q r s t u v w x y z]; <Glyphs to be used as ordinals.>

lookup Ordinals{
context (@Ordinals) @Alphas; <If alpha glyph follows a glyph in ordinals, then …>
sub 0 Super; <In the above context, use this lookup table.>
} lookup Super {
sub A -> A.sups; <If user types A after a digit or after an ordinal substitute superscript A.>
…. <Repeat sub line for A through to Z and a to z, and more if required, e.g. è ú etc.>
sub Z -> Z.sups;
sub a -> a.sups;
sub z -> z.sups;

This contextual lookup Ordinals feature first checks to see if the previous character is a digit or a superscript (i.e. if it is included in the Group @Ordinals). If it is, then it checks to see if an alpha character is typed next (i.e. if it is included in the Group @Alphas). If not it does nothing, so 123 remains as usual. However if the user types 1s, the Ordinals feature superscripts the s. If the user continues to type “t” or any other alpha characters, they are all superscripted. However, as soon as the user types a space, or some punctuation, any following characters are normal again.

Ordinals in Adobe fonts (e.g. SourceSansPro) and Microsoft fonts (e.g. Calibri) are implemented differently. If the user types a digit or lowercase alpha character and the Ordinals feature is enabled, all are substituted with superscripts. You can decide how you want to implement this feature, but I recommend the former method because it means that the ordinals feature can be enabled as part of the paragraph style for body text, and then ordinals are automatic.

Stylistic Sets
feature StylisticAlternates salt { <Feature name and tag.>
lookup StylisticAlternates;
} lookup StylisticAlternates {
sub asterisk -> [asterisk asteriskmath uni2051 uni2042 uni203B];
sub plus -> [plus uni2795 uni271A uni271B uni271C];
sub at -> [at uni260E uni260F uni2121 uni213B];
sub copyright -> [copyright uni2117 uniF000 estimated uni2139];
sub multiply -> [multiply uni2715 uni2716 uni2717 uni2718];
sub dagger -> [dagger uni2622 uni2623 uni26A1 uni2620];
sub daggerdbl -> [daggerdbl uni26A0 uni2691 uni26B0 uni26B1];
sub bullet -> [bullet uni204D uni2023 uni2767 uni2712];
sub circle -> [circle fullmoon waninggibbousmoon lastquartermoon waningcrescentmoon];
sub blackcircle -> [blackcircle newmoon waxingcrescentmoon firstquartermoon waxinggibbousmoon];
sub uni2600 -> [uni2600 sunrise uni26C5 uni2602 uni2603];

This feature requires intervention by the user. After selecting an asterisk, the user can choose from any of the five symbols from asteriskmath to Unicode character 273B, which is a Dingbat. If the user selects a plus sign they can choose from a different set of five cross-like symbols.

For each “sub” line the first glyph is repeated, which is Stylistic Set 0 (the original glyph), followed by five alternative glyphs for the user to choose from. You may add up to 99 Stylistic sets.
My FontsReviews: MainTypeFont CreatorHelpFC15 + MT12.0 @ Win 10 64-bit build 19045.2486
Post Reply