FontLab Forum
2012-05-22, 07:48:52 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the FontLab forum, read how to use it! Update: Archives from old MSN forums are now available on our forum.
 
   Home   Help Search Calendar Downloads Tags Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot

Pages: [1]
  Print  
Author Topic: Problem with kerning in Fontographer 5  (Read 7023 times)
Alex Petrov (FontLab)
Tech Support, Fontlab Ltd.
Global Moderator
Hero Member
*****

Karma: +6/-1
Russian Federation Russian Federation

Posts: 470



WWW
« on: 2010-10-15, 08:59:41 »

There is a severe bug in Fontographer 5 which makes all plain kerning messed up in the generated OpenType PS fonts. Here is a workaround allowing to generate correct OpenType GPOS kerning instead of wrong old-style 'kern' table.

The steps are as follows:

1. Open your fog file in Fontographer and export metrics choosing to export only kerning to .afm file (File > Export > Metrics).
2. Open the exported afm file in e.g. MS Word and delete ALL THE CODE before and after the pair kerning including font info and char metrics.
3. Now you have a list of kerning pairs with "KPX" at the beginning of every line.
4. Find/replace all "KPX" commands with "pos".
5. Add ";" at the end of every line with pos command.
6. Then put these 3 lines:

feature kern { # Kerning
 # Latin
lookup kern1 {

at the beginning of the file and these four lines:

} kern1;
script DFLT; # Default
lookup kern1;
} kern;

at the end.

7. Save the file with .fea extension to the same folder where the fog file reside.
8. Save the fog file with kerning as well if not saved yet.
9. Remove all kerning by choosing Metrics > Clear Kerning to not let Fontographer generate wrong 'kern' table.
10. Now choose File > Generate Font Files, select OpenType (.otf) font format and click on Format Options in the Advanced mode. Choose the "Use External file (AFDKO .fea syntax)" option.
11. Click on the Change button to select your new .fea file if not yet selected.
12. Click on OK and then on Generate to export the font in OTF format.
13. Close your fog file without saving to keep plain kerning in the file. Or you may save without kerning and import it later from the saved .afm file.


Here is the contents of sample .fea file with 2 kerning pairs:

feature kern { # Kerning
 # Latin
lookup kern1 {
pos A W -20;
pos W A -20;
} kern1;
script DFLT; # Default
lookup kern1;
} kern;
« Last Edit: 2011-02-10, 10:46:59 by Alex Petrov (FontLab) » Logged
th
Sr. Member
****

Karma: +0/-0
Germany Germany

Posts: 7


« Reply #1 on: 2010-12-12, 23:07:54 »

Will there be a patch or is this workaround to stay until Fontographer 6?
Logged
Alex Petrov (FontLab)
Tech Support, Fontlab Ltd.
Global Moderator
Hero Member
*****

Karma: +6/-1
Russian Federation Russian Federation

Posts: 470



WWW
« Reply #2 on: 2010-12-13, 16:24:29 »

The problem with kerning table will be fixed in 5.0.1. But OT GPOS kerning still have to be prepared in the external feature file.
Logged
th
Sr. Member
****

Karma: +0/-0
Germany Germany

Posts: 7


« Reply #3 on: 2010-12-15, 09:54:07 »

The problem with kerning table will be fixed in 5.0.1. But OT GPOS kerning still have to be prepared in the external feature file.

GPOS kerning is only mentioned in the Fontographer manual on page 352 (where it is explicitly stated that it has to be done externally), is it? All those kerning things (pair kerning, auto kerning, kerning assistance, advanced auto kerning) work in another way, right.

That's pair kerning and what you mentioned is class-based and contextual kerning, correct?

So everything the manual describes will be possible in the patch release, right (and are already possible with the workaround)?

Sorry if the answer seems obvious, but I'm not really acquainted with these finer points of kerning and its terminology.
Logged
Alex Petrov (FontLab)
Tech Support, Fontlab Ltd.
Global Moderator
Hero Member
*****

Karma: +6/-1
Russian Federation Russian Federation

Posts: 470



WWW
« Reply #4 on: 2010-12-16, 11:22:58 »

Yes, you are correct. All those kerning things are working now but the exported (old-style) kerning table appears to be broken in the exported font. This will be fixed.
On the other hand OpenType GPOS kerning (which can be class-based or just a list of glyph pairs) can be defined in the external file and can replace the old-style kerning in most cases. Surely it will work only in OpenType-aware applications.
Logged
th
Sr. Member
****

