blob: c6aaa3ed784331d429a3f2b6326038584d8b1e6a [file] [log] [blame]
Werner Lemberge3c11d72000-06-16 06:49:56 +00001/***************************************************************************/
2/* */
3/* cidparse.h */
4/* */
5/* CID-keyed Type1 parser (specification). */
6/* */
7/* Copyright 1996-2000 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
David Turner04aa8002000-06-01 03:27:48 +000018
Werner Lemberg90d99642000-12-09 00:45:38 +000019#ifndef __CIDPARSE_H__
20#define __CIDPARSE_H__
David Turner04aa8002000-06-01 03:27:48 +000021
Werner Lembergcc069be2000-12-08 16:17:16 +000022
23#include <ft2build.h>
24#include FT_INTERNAL_TYPE1_TYPES_H
25#include FT_INTERNAL_STREAM_H
26#include FT_INTERNAL_POSTSCRIPT_AUX_H
27
Werner Lemberge3c11d72000-06-16 06:49:56 +000028
David Turner19ed8af2000-12-08 02:42:29 +000029FT_BEGIN_HEADER
David Turner04aa8002000-06-01 03:27:48 +000030
Werner Lembergcc069be2000-12-08 16:17:16 +000031
Werner Lemberge3c11d72000-06-16 06:49:56 +000032 /*************************************************************************/
33 /* */
34 /* <Struct> */
35 /* CID_Parser */
36 /* */
37 /* <Description> */
38 /* A CID_Parser is an object used to parse a Type 1 fonts very */
39 /* quickly. */
40 /* */
41 /* <Fields> */
David Turner34f1c2f2000-08-23 22:47:44 +000042 /* root :: the root T1_Parser fields */
Werner Lemberge3c11d72000-06-16 06:49:56 +000043 /* */
David Turner34f1c2f2000-08-23 22:47:44 +000044 /* stream :: The current input stream. */
Werner Lemberge3c11d72000-06-16 06:49:56 +000045 /* */
46 /* postscript :: A pointer to the data to be parsed. */
47 /* */
48 /* postscript_len :: The length of the data to be parsed. */
49 /* */
50 /* data_offset :: The start position of the binary data (i.e., the */
51 /* end of the data to be parsed. */
52 /* */
Werner Lemberge3c11d72000-06-16 06:49:56 +000053 /* cid :: A structure which holds the information about */
54 /* the current font. */
55 /* */
56 /* num_dict :: The number of font dictionaries. */
57 /* */
David Turner04aa8002000-06-01 03:27:48 +000058 typedef struct CID_Parser_
59 {
David Turner34f1c2f2000-08-23 22:47:44 +000060 T1_Parser root;
David Turner04aa8002000-06-01 03:27:48 +000061 FT_Stream stream;
David Turner04aa8002000-06-01 03:27:48 +000062
David Turnerf9b8dec2000-06-16 19:34:52 +000063 FT_Byte* postscript;
64 FT_Int postscript_len;
David Turner04aa8002000-06-01 03:27:48 +000065
David Turnerf9b8dec2000-06-16 19:34:52 +000066 FT_ULong data_offset;
David Turner04aa8002000-06-01 03:27:48 +000067
David Turner04aa8002000-06-01 03:27:48 +000068 CID_Info* cid;
David Turnerf9b8dec2000-06-16 19:34:52 +000069 FT_Int num_dict;
David Turner04aa8002000-06-01 03:27:48 +000070
71 } CID_Parser;
72
73
Werner Lembergcc069be2000-12-08 16:17:16 +000074 FT_LOCAL
75 FT_Error CID_New_Parser( CID_Parser* parser,
76 FT_Stream stream,
77 FT_Memory memory,
78 PSAux_Interface* psaux );
David Turner04aa8002000-06-01 03:27:48 +000079
Werner Lembergcc069be2000-12-08 16:17:16 +000080 FT_LOCAL
81 void CID_Done_Parser( CID_Parser* parser );
David Turner04aa8002000-06-01 03:27:48 +000082
83
Werner Lemberge3c11d72000-06-16 06:49:56 +000084 /*************************************************************************/
85 /* */
86 /* PARSING ROUTINES */
87 /* */
88 /*************************************************************************/
David Turner04aa8002000-06-01 03:27:48 +000089
Werner Lembergd1b74752000-08-24 16:29:15 +000090#define CID_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
91#define CID_Skip_Alpha( p ) (p)->root.funcs.skip_alpha ( &(p)->root )
David Turner04aa8002000-06-01 03:27:48 +000092
Werner Lembergd1b74752000-08-24 16:29:15 +000093#define CID_ToInt( p ) (p)->root.funcs.to_int( &(p)->root )
94#define CID_ToFixed( p, t ) (p)->root.funcs.to_fixed( &(p)->root, t )
David Turner04aa8002000-06-01 03:27:48 +000095
Werner Lembergd1b74752000-08-24 16:29:15 +000096#define CID_ToCoordArray( p, m, c ) \
97 (p)->root.funcs.to_coord_array( &(p)->root, m, c )
98#define CID_ToFixedArray( p, m, f, t ) \
99 (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
100#define CID_ToToken( p, t ) \
101 (p)->root.funcs.to_token( &(p)->root, t )
102#define CID_ToTokenArray( p, t, m, c ) \
103 (p)->root.funcs.to_token_array( &(p)->root, t, m, c )
David Turner04aa8002000-06-01 03:27:48 +0000104
Werner Lembergd1b74752000-08-24 16:29:15 +0000105#define CID_Load_Field( p, f, o ) \
106 (p)->root.funcs.load_field( &(p)->root, f, o, 0, 0 )
107#define CID_Load_Field_Table( p, f, o ) \
108 (p)->root.funcs.load_field_table( &(p)->root, f, o, 0, 0 )
David Turner04aa8002000-06-01 03:27:48 +0000109
David Turner04aa8002000-06-01 03:27:48 +0000110
David Turner19ed8af2000-12-08 02:42:29 +0000111FT_END_HEADER
Werner Lemberge3c11d72000-06-16 06:49:56 +0000112
Werner Lemberg90d99642000-12-09 00:45:38 +0000113#endif /* __CIDPARSE_H__ */
David Turner04aa8002000-06-01 03:27:48 +0000114
115
116/* END */