Page 1 of 1

Working with OTLFD Scripts

Posted: Thu Feb 04, 2016 9:32 am
by Bhikkhu Pesala
What is an OTLFD script? The file extension is short for Open Type Layout Feature Definition, and is used by FontCreator's OpenType Designer. The scripts can be edited in Notepad or a similar text editor.

FontCreator 9.0 or later versions include the Visual OpenType Designer so that users don't need to do so much coding, but the Code Editor is still present for those who prefer to work with code.

Harmonising OpenType Features Between Font Styles

After adding, editing, and ordering the OpenType Features and Lookups for one type style, there's no need to repeat the work for other styles in the same font family. (This assumes that all styles in the same font family have the same glyphs, with the same glyph names. If this is not the case, the Code Editor compiler will report errors such as glyph not found, and will not compile. Warnings, e.g. about unused Kerning Classes can be ignored).

After completing work on the Regular style:-

Export the Script
Export Script.png
Export Script.png (11.29 KiB) Viewed 5064 times
Switch to another style. Since the Italic style may have different kerning values to the Regular style, first one should copy the kerning pair adjustment lookup for the Italic style.

Open Pair Adjustment Lookup in Code Editor
Edit Lookup in Code Editor.png
Edit Lookup in Code Editor.png (47.36 KiB) Viewed 5064 times
Select All (Ctrl A), and Copy (Ctrl C). Do take care that you're not pressing Ctrl V by accident!

Import the Script
Import Script.png
Import Script.png (13.68 KiB) Viewed 5064 times
Confirm Overwrite
Confirm Overwrite.png
Confirm Overwrite.png (21.55 KiB) Viewed 5064 times
Don't worry, changes won't be lost until you save the font project, so you can check that it works correctly before saving the changes.

Open Pair Adjustment for Imported Script
Edit Lookup in Code Editor.png
Edit Lookup in Code Editor.png (47.36 KiB) Viewed 5064 times
Select All (Ctrl A) and paste the lookup back again from the clipboard (Ctrl V). Again, take care that you're not pressing Ctrl C.

OK to save the changes, and verify the script, before saving the updated Font Project.

Repeat for all of the other styles in the Font Family.

Code Editor Compiler Warnings

Posted: Thu Feb 04, 2016 10:36 am
by Bhikkhu Pesala
Compile Warning.png
Compile Warning.png (4.12 KiB) Viewed 5058 times
Warnings like these won't prevent the OpenType Layout Feature Definition script from compiling successfully.

All these warning mean is that I defined some kerning classes that are used in other types styles, but not in the current style (bold italic).

A look in the Class Manager highlights the unused classes. They may be deleted, but they can be left in case they are wanted later. They do no harm.
Unused Classes.png
Unused Classes.png (2.17 KiB) Viewed 4000 times

Search Selected Text

Posted: Thu Feb 04, 2016 10:43 am
by Bhikkhu Pesala
The Ctrl F Shortcut can be used in the Code Editor to find further occurrences of the selected text.
Searching Selected Text.png
Searching Selected Text.png (49.04 KiB) Viewed 5056 times
I name my lookups the same as the features that use them to make searching easier. The default names are based on the lookup types.

Setting Preferences for the Code Editor

Posted: Sun Nov 13, 2016 6:21 am
by Bhikkhu Pesala
After reinstalling FontCreator, I found the font too small for comfort in the Code Editor. At the top right of the Code Editor is a button to change the settings. Here, the default font, and colours can be changed to suit your personal preferences. Any available monospaced fonts are listed.
Code Editor Font.png
Code Editor Font.png (60.98 KiB) Viewed 4352 times

Re: Working with OTLFD Scripts

Posted: Sun Nov 13, 2016 2:52 pm
by MikeW
Those options are not present in my version of FC Pro 10.

Re: Working with OTLFD Scripts

Posted: Sun Nov 13, 2016 4:01 pm
by Bhikkhu Pesala
MikeW wrote:Those options are not present in my version of FC Pro 10.
Probably, you're looking in the wrong place. Open the Code Editor after opening the OpenType Designer dialogue. Click the icon at top right to change the settings. The settings are there in both FC10 build 2125 and FC9.

Re: Working with OTLFD Scripts

Posted: Wed Nov 30, 2016 7:26 pm
by Bhikkhu Pesala
Regenerating Kerning Pairs
Instead of copying the kerning adjustment pairs lookup for the Italic style before importing the OTLFD script for the Regular style, one can simply regenerate the adjustment pairs. One might also want to do this if the kerning is too tight or too loose.

Right-click on the Kerning adjustment pair lookup in the OpenType Designer, and select Autokern from the context menu.
Autokern.png (25.89 KiB) Viewed 4303 times
This will open the Automatic Kerning Wizard dialogue, where you can change how tight the calculated kerning will be by adjusting the Glyph Spacing Value. To make the kerning more generous, the second row of Preview Text should be longer than the top row (the current spacing). If it is not, increase the glyph spacing value, and update the preview. Try with different preview text too. When you click on Finish, FontCreator will generate the kerning adjustment pairs, which may take a few minutes on large fonts.
Glyph Spacing Factor.png
Glyph Spacing Factor.png (69.19 KiB) Viewed 4303 times
When the process is finished. Scroll down the list of kerning pairs looking for any that are Blue or Red. Some fonts need to have positive kerning pairs — it's not an error — but the blue pairs often need manual adjustment.
Positive Kerning Values.png
Positive Kerning Values.png (3.74 KiB) Viewed 4303 times
If the Green (negative pairs) all need adjustment because they are too tight or too loose, run the Kerning Wizard again with a different Glyph Spacing Value. Red pairs are zero and won't be exported. They can be left or deleted as you wish.

Re: Working with OTLFD Scripts

Posted: Thu Dec 01, 2016 9:46 am
by Dave Crosby
Wonderful! That simple little Font Creator I purchased for $35 in 2004 has become a World Leader!