Karma: +0/-0
Germany Germany

Posts: 7


« Reply #5 on: 2010-12-16, 11:51:51 »

Yes, you are correct. All those kerning things are working now but the exported (old-style) kerning table appears to be broken in the exported font. This will be fixed.
On the other hand OpenType GPOS kerning (which can be class-based or just a list of glyph pairs) can be defined in the external file and can replace the old-style kerning in most cases. Surely it will work only in OpenType-aware applications.

Thanks!
Logged
Maliphant
Jr. Member
**

Karma: +0/-0
United States United States

Posts: 1


Email
« Reply #6 on: 2011-02-18, 14:16:02 »

How can you justify a $125 upgrade for an unfinished product?

I have to perform 14 steps of workaround and mess around with code? Are you serious!?

Outrageous! I want my money back until this is fixed.

I'm going back to 4.7.
Logged
jgroshell
Full Member
***

Karma: +0/-0
United States United States

Posts: 2


Email
« Reply #7 on: 2011-03-30, 20:24:29 »

I followed your instructions exactly, but it keeps giving me the error:

Cannot Generate font.
Opentype font cannot be generated due to error in feature-definition file.

I tried creating a test.fea file containing just the sample code:

feature kern { # Kerning
 # Latin
lookup kern1 {
pos A W -20;
pos W A -20;
} kern1;
script DFLT; # Default
lookup kern1;
} kern;

and it still gives me the error. I also tried a different .fea file I have for substituting ligatures and that outputs fine. So there must be some sort of error in this "kern" routine.

thanks for your assistance,

JG
Logged
Alex Petrov (FontLab)
Tech Support, Fontlab Ltd.
Global Moderator
Hero Member
*****

Karma: +6/-1
Russian Federation Russian Federation

Posts: 470



WWW
« Reply #8 on: 2011-03-31, 07:33:27 »

I followed your instructions exactly, but it keeps giving me the error:

Cannot Generate font.
Opentype font cannot be generated due to error in feature-definition file.

I tried creating a test.fea file containing just the sample code:

The code looks good but there can be invisible symbols in the file which do not allow to compile it. I noticed the same problem when I edited the code with TextEdit. You are better to check and re-save the code with e.g. MS Word.
Logged
k.l.
SIG: XFO
Hero Member
***

Karma: +3/-0
Germany Germany

Posts: 21


« Reply #9 on: 2011-04-19, 11:06:40 »

Try placing script/language declarations outside of the feature definition. (If other features address other script/language combinations too, you need to add more languagesystem statements accordingly.)

languagesystem DFLT dflt;
languagesystem latn dflt;

feature kern {
lookup kern1 {

pos A W -20;
pos W A -20;

} kern1;
} kern;
Logged
picardy3rd
Jr. Member
**

Karma: +0/-0
United Kingdom United Kingdom

Posts: 1


« Reply #10 on: 2011-06-25, 08:31:42 »

Hi there,

I'm entirely new to font creation and have been having the same problem trying to generate an OpenType PS font with Fontographer 5.  I've followed all the steps suggested by Alex Petrov and have also tried 'placing script/language declarations outside the feature definition' as recommended by k.l., but without success.  I always get the same: 

Cannot generate font.
Opentype font cannot be generated due to error in feature-definition file.

Is there anything else I could try? 

Just so you know, I'm working on a mac, the encoding I've used is OpenType Standard and my .fea file has been created with MS Word.

Many thanks,
A

Logged
Alex Petrov (FontLab)
Tech Support, Fontlab Ltd.
Global Moderator
Hero Member
*****

Karma: +6/-1
Russian Federation Russian Federation

Posts: 470



WWW
« Reply #11 on: 2011-06-27, 05:25:02 »


Is there anything else I could try? 


Send your fog and fea files to support@fontlab.com.
Logged
Alex Petrov (FontLab)
Tech Support, Fontlab Ltd.
Global Moderator
Hero Member
*****

Karma: +6/-1
Russian Federation Russian Federation

Posts: 470



WWW
« Reply #12 on: 2011-07-14, 08:45:37 »

The problem is now fixed in version 5.1. Please get the update.
Logged
Tags:
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!