some doubts about the CFF parsing code

View: New views
5 Messages — Rating Filter:   Alert me  

some doubts about the CFF parsing code

by Manlio Perillo-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

I'm writing a CFF parser in Python, using FreeType2 code as a guide.

I have noted some possible problems:

 * in the cff_parser_run functions, a token is considered to belong to a
   number if: v >= 27 && v != 31.

   However 27 is reserved, according to CFF specification version 1.0

 * the functions cff_parse_font_matrix, cff_parse_font_bbox,
   cff_parse_private_dict and cff_parse_cid_ros
   are defined (as static) but never used, as far as I can see.



Thanks  Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrmGdkACgkQscQJ24LbaURHRgCfWkcCx9pwZWlqIdy8KW/0Crq1
+EIAn3KNzV3b7iQEfoN69HmmRktzO9Uz
=39aH
-----END PGP SIGNATURE-----


_______________________________________________
Freetype-devel mailing list
Freetype-devel@...
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Re: some doubts about the CFF parsing code

by mpsuzuki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Mon, 26 Oct 2009 22:51:21 +0100
Manlio Perillo <manlio.perillo@...> wrote:
> * the functions cff_parse_font_matrix, cff_parse_font_bbox,
>   cff_parse_private_dict and cff_parse_cid_ros
>   are defined (as static) but never used, as far as I can see.

These functions are registered as the callbacks in
src/cff/cfftoken.h, aslike:

    36    CFF_FIELD_NUM     ( 0x106, charstring_type )
    37    CFF_FIELD_CALLBACK( 0x107, font_matrix )
    38    CFF_FIELD_NUM     ( 13,    unique_id )
    39    CFF_FIELD_CALLBACK( 5,     font_bbox )
    40    CFF_FIELD_NUM     ( 0x108, stroke_width )
...

CFF_FIELD_CALLBACK() is defined in cffparse.c,

#define CFF_FIELD_CALLBACK( code, name ) \
          {                              \
            cff_kind_callback,           \
            code | CFFCODE,              \
            0, 0,                        \
            cff_parse_ ## name,          \
            0, 0                         \
          },

I'm sorry that it is easy to find by grep.

Regards,
mpsuzuki


_______________________________________________
Freetype-devel mailing list
Freetype-devel@...
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Re: some doubts about the CFF parsing code

by mpsuzuki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 27 Oct 2009 07:37:45 +0900
mpsuzuki@... wrote:
>I'm sorry that it is easy to find by grep.

Oops, I meant "it is NOT easy to find by grep."

Regards,
mpsuzuki


_______________________________________________
Freetype-devel mailing list
Freetype-devel@...
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Re: some doubts about the CFF parsing code

by Manlio Perillo-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

mpsuzuki@... ha scritto:

> Hi,
>
> On Mon, 26 Oct 2009 22:51:21 +0100
> Manlio Perillo <manlio.perillo@...> wrote:
>> * the functions cff_parse_font_matrix, cff_parse_font_bbox,
>>   cff_parse_private_dict and cff_parse_cid_ros
>>   are defined (as static) but never used, as far as I can see.
>
> These functions are registered as the callbacks in
> src/cff/cfftoken.h, aslike:
>

Ah, ok; thanks.


I have another question.
FreeType2 support these operators:

# 0x010f: -Reserved- # XXX force_bold_threshold for FreeType2
# 0x0110: -Reserved- # XXX lenIV for FreeType2, Type 1 fonts
# 0x0118: -Reserved- # XXX multiple_master for FreeType2
# 0x0119: -Reserved- # XXX blend_axis_types for FreeType2


However these opcodes are reserved in CFF version 1.0.
A lenIV operator exists in Type 1 font format.

Where can I find documentation for these operators?

> [...]


Regards  Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrnEUgACgkQscQJ24LbaUTmFQCePhIued1Z+X8hSJLTxkqF/v4p
ecUAn35lOIMLVWucAMLNtGMx2Gz3Ijln
=Ut/Z
-----END PGP SIGNATURE-----


_______________________________________________
Freetype-devel mailing list
Freetype-devel@...
http://lists.nongnu.org/mailman/listinfo/freetype-devel

Re: some doubts about the CFF parsing code

by George Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



> FreeType2 support these operators:
>
> # 0x010f: -Reserved- # XXX force_bold_threshold for FreeType2
> # 0x0110: -Reserved- # XXX lenIV for FreeType2, Type 1 fonts
> # 0x0118: -Reserved- # XXX multiple_master for FreeType2
> # 0x0119: -Reserved- # XXX blend_axis_types for FreeType2
>
>
> However these opcodes are reserved in CFF version 1.0.
> A lenIV operator exists in Type 1 font format.
> Where can I find documentation for these operators?
the multiple master operators are defined in an obsolete version of the Adobe Technical Notes 5177 and 5176, and they may be found here:
http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/5177.Type2.pdf
http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/5176.CFF.pdf


_______________________________________________
Freetype-devel mailing list
Freetype-devel@...
http://lists.nongnu.org/mailman/listinfo/freetype-devel