FontLab Forum
2012-02-09, 03:53:02 *
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: Encoding problems in FDK-generated font  (Read 4214 times)
Jens
Beta: FontLab Studio Mac
Hero Member
***

Karma: +0/-0
Germany Germany

Posts: 23


WWW
« on: 2009-05-06, 08:26:19 »

Hi!

I generated an OT-CFF font with FDK 2.5 and noticed that some keystrokes like ü, ö, ä, ß are mapped to a wrong glyph.

My command line is:

Code:
makeOTF25.exe -f MyFont.pfa -o MyFont.otf -ff MyFont.fea -mf MyFont.fmndb -gf MyFont.goadb -r -osv 4 -osbOn 7 -osbOn 8 -osbOff 9

I dumped the font using ttx.py from FontTools and compared it to a working font I generated with FontLab Studio 5.04. The biggest notable difference is that the correct font has this entry in the CFF table:

Code:
<Encoding name="StandardEncoding"/>

while in the FDK-generated font that part looks like this:

Code:
<Encoding>
        <map code="0x0" name=".null"/>
        <map code="0xd" name="CR"/>
        <map code="0x20" name="space"/>
        <map code="0x21" name="exclam"/>
        <map code="0x22" name="quotedbl"/>
        <map code="0x23" name="numbersign"/>
...
Code:
<map code="0xdf" name="Thorn"/>
        <map code="0xe0" name="germandbls"/>
        <map code="0xe1" name="agrave"/>
        <map code="0xe2" name="aacute"/>
        <map code="0xe3" name="acircumflex"/>
        <map code="0xe4" name="atilde"/>
        <map code="0xe5" name="adieresis"/>
        <map code="0xe6" name="aring"/>
...

Note that in the beginning the mapping is correct, but in the lower part it is off by one (starting at
Code:
<map code="0xae" name="registered"/>
<map code="0xb0" name="macron"/>
) which explains the keystrokes resulting in wrong glyphs.

I'm not sure why the Encoding part is there at all instead of just using the "StandardEncoding", and why the mapping turns out wrong. Is this a bug in FDK or am I missing some option? In my goadb file the unicodes are correct.

I've attached the complete beginning of the CFF table to this post in case it is relevant.

Thanks for any ideas,
Jens
« Last Edit: 2009-05-06, 08:30:24 by Jens » Logged
Read Roberts (Adobe)
Moderator
Hero Member
*****

Karma: +6/-0
United States United States

Posts: 27

Fontlab Studio 5.0.4, built 2741, Mac OX 10.5


Email
« Reply #1 on: 2009-05-06, 11:26:48 »

It sounds like you  have found two levels of bugs in the FDK. The first I was aware of, is that the work flow within makeotf 2.5 now uses the tx tool, and the tx tool will in some cases  convert a font whose Encoding vector is set to StandardEncoding to a custom encoding array. I haven't reported this because the custom array is equivalent to the StandardEncoding vector and in any case, the Encoding key value in a CFF table is supposed to be ignored entirely.

However, I learn from your e-mail that the conversion from StandardEncoding to a custom error may be wrong in some cases, so that the custom array is not equivalent to StandardEncoding.

You should be able to work around this issue by making sure that the glyphs in your source pfa file are in the order specified by the StandardEncoding definition: the case where the conversion happens is the source font does have all the StandardEncoding glyph names, but not the order. Also, a new build of the FDK will be out in a few days which does not cause the change in the Encoding value.

I am also very troubled by your comment that you get the wrong glyphs from keystrokes. This should absolutely not happen, as the CFF encoding is ignored in the context of an OTF, both by specification and in practice - only the cmap table encoding is used, and this specified by the GOADB. This makes me wonder if something more complicated is going on. Can you send me a copy of the build data for this font? I do need the features files and the GOADB file. I do not need the font.pfa if you can send me the dump from 'tx -mtx font.pfa", as I can use that to rearrange a test font with the same glyph names and glyph order.

Regards,
  Read Roberts
Logged
Read Roberts (Adobe)
Moderator
Hero Member
*****

Karma: +6/-0
United States United States

Posts: 27

Fontlab Studio 5.0.4, built 2741, Mac OX 10.5


Email
« Reply #2 on: 2009-07-09, 14:00:14 »

FYI: in  FDK build 2140 ( makeotf lib 2.0.21325), the  CFF Encoding vector in a OpenType font is indeed written incorrectly, by makeotf with an off-by-one error, just as described by Jens, when the source Type1 font has a set of glyphs that meet the requirements for a Type 1 StandardEncoding vector, but does not meet the requirements for a CFF StandardEncoding vector.  This does not occur in earlier versions of the FDK, and is fixed in the version currently posted.
- Read Roberts
Logged
pauljay
Guest
« Reply #3 on: 2010-03-13, 18:53:26 »

Thanks for the tip here on the coding I found this post in Google after much searching,and finally think I have a solution

Much appreciated

Paul
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!