freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] plan to support sfnt-wrapped CID-keyed font


From: mpsuzuki
Subject: Re: [ft-devel] plan to support sfnt-wrapped CID-keyed font
Date: Fri, 19 Sep 2008 16:38:47 +0900

Dear Werner,

Just I've revised the part you commented and committed to CVS.
Soon I will update ftmac.c to provide same feature in the
hometown of sfnt-wrapped PS Type1 & CID-keyed fonts.

Until 2.3.8, I want to extend the feature to sfnt-wrapped Type1
and CID-keyed font out of resource-fork. I guess no font vendors
had ever released their fonts in such format, but "sfnt-wrapped
PS font is acceptable if it's in resource fork" is confusing
restriction for FreeType2 users.

My plan is:

Step 1. Let TrueType driver detect the sfnt-wrapped PS Type1 & CID-
        keyed fonts. TrueType font driver should not support them,
        but I want to detect these formats from the return value
        of ttload.c:check_table_dir() (it checks head/bhed/SING).

Step 2. If the stream is detected to be sfnt-wrapped PS Type1 & CID-
        keyed font, seek to `TYP1' or `CID ' table, copy the content
        to memory and execute open_face_from_buffer().

To implement the step 1, I want to ask a question.

"The checking of error values in ftobjs.c should be
 restricted to base module errors?"

include/freetype/fterrdef.h assigns unique values to
all errors. So it is possible for ftobjs.c to investigate
TrueType-specific errors. But it may violate the coding
style, I'm afraid. If such should be avoided, I will
use the sfnt directory parser in ftobjs.c.

Werner, how do you think of?

Regards,
mpsuzuki

On Thu, 18 Sep 2008 13:29:40 +0200 (CEST)
Werner LEMBERG <address@hidden> wrote:

>
>> I revised my experimental patch to load sfnt-wrapped CID and
>> sfnt-wrapped Type1 font by FreeType2.
>
>Nice!
>
>> +    * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add support for
>> +    sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font.
>> +    (Mac_Lookup_PS_in_sfnt): New function to lookup 'CID ' or 'TYP1'
>> +    table in sfnt table directory. It is used before loading TrueType
>> +    font driver.
>
>A minor thing: The noun is `the lookup', but the verb is `to look up'.
>
>> +  /* Lookup 'TYP1' or 'CID ' table from sfnt table directory. */
>> +  /* offset & length must exclude the binary header in tables */
>
>Please use `...' quotes for consistency with the rest of the FreeType
>source files.
>
>> +    /* parse table directory header */
>> +    FT_Byte*   p = sfnt + 4; /* skip version 'typ1' */
>> +    FT_UShort  numTables = FT_NEXT_USHORT( p );
>
>Here, please insert two empty lines after the variable declarations
>(and at similar places too).
>
>> +    *is_sfnt_cid = TRUE;
>> +    return FT_Err_Ok;
>
>And no tabs, please :-)
>
>Besides those formatting nitpicks, everything looks fine.  Please go
>ahead.
>
>
>    Werner




reply via email to

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