37 #include FT_INTERNAL_DEBUG_H 38 #include FT_INTERNAL_STREAM_H 39 #include FT_INTERNAL_POSTSCRIPT_AUX_H 53 #define FT_COMPONENT trace_t1parse 84 if ( tag == 0x8001U || tag == 0x8002U )
99 const char* header_string,
100 size_t header_length )
110 error = read_pfb_tag( stream, &tag, &dummy );
125 error =
FT_THROW( Unknown_File_Format );
146 psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
149 parser->base_len = 0;
150 parser->base_dict = 0;
151 parser->private_len = 0;
152 parser->private_dict = 0;
154 parser->in_memory = 0;
155 parser->single_block = 0;
158 error = check_type1_format( stream,
"%!PS-AdobeFont", 14 );
164 error = check_type1_format( stream,
"%!FontType", 10 );
193 error = read_pfb_tag( stream, &tag, &
size );
197 if ( tag != 0x8001U )
215 parser->base_len =
size;
216 parser->in_memory = 1;
228 parser->base_len =
size;
231 parser->root.base = parser->base_dict;
232 parser->root.cursor = parser->base_dict;
233 parser->root.limit = parser->root.cursor + parser->base_len;
236 if (
error && !parser->in_memory )
250 FT_FREE( parser->private_dict );
253 if ( !parser->in_memory )
256 parser->root.funcs.done( &parser->root );
270 if ( parser->in_pfb )
280 parser->private_len = 0;
283 error = read_pfb_tag( stream, &tag, &
size );
287 if ( tag != 0x8002U )
290 parser->private_len +=
size;
298 if ( parser->private_len == 0 )
301 " invalid private dictionary section\n" ));
307 FT_ALLOC( parser->private_dict, parser->private_len ) )
310 parser->private_len = 0;
313 error = read_pfb_tag( stream, &tag, &
size );
314 if (
error || tag != 0x8002U )
324 parser->private_len +=
size;
335 FT_Byte* cur = parser->base_dict;
344 if ( c ==
'e' && cur + 9 < limit )
347 if ( cur[1] ==
'e' &&
357 " could not find `eexec' keyword\n" ));
366 parser->root.cursor = parser->base_dict;
368 parser->root.limit = cur + 10;
370 cur = parser->root.cursor;
371 limit = parser->root.limit;
373 while ( cur < limit )
375 if ( *cur ==
'e' &&
ft_strncmp( (
char*)cur,
"eexec", 5 ) == 0 )
379 if ( parser->root.error )
382 cur = parser->root.cursor;
389 limit = parser->base_dict + parser->base_len;
397 parser->root.limit = parser->base_dict + parser->base_len;
400 cur = parser->root.cursor;
401 limit = parser->root.limit;
407 while ( cur < limit &&
416 " `eexec' not properly terminated\n" ));
421 size = parser->base_len - ( cur - parser->base_dict );
423 if ( parser->in_memory )
428 parser->private_len =
size;
432 parser->single_block = 1;
433 parser->private_dict = parser->base_dict;
434 parser->private_len =
size;
435 parser->base_dict = 0;
436 parser->base_len = 0;
446 if ( cur + 3 < limit &&
454 parser->root.cursor = cur;
455 (
void)psaux->ps_parser_funcs->to_bytes( &parser->root,
456 parser->private_dict,
460 parser->private_len =
len;
463 parser->private_dict[
len] =
'\0';
471 psaux->t1_decrypt( parser->private_dict, parser->private_len, 55665U );
473 if ( parser->private_len < 4 )
476 " invalid private dictionary section\n" ));
482 parser->private_dict[0] =
' ';
483 parser->private_dict[1] =
' ';
484 parser->private_dict[2] =
' ';
485 parser->private_dict[3] =
' ';
487 parser->root.base = parser->private_dict;
488 parser->root.cursor = parser->private_dict;
489 parser->root.limit = parser->root.cursor + parser->private_len;
#define FT_ALLOC(ptr, size)
T1_Finalize_Parser(T1_Parser parser)
T1_New_Parser(T1_Parser parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
#define T1_Skip_Spaces(p)
return FT_THROW(Missing_Property)
#define FT_READ_USHORT(var)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
#define FT_ERROR(varformat)
#define FT_STREAM_SKIP(distance)
#define T1_Skip_PS_Token(p)
#define FT_TRACE2(varformat)
#define FT_READ_ULONG_LE(var)
T1_Get_Private_Dict(T1_Parser parser, PSAux_Service psaux)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_STREAM_SEEK(position)
if(!abbox) return FT_THROW(Invalid_Argument)
#define FT_FRAME_ENTER(size)
FT_BEGIN_HEADER struct T1_ParserRec_ * T1_Parser
#define FT_MEM_MOVE(dest, source, count)
#define FT_STREAM_READ(buffer, count)