20 #include FT_INTERNAL_DEBUG_H 21 #include FT_INTERNAL_OBJECTS_H 22 #include FT_INTERNAL_STREAM_H 36 #define FT_COMPONENT trace_cidparse 63 psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
74 "%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )
77 error =
FT_THROW( Unknown_File_Format );
99 if ( stream_len == 0 )
101 FT_TRACE2((
"cid_parser_new: no `StartData' keyword found\n" ));
102 error =
FT_THROW( Invalid_File_Format );
106 read_len =
FT_MIN( read_len, stream_len );
110 if ( read_len < 256 )
113 limit = p + read_len - 10;
115 for ( p = buffer; p <
limit; p++ )
117 if ( p[0] ==
'S' &&
ft_strncmp( (
char*)p,
"StartData", 9 ) == 0 )
120 offset += p - buffer + 10;
123 else if ( p[1] ==
's' &&
ft_strncmp( (
char*)p,
"/sfnts", 6 ) == 0 )
125 offset += p - buffer + 7;
141 ps_len = offset - base_offset;
146 parser->data_offset =
offset;
147 parser->postscript_len = ps_len;
148 parser->root.base = parser->postscript;
149 parser->root.cursor = parser->postscript;
150 parser->root.limit = parser->root.cursor + ps_len;
151 parser->num_dict = -1;
158 arg1 = parser->root.cursor;
161 arg2 = parser->root.cursor;
165 limit = parser->root.limit;
166 cur = parser->root.cursor;
168 while ( cur < limit )
170 if ( parser->root.error )
172 error = parser->root.error;
176 if ( cur[0] ==
'S' &&
ft_strncmp( (
char*)cur,
"StartData", 9 ) == 0 )
178 if (
ft_strncmp( (
char*)arg1,
"(Hex)", 5 ) == 0 )
179 parser->binary_length =
ft_atol( (
const char *)arg2 );
181 limit = parser->root.limit;
182 cur = parser->root.cursor;
185 else if ( cur[1] ==
's' &&
ft_strncmp( (
char*)cur,
"/sfnts", 6 ) == 0 )
187 FT_TRACE2((
"cid_parser_new: cannot handle Type 11 fonts\n" ));
188 error =
FT_THROW( Unknown_File_Format );
196 cur = parser->root.cursor;
214 if ( parser->postscript )
221 parser->root.funcs.done( &parser->root );
cid_parser_done(CID_Parser *parser)
cid_parser_new(CID_Parser *parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
#define FT_MEM_ZERO(dest, count)
return FT_THROW(Missing_Property)
FT_BEGIN_HEADER struct CID_Parser_ CID_Parser
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
#define cid_parser_skip_spaces(p)
#define FT_TRACE2(varformat)
GLuint GLuint GLuint GLuint arg1
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_STREAM_SEEK(position)
#define FT_FRAME_RELEASE(bytes)
#define FT_FRAME_EXTRACT(size, bytes)
#define FT_FRAME_ENTER(size)
#define cid_parser_skip_PS_token(p)
#define FT_MEM_MOVE(dest, source, count)
#define FT_STREAM_READ(buffer, count)