cffparse.h

Go to the documentation of this file.
00001 /***************************************************************************/
00002 /*                                                                         */
00003 /*  cffparse.h                                                             */
00004 /*                                                                         */
00005 /*    CFF token stream parser (specification)                              */
00006 /*                                                                         */
00007 /*  Copyright 1996-2001, 2002, 2003 by                                     */
00008 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
00009 /*                                                                         */
00010 /*  This file is part of the FreeType project, and may only be used,       */
00011 /*  modified, and distributed under the terms of the FreeType project      */
00012 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
00013 /*  this file you indicate that you have read the license and              */
00014 /*  understand and accept it fully.                                        */
00015 /*                                                                         */
00016 /***************************************************************************/
00017 
00018 
00019 #ifndef __CFF_PARSE_H__
00020 #define __CFF_PARSE_H__
00021 
00022 
00023 #include <ft2build.h>
00024 #include "cfftypes.h"
00025 #include FT_INTERNAL_OBJECTS_H
00026 
00027 
00028 FT_BEGIN_HEADER
00029 
00030 
00031 #define CFF_MAX_STACK_DEPTH  96
00032 
00033 #define CFF_CODE_TOPDICT  0x1000
00034 #define CFF_CODE_PRIVATE  0x2000
00035 
00036 
00037   typedef struct  CFF_ParserRec_
00038   {
00039     FT_Library library;
00040     FT_Byte*   start;
00041     FT_Byte*   limit;
00042     FT_Byte*   cursor;
00043 
00044     FT_Byte*   stack[CFF_MAX_STACK_DEPTH + 1];
00045     FT_Byte**  top;
00046 
00047     FT_UInt    object_code;
00048     void*      object;
00049 
00050   } CFF_ParserRec, *CFF_Parser;
00051 
00052 
00053   FT_LOCAL( void )
00054   cff_parser_init( CFF_Parser  parser,
00055                    FT_UInt     code,
00056                    void*       object,
00057                    FT_Library  library);
00058 
00059   FT_LOCAL( FT_Error )
00060   cff_parser_run( CFF_Parser  parser,
00061                   FT_Byte*    start,
00062                   FT_Byte*    limit );
00063 
00064 
00065   enum
00066   {
00067     cff_kind_none = 0,
00068     cff_kind_num,
00069     cff_kind_fixed,
00070     cff_kind_fixed_thousand,
00071     cff_kind_string,
00072     cff_kind_bool,
00073     cff_kind_delta,
00074     cff_kind_callback,
00075 
00076     cff_kind_max  /* do not remove */
00077   };
00078 
00079 
00080   /* now generate handlers for the most simple fields */
00081   typedef FT_Error  (*CFF_Field_Reader)( CFF_Parser  parser );
00082 
00083   typedef struct  CFF_Field_Handler_
00084   {
00085     int               kind;
00086     int               code;
00087     FT_UInt           offset;
00088     FT_Byte           size;
00089     CFF_Field_Reader  reader;
00090     FT_UInt           array_max;
00091     FT_UInt           count_offset;
00092 
00093   } CFF_Field_Handler;
00094 
00095 
00096 FT_END_HEADER
00097 
00098 
00099 #endif /* __CFF_PARSE_H__ */
00100 
00101 
00102 /* END */

Generated on Tue Jul 5 14:13:46 2011 for ROOT_528-00b_version by  doxygen 1.5.1