freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] The font can't be parsed correctly


From: Werner LEMBERG
Subject: Re: [ft-devel] The font can't be parsed correctly
Date: Mon, 10 Dec 2007 16:11:53 +0100 (CET)

> The first glyph in the font F4.1.ttf (index:3058, maybe the Chinese
> character "版") can not be parsed.

Uh, oh, another Type 1 operator (callothersubr)!  This font is simply
not a valid CFF!  It's pure luck that other parsers support it.
Hopefully, it's not your company which produces such weird CFFs!

Looking into src/psaux/t1decode.c, you can see that handling of
`callothersubr' is about 350 lines of code which I won't add to the
Type 2 handler: It's far too expensive to support such a feature which
is invalid anyway.

Hmm.  Maybe it's possible to switch from the Type 2 parser to the
Type 1 parser as soon as an invalid opcode has been found...  Any
volunteer to investigate this?  Perhaps you?

> The second, I use the function "FTC_SBitCache_Lookup" to get the
> bitmap, it is wrong.  And the "FTC_ImageCache_Lookup" is right.

A compilable code snippet, please, which demonstrates the problem.

> The third, can you tell me which files be changed for this problem?

From the ChangeLog file:

        * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and
        `cff_op_closepath.'
        (cff_argument_counts): Ditto.

        (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9
        (closepath) and 13 (hsbw) which are invalid in Type 2
        charstrings.


    Werner

reply via email to

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