freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] Discrepancy between freetype and Adobe Compact Font Format S


From: David Turner
Subject: Re: [Devel] Discrepancy between freetype and Adobe Compact Font Format Spec
Date: Sat, 23 Nov 2002 17:45:00 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826

Hi again,

Eric Nickell wrote:
[This was previously sent to address@hidden, but I have been told
since that address@hidden is more appropriate for bug
reports/feature requests, etc.]

We have been unable to load the example CFF font contained in appendix D
of Adobe's Technical Note #5176, "The Compact Font Format Specification"
using FT_New_Memory_Face.

Freetype seems to raise an FT_Error at line 1608 of cffload.c, after
satisfying the error condition ( num_glyphs != 229 ).  (Fwiw, it seems
that the 229 might be better represented as a symbolic constant here.)

The example font contains only two glyphs, both empty. In section 13,
the spec states "A font may use a predefined charset if it exactly
matches in the first nGlyphs."  I interpreted that sentence to mean that
if the CharStrings INDEX for a font only has 2 glyphs in it, the
effective charset used is the first two charset entries of the
predefined charset.

I'm a little confused by the comment just above the FT_Error in
cffload.c, which states:

      /* In order to use a predefined charset, the following must be  */
      /* true: The charset constructed for the glyphs in the font's   */
      /* charstrings dictionary must match the predefined charset in  */
      /* the first num_glyphs, and hence must match the predefined    */
      /* charset *exactly*.                                           */

Could this be due to a difference of interpretation as to whether
"nGlyphs" refers to the number of glyphs in the predefined charset vs
the number of glyphs found in the CharStrings INDEX?


Yes, it's really a stupid bug. The code should read

  if ( num_glyphs > 229 )
    error (too many glyphs)

I have commited the fix in the CVS. Could you try it ?

Thanks,

- David Turner
- The FreeType Project  (www.freetype.org)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]