/modules/freetype2/src/cid/cidparse.h

http://github.com/zpao/v8monkey · C Header · 123 lines · 45 code · 27 blank · 51 comment · 0 complexity · a959e6f7eeda12df1acea7ade33309ef MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* cidparse.h */
  4. /* */
  5. /* CID-keyed Type1 parser (specification). */
  6. /* */
  7. /* Copyright 1996-2001, 2002, 2003, 2004 by */
  8. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
  9. /* */
  10. /* This file is part of the FreeType project, and may only be used, */
  11. /* modified, and distributed under the terms of the FreeType project */
  12. /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
  13. /* this file you indicate that you have read the license and */
  14. /* understand and accept it fully. */
  15. /* */
  16. /***************************************************************************/
  17. #ifndef __CIDPARSE_H__
  18. #define __CIDPARSE_H__
  19. #include <ft2build.h>
  20. #include FT_INTERNAL_TYPE1_TYPES_H
  21. #include FT_INTERNAL_STREAM_H
  22. #include FT_INTERNAL_POSTSCRIPT_AUX_H
  23. FT_BEGIN_HEADER
  24. /*************************************************************************/
  25. /* */
  26. /* <Struct> */
  27. /* CID_Parser */
  28. /* */
  29. /* <Description> */
  30. /* A CID_Parser is an object used to parse a Type 1 fonts very */
  31. /* quickly. */
  32. /* */
  33. /* <Fields> */
  34. /* root :: The root PS_ParserRec fields. */
  35. /* */
  36. /* stream :: The current input stream. */
  37. /* */
  38. /* postscript :: A pointer to the data to be parsed. */
  39. /* */
  40. /* postscript_len :: The length of the data to be parsed. */
  41. /* */
  42. /* data_offset :: The start position of the binary data (i.e., the */
  43. /* end of the data to be parsed. */
  44. /* */
  45. /* binary_length :: The length of the data after the `StartData' */
  46. /* command if the data format is hexadecimal. */
  47. /* */
  48. /* cid :: A structure which holds the information about */
  49. /* the current font. */
  50. /* */
  51. /* num_dict :: The number of font dictionaries. */
  52. /* */
  53. typedef struct CID_Parser_
  54. {
  55. PS_ParserRec root;
  56. FT_Stream stream;
  57. FT_Byte* postscript;
  58. FT_Long postscript_len;
  59. FT_ULong data_offset;
  60. FT_Long binary_length;
  61. CID_FaceInfo cid;
  62. FT_Int num_dict;
  63. } CID_Parser;
  64. FT_LOCAL( FT_Error )
  65. cid_parser_new( CID_Parser* parser,
  66. FT_Stream stream,
  67. FT_Memory memory,
  68. PSAux_Service psaux );
  69. FT_LOCAL( void )
  70. cid_parser_done( CID_Parser* parser );
  71. /*************************************************************************/
  72. /* */
  73. /* PARSING ROUTINES */
  74. /* */
  75. /*************************************************************************/
  76. #define cid_parser_skip_spaces( p ) \
  77. (p)->root.funcs.skip_spaces( &(p)->root )
  78. #define cid_parser_skip_PS_token( p ) \
  79. (p)->root.funcs.skip_PS_token( &(p)->root )
  80. #define cid_parser_to_int( p ) (p)->root.funcs.to_int( &(p)->root )
  81. #define cid_parser_to_fixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
  82. #define cid_parser_to_coord_array( p, m, c ) \
  83. (p)->root.funcs.to_coord_array( &(p)->root, m, c )
  84. #define cid_parser_to_fixed_array( p, m, f, t ) \
  85. (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
  86. #define cid_parser_to_token( p, t ) \
  87. (p)->root.funcs.to_token( &(p)->root, t )
  88. #define cid_parser_to_token_array( p, t, m, c ) \
  89. (p)->root.funcs.to_token_array( &(p)->root, t, m, c )
  90. #define cid_parser_load_field( p, f, o ) \
  91. (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 )
  92. #define cid_parser_load_field_table( p, f, o ) \
  93. (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 )
  94. FT_END_HEADER
  95. #endif /* __CIDPARSE_H__ */
  96. /* END */