Adding OpenType features
Posted: Mon Jan 14, 2008 8:27 pm
¡Hola!
I have found an easy way to add OpenType features to a font created with FontCreator. All you need is your TrueType font file, which must contain Postscript names. Look at Format → Post... in FontCreator; if there are no Postscript names yet, FC can even generate them automatically. You can choose them freely (but they should be unique). They are needed for identifying the glyphs in the OpenType script (see below).
Next you get the OpenType Compiler from http://home.kabelfoon.nl/~slam/fonts/otcomp.html (it's free). Basically it works like this:
- Let's say your font is YourFont.ttf
- Open a text editor (preferably one displaying line numbers for easier debugging) and write your OpenType script, let's call it YourFont.ot
- Compile the script: Type »otcomp YourFont.ot« in the console (provided that both the Compiler and the script are in the current directory).
- If there were no errors, the file YourFont.otf was created (the name is specified in the script). Test it with the TrueTypeViewer (http://home.kabelfoon.nl/~slam/fonts/tr ... iewer.html), which allows you to enable or disable every single feature, so you can easily watch the effect.
For everyone who has ever used e.g. a C compiler, this is totally familiar. The .ttf file stays unchanged, so you can always edit the script and simply run the compiler again. On the other hand, you can use the same script for multiple font files, e.g. for different versions or different styles of your font.
There are a lot of great things you can do with an OpenType script:
- Place combining diacritical marks correctly, even as a stack on top of each other
- Remove the dot from i and j when a mark is placed on top
- Use ligatures, e.g. replace f + i by fi.
- Provide alternative glyphs, e.g. old style numerals or different forms of & or ß.
- Replace a glyph by a context-specific one, e.g. isolated/initial/medial/final forms of Arabic letters.
- Add new styles to your font, e.g. small caps.
- Kerning can be done a lot easier than with FontCreator, because you can use groups of characters (e.g. »down-pointing triangle-shaped letters« containing V, W, Y, Ẅ, Ẃ, Ý, Ỳ, Ỹ, ...), and you are not limited to 10,000 kerning pairs (which is not even enough for the Latin script, if you provide all the precomposed letters with marks). Additionally, you can also adjust the glyphs vertically.
There are a lot more features, but these mentioned above are the ones of which I know what they are useful for.
For the syntax of the OpenType script see the tutorial at http://home.kabelfoon.nl/%7Eslam/fonts/ ... ction.html
Again, this looks totally familiar to everyone who has ever written a program in a language like C. Basically, it looks like a set of functions containing function calls.
Yet, I have tested using ligatures like fi, removing the dot from i and j and placing diacritical marks in my font Quivira. The result looks great:
Any downsides?
First, this will mean a damn lot of script writing for a large Unicode font like mine. But I think it's worth the effort.
Second, not every writing program supports every feature, e.g. in my tests MS Word 2003 removed the dot from i and j and placed the marks correctly, but did not use the ligatures. I guess it's a matter of time until the important features are supported in the widespread programs (or maybe this is just an expert option somewhere ).
Third and worst of all, Word doesn't display the characters of plane 1 any more. In the TrueTypeViewer and the BabelMap they look as before. But the font Doulos SIL has a Plane-1-character that works in Word, so the problem must be solvable. I hope it is not a bug in this compiler. If you have an idea, please tell me!
In the end I think this program is a phantastic addition to FontCreator, enabling us to create much more professional-looking fonts. There is also a tool for hinting (http://home.kabelfoon.nl/~slam/fonts/tticomp.html), but I haven't tested it yet.
Kind regards,
Længlich
I have found an easy way to add OpenType features to a font created with FontCreator. All you need is your TrueType font file, which must contain Postscript names. Look at Format → Post... in FontCreator; if there are no Postscript names yet, FC can even generate them automatically. You can choose them freely (but they should be unique). They are needed for identifying the glyphs in the OpenType script (see below).
Next you get the OpenType Compiler from http://home.kabelfoon.nl/~slam/fonts/otcomp.html (it's free). Basically it works like this:
- Let's say your font is YourFont.ttf
- Open a text editor (preferably one displaying line numbers for easier debugging) and write your OpenType script, let's call it YourFont.ot
- Compile the script: Type »otcomp YourFont.ot« in the console (provided that both the Compiler and the script are in the current directory).
- If there were no errors, the file YourFont.otf was created (the name is specified in the script). Test it with the TrueTypeViewer (http://home.kabelfoon.nl/~slam/fonts/tr ... iewer.html), which allows you to enable or disable every single feature, so you can easily watch the effect.
For everyone who has ever used e.g. a C compiler, this is totally familiar. The .ttf file stays unchanged, so you can always edit the script and simply run the compiler again. On the other hand, you can use the same script for multiple font files, e.g. for different versions or different styles of your font.
There are a lot of great things you can do with an OpenType script:
- Place combining diacritical marks correctly, even as a stack on top of each other
- Remove the dot from i and j when a mark is placed on top
- Use ligatures, e.g. replace f + i by fi.
- Provide alternative glyphs, e.g. old style numerals or different forms of & or ß.
- Replace a glyph by a context-specific one, e.g. isolated/initial/medial/final forms of Arabic letters.
- Add new styles to your font, e.g. small caps.
- Kerning can be done a lot easier than with FontCreator, because you can use groups of characters (e.g. »down-pointing triangle-shaped letters« containing V, W, Y, Ẅ, Ẃ, Ý, Ỳ, Ỹ, ...), and you are not limited to 10,000 kerning pairs (which is not even enough for the Latin script, if you provide all the precomposed letters with marks). Additionally, you can also adjust the glyphs vertically.
There are a lot more features, but these mentioned above are the ones of which I know what they are useful for.
For the syntax of the OpenType script see the tutorial at http://home.kabelfoon.nl/%7Eslam/fonts/ ... ction.html
Again, this looks totally familiar to everyone who has ever written a program in a language like C. Basically, it looks like a set of functions containing function calls.
Yet, I have tested using ligatures like fi, removing the dot from i and j and placing diacritical marks in my font Quivira. The result looks great:
Any downsides?
First, this will mean a damn lot of script writing for a large Unicode font like mine. But I think it's worth the effort.
Second, not every writing program supports every feature, e.g. in my tests MS Word 2003 removed the dot from i and j and placed the marks correctly, but did not use the ligatures. I guess it's a matter of time until the important features are supported in the widespread programs (or maybe this is just an expert option somewhere ).
Third and worst of all, Word doesn't display the characters of plane 1 any more. In the TrueTypeViewer and the BabelMap they look as before. But the font Doulos SIL has a Plane-1-character that works in Word, so the problem must be solvable. I hope it is not a bug in this compiler. If you have an idea, please tell me!
In the end I think this program is a phantastic addition to FontCreator, enabling us to create much more professional-looking fonts. There is also a tool for hinting (http://home.kabelfoon.nl/~slam/fonts/tticomp.html), but I haven't tested it yet.
Kind regards,
Længlich