ReactOS 0.4.16-dev-981-g80eb313
t42parse.c
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * t42parse.c
4 *
5 * Type 42 font parser (body).
6 *
7 * Copyright (C) 2002-2019 by
8 * Roberto Alameda.
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
18
19#include "t42parse.h"
20#include "t42error.h"
21#include FT_INTERNAL_DEBUG_H
22#include FT_INTERNAL_STREAM_H
23#include FT_INTERNAL_POSTSCRIPT_AUX_H
24
25
26 /**************************************************************************
27 *
28 * The macro FT_COMPONENT is used in trace mode. It is an implicit
29 * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
30 * messages during execution.
31 */
32#undef FT_COMPONENT
33#define FT_COMPONENT t42
34
35
36 static void
38 T42_Loader loader );
39 static void
41 T42_Loader loader );
42
43 static void
45 T42_Loader loader );
46
47 static void
49 T42_Loader loader );
50
51
52 /* as Type42 fonts have no Private dict, */
53 /* we set the last argument of T1_FIELD_XXX to 0 */
54 static const
56 {
57
58#undef FT_STRUCTURE
59#define FT_STRUCTURE T1_FontInfo
60#undef T1CODE
61#define T1CODE T1_FIELD_LOCATION_FONT_INFO
62
63 T1_FIELD_STRING( "version", version, 0 )
64 T1_FIELD_STRING( "Notice", notice, 0 )
65 T1_FIELD_STRING( "FullName", full_name, 0 )
66 T1_FIELD_STRING( "FamilyName", family_name, 0 )
67 T1_FIELD_STRING( "Weight", weight, 0 )
68 T1_FIELD_NUM ( "ItalicAngle", italic_angle, 0 )
69 T1_FIELD_BOOL ( "isFixedPitch", is_fixed_pitch, 0 )
70 T1_FIELD_NUM ( "UnderlinePosition", underline_position, 0 )
71 T1_FIELD_NUM ( "UnderlineThickness", underline_thickness, 0 )
72
73#undef FT_STRUCTURE
74#define FT_STRUCTURE PS_FontExtraRec
75#undef T1CODE
76#define T1CODE T1_FIELD_LOCATION_FONT_EXTRA
77
78 T1_FIELD_NUM ( "FSType", fs_type, 0 )
79
80#undef FT_STRUCTURE
81#define FT_STRUCTURE T1_FontRec
82#undef T1CODE
83#define T1CODE T1_FIELD_LOCATION_FONT_DICT
84
85 T1_FIELD_KEY ( "FontName", font_name, 0 )
86 T1_FIELD_NUM ( "PaintType", paint_type, 0 )
87 T1_FIELD_NUM ( "FontType", font_type, 0 )
88 T1_FIELD_FIXED( "StrokeWidth", stroke_width, 0 )
89
90#undef FT_STRUCTURE
91#define FT_STRUCTURE FT_BBox
92#undef T1CODE
93#define T1CODE T1_FIELD_LOCATION_BBOX
94
95 T1_FIELD_BBOX("FontBBox", xMin, 0 )
96
99 T1_FIELD_CALLBACK( "CharStrings", t42_parse_charstrings, 0 )
101
102 { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0, 0 }
103 };
104
105
106#define T1_Add_Table( p, i, o, l ) (p)->funcs.add( (p), i, o, l )
107#define T1_Release_Table( p ) \
108 do \
109 { \
110 if ( (p)->funcs.release ) \
111 (p)->funcs.release( p ); \
112 } while ( 0 )
113
114#define T1_Skip_Spaces( p ) (p)->root.funcs.skip_spaces( &(p)->root )
115#define T1_Skip_PS_Token( p ) (p)->root.funcs.skip_PS_token( &(p)->root )
116
117#define T1_ToInt( p ) \
118 (p)->root.funcs.to_int( &(p)->root )
119#define T1_ToBytes( p, b, m, n, d ) \
120 (p)->root.funcs.to_bytes( &(p)->root, b, m, n, d )
121
122#define T1_ToFixedArray( p, m, f, t ) \
123 (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
124#define T1_ToToken( p, t ) \
125 (p)->root.funcs.to_token( &(p)->root, t )
126
127#define T1_Load_Field( p, f, o, m, pf ) \
128 (p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
129#define T1_Load_Field_Table( p, f, o, m, pf ) \
130 (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )
131
132
133 /********************* Parsing Functions ******************/
134
139 PSAux_Service psaux )
140 {
143
144
145 psaux->ps_parser_funcs->init( &parser->root, NULL, NULL, memory );
146
147 parser->stream = stream;
148 parser->base_len = 0;
149 parser->base_dict = NULL;
150 parser->in_memory = 0;
151
152 /********************************************************************
153 *
154 * Here a short summary of what is going on:
155 *
156 * When creating a new Type 42 parser, we try to locate and load
157 * the base dictionary, loading the whole font into memory.
158 *
159 * When `loading' the base dictionary, we only set up pointers
160 * in the case of a memory-based stream. Otherwise, we allocate
161 * and load the base dictionary in it.
162 *
163 * parser->in_memory is set if we have a memory stream.
164 */
165
166 if ( FT_STREAM_SEEK( 0L ) ||
167 FT_FRAME_ENTER( 17 ) )
168 goto Exit;
169
170 if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 )
171 {
172 FT_TRACE2(( " not a Type42 font\n" ));
173 error = FT_THROW( Unknown_File_Format );
174 }
175
177
178 if ( error || FT_STREAM_SEEK( 0 ) )
179 goto Exit;
180
182
183 /* now, try to load `size' bytes of the `base' dictionary we */
184 /* found previously */
185
186 /* if it is a memory-based resource, set up pointers */
187 if ( !stream->read )
188 {
189 parser->base_dict = (FT_Byte*)stream->base + stream->pos;
190 parser->base_len = size;
191 parser->in_memory = 1;
192
193 /* check that the `size' field is valid */
194 if ( FT_STREAM_SKIP( size ) )
195 goto Exit;
196 }
197 else
198 {
199 /* read segment in memory */
200 if ( FT_ALLOC( parser->base_dict, size ) ||
201 FT_STREAM_READ( parser->base_dict, size ) )
202 goto Exit;
203
204 parser->base_len = size;
205 }
206
207 parser->root.base = parser->base_dict;
208 parser->root.cursor = parser->base_dict;
209 parser->root.limit = parser->root.cursor + parser->base_len;
210
211 Exit:
212 if ( error && !parser->in_memory )
213 FT_FREE( parser->base_dict );
214
215 return error;
216 }
217
218
219 FT_LOCAL_DEF( void )
221 {
222 FT_Memory memory = parser->root.memory;
223
224
225 /* free the base dictionary only when we have a disk stream */
226 if ( !parser->in_memory )
227 FT_FREE( parser->base_dict );
228
229 parser->root.funcs.done( &parser->root );
230 }
231
232
233 static int
235 {
236 return ( c == ' ' || c == '\t' ||
237 c == '\r' || c == '\n' || c == '\f' ||
238 c == '\0' );
239 }
240
241
242 static void
244 T42_Loader loader )
245 {
246 T42_Parser parser = &loader->parser;
247 FT_Matrix* matrix = &face->type1.font_matrix;
248 FT_Vector* offset = &face->type1.font_offset;
249 FT_Fixed temp[6];
250 FT_Fixed temp_scale;
252
253
254 result = T1_ToFixedArray( parser, 6, temp, 0 );
255
256 if ( result < 6 )
257 {
258 parser->root.error = FT_THROW( Invalid_File_Format );
259 return;
260 }
261
262 temp_scale = FT_ABS( temp[3] );
263
264 if ( temp_scale == 0 )
265 {
266 FT_ERROR(( "t42_parse_font_matrix: invalid font matrix\n" ));
267 parser->root.error = FT_THROW( Invalid_File_Format );
268 return;
269 }
270
271 /* atypical case */
272 if ( temp_scale != 0x10000L )
273 {
274 temp[0] = FT_DivFix( temp[0], temp_scale );
275 temp[1] = FT_DivFix( temp[1], temp_scale );
276 temp[2] = FT_DivFix( temp[2], temp_scale );
277 temp[4] = FT_DivFix( temp[4], temp_scale );
278 temp[5] = FT_DivFix( temp[5], temp_scale );
279 temp[3] = temp[3] < 0 ? -0x10000L : 0x10000L;
280 }
281
282 matrix->xx = temp[0];
283 matrix->yx = temp[1];
284 matrix->xy = temp[2];
285 matrix->yy = temp[3];
286
287 if ( !FT_Matrix_Check( matrix ) )
288 {
289 FT_ERROR(( "t42_parse_font_matrix: invalid font matrix\n" ));
290 parser->root.error = FT_THROW( Invalid_File_Format );
291 return;
292 }
293
294 /* note that the offsets must be expressed in integer font units */
295 offset->x = temp[4] >> 16;
296 offset->y = temp[5] >> 16;
297 }
298
299
300 static void
302 T42_Loader loader )
303 {
304 T42_Parser parser = &loader->parser;
305 FT_Byte* cur;
306 FT_Byte* limit = parser->root.limit;
307
308 PSAux_Service psaux = (PSAux_Service)face->psaux;
309
310
312 cur = parser->root.cursor;
313 if ( cur >= limit )
314 {
315 FT_ERROR(( "t42_parse_encoding: out of bounds\n" ));
316 parser->root.error = FT_THROW( Invalid_File_Format );
317 return;
318 }
319
320 /* if we have a number or `[', the encoding is an array, */
321 /* and we must load it now */
322 if ( ft_isdigit( *cur ) || *cur == '[' )
323 {
324 T1_Encoding encode = &face->type1.encoding;
325 FT_Int count, n;
326 PS_Table char_table = &loader->encoding_table;
327 FT_Memory memory = parser->root.memory;
329 FT_Bool only_immediates = 0;
330
331
332 /* read the number of entries in the encoding; should be 256 */
333 if ( *cur == '[' )
334 {
335 count = 256;
336 only_immediates = 1;
337 parser->root.cursor++;
338 }
339 else
341
342 /* only composite fonts (which we don't support) */
343 /* can have larger values */
344 if ( count > 256 )
345 {
346 FT_ERROR(( "t42_parse_encoding: invalid encoding array size\n" ));
347 parser->root.error = FT_THROW( Invalid_File_Format );
348 return;
349 }
350
352 if ( parser->root.cursor >= limit )
353 return;
354
355 /* PostScript happily allows overwriting of encoding arrays */
356 if ( encode->char_index )
357 {
358 FT_FREE( encode->char_index );
359 FT_FREE( encode->char_name );
360 T1_Release_Table( char_table );
361 }
362
363 /* we use a T1_Table to store our charnames */
364 loader->num_chars = encode->num_chars = count;
365 if ( FT_NEW_ARRAY( encode->char_index, count ) ||
366 FT_NEW_ARRAY( encode->char_name, count ) ||
368 char_table, count, memory ) ) )
369 {
370 parser->root.error = error;
371 return;
372 }
373
374 /* We need to `zero' out encoding_table.elements */
375 for ( n = 0; n < count; n++ )
376 {
377 char* notdef = (char *)".notdef";
378
379
380 (void)T1_Add_Table( char_table, n, notdef, 8 );
381 }
382
383 /* Now we need to read records of the form */
384 /* */
385 /* ... charcode /charname ... */
386 /* */
387 /* for each entry in our table. */
388 /* */
389 /* We simply look for a number followed by an immediate */
390 /* name. Note that this ignores correctly the sequence */
391 /* that is often seen in type42 fonts: */
392 /* */
393 /* 0 1 255 { 1 index exch /.notdef put } for dup */
394 /* */
395 /* used to clean the encoding array before anything else. */
396 /* */
397 /* Alternatively, if the array is directly given as */
398 /* */
399 /* /Encoding [ ... ] */
400 /* */
401 /* we only read immediates. */
402
403 n = 0;
405
406 while ( parser->root.cursor < limit )
407 {
408 cur = parser->root.cursor;
409
410 /* we stop when we encounter `def' or `]' */
411 if ( *cur == 'd' && cur + 3 < limit )
412 {
413 if ( cur[1] == 'e' &&
414 cur[2] == 'f' &&
415 t42_is_space( cur[3] ) )
416 {
417 FT_TRACE6(( "encoding end\n" ));
418 cur += 3;
419 break;
420 }
421 }
422 if ( *cur == ']' )
423 {
424 FT_TRACE6(( "encoding end\n" ));
425 cur++;
426 break;
427 }
428
429 /* check whether we have found an entry */
430 if ( ft_isdigit( *cur ) || only_immediates )
431 {
432 FT_Int charcode;
433
434
435 if ( only_immediates )
436 charcode = n;
437 else
438 {
439 charcode = (FT_Int)T1_ToInt( parser );
441
442 /* protect against invalid charcode */
443 if ( cur == parser->root.cursor )
444 {
445 parser->root.error = FT_THROW( Unknown_File_Format );
446 return;
447 }
448 }
449
450 cur = parser->root.cursor;
451
452 if ( cur + 2 < limit && *cur == '/' && n < count )
453 {
454 FT_UInt len;
455
456
457 cur++;
458
459 parser->root.cursor = cur;
461 if ( parser->root.cursor >= limit )
462 return;
463 if ( parser->root.error )
464 return;
465
466 len = (FT_UInt)( parser->root.cursor - cur );
467
468 parser->root.error = T1_Add_Table( char_table, charcode,
469 cur, len + 1 );
470 if ( parser->root.error )
471 return;
472 char_table->elements[charcode][len] = '\0';
473
474 n++;
475 }
476 else if ( only_immediates )
477 {
478 /* Since the current position is not updated for */
479 /* immediates-only mode we would get an infinite loop if */
480 /* we don't do anything here. */
481 /* */
482 /* This encoding array is not valid according to the */
483 /* type42 specification (it might be an encoding for a CID */
484 /* type42 font, however), so we conclude that this font is */
485 /* NOT a type42 font. */
486 parser->root.error = FT_THROW( Unknown_File_Format );
487 return;
488 }
489 }
490 else
491 {
493 if ( parser->root.error )
494 return;
495 }
496
498 }
499
500 face->type1.encoding_type = T1_ENCODING_TYPE_ARRAY;
501 parser->root.cursor = cur;
502 }
503
504 /* Otherwise, we should have either `StandardEncoding', */
505 /* `ExpertEncoding', or `ISOLatin1Encoding' */
506 else
507 {
508 if ( cur + 17 < limit &&
509 ft_strncmp( (const char*)cur, "StandardEncoding", 16 ) == 0 )
510 face->type1.encoding_type = T1_ENCODING_TYPE_STANDARD;
511
512 else if ( cur + 15 < limit &&
513 ft_strncmp( (const char*)cur, "ExpertEncoding", 14 ) == 0 )
514 face->type1.encoding_type = T1_ENCODING_TYPE_EXPERT;
515
516 else if ( cur + 18 < limit &&
517 ft_strncmp( (const char*)cur, "ISOLatin1Encoding", 17 ) == 0 )
518 face->type1.encoding_type = T1_ENCODING_TYPE_ISOLATIN1;
519
520 else
521 parser->root.error = FT_ERR( Ignore );
522 }
523 }
524
525
526 typedef enum T42_Load_Status_
527 {
531
533
534
535 static void
537 T42_Loader loader )
538 {
539 T42_Parser parser = &loader->parser;
540 FT_Memory memory = parser->root.memory;
541 FT_Byte* cur;
542 FT_Byte* limit = parser->root.limit;
544 FT_Int num_tables = 0;
546
547 FT_ULong n, string_size, old_string_size, real_size;
548 FT_Byte* string_buf = NULL;
549 FT_Bool allocated = 0;
550
552
553
554 /* The format is */
555 /* */
556 /* /sfnts [ <hexstring> <hexstring> ... ] def */
557 /* */
558 /* or */
559 /* */
560 /* /sfnts [ */
561 /* <num_bin_bytes> RD <binary data> */
562 /* <num_bin_bytes> RD <binary data> */
563 /* ... */
564 /* ] def */
565 /* */
566 /* with exactly one space after the `RD' token. */
567
569
570 if ( parser->root.cursor >= limit || *parser->root.cursor++ != '[' )
571 {
572 FT_ERROR(( "t42_parse_sfnts: can't find begin of sfnts vector\n" ));
573 error = FT_THROW( Invalid_File_Format );
574 goto Fail;
575 }
576
579 string_size = 0;
580 old_string_size = 0;
581 count = 0;
582
583 while ( parser->root.cursor < limit )
584 {
586
587
588 cur = parser->root.cursor;
589
590 if ( *cur == ']' )
591 {
592 parser->root.cursor++;
593 goto Exit;
594 }
595
596 else if ( *cur == '<' )
597 {
598 if ( string_buf && !allocated )
599 {
600 FT_ERROR(( "t42_parse_sfnts: "
601 "can't handle mixed binary and hex strings\n" ));
602 error = FT_THROW( Invalid_File_Format );
603 goto Fail;
604 }
605
607 if ( parser->root.error )
608 goto Exit;
609
610 /* don't include delimiters */
611 string_size = (FT_ULong)( ( parser->root.cursor - cur - 2 + 1 ) / 2 );
612 if ( !string_size )
613 {
614 FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
615 error = FT_THROW( Invalid_File_Format );
616 goto Fail;
617 }
618 if ( FT_REALLOC( string_buf, old_string_size, string_size ) )
619 goto Fail;
620
621 allocated = 1;
622
623 parser->root.cursor = cur;
624 (void)T1_ToBytes( parser, string_buf, string_size, &real_size, 1 );
625 old_string_size = string_size;
626 string_size = real_size;
627 }
628
629 else if ( ft_isdigit( *cur ) )
630 {
631 FT_Long tmp;
632
633
634 if ( allocated )
635 {
636 FT_ERROR(( "t42_parse_sfnts: "
637 "can't handle mixed binary and hex strings\n" ));
638 error = FT_THROW( Invalid_File_Format );
639 goto Fail;
640 }
641
642 tmp = T1_ToInt( parser );
643 if ( tmp < 0 )
644 {
645 FT_ERROR(( "t42_parse_sfnts: invalid string size\n" ));
646 error = FT_THROW( Invalid_File_Format );
647 goto Fail;
648 }
649 else
650 string_size = (FT_ULong)tmp;
651
652 T1_Skip_PS_Token( parser ); /* `RD' */
653 if ( parser->root.error )
654 return;
655
656 string_buf = parser->root.cursor + 1; /* one space after `RD' */
657
658 if ( (FT_ULong)( limit - parser->root.cursor ) <= string_size )
659 {
660 FT_ERROR(( "t42_parse_sfnts: too much binary data\n" ));
661 error = FT_THROW( Invalid_File_Format );
662 goto Fail;
663 }
664 else
665 parser->root.cursor += string_size + 1;
666 }
667
668 if ( !string_buf )
669 {
670 FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
671 error = FT_THROW( Invalid_File_Format );
672 goto Fail;
673 }
674
675 /* A string can have a trailing zero (odd) byte for padding. */
676 /* Ignore it. */
677 if ( ( string_size & 1 ) && string_buf[string_size - 1] == 0 )
678 string_size--;
679
680 if ( !string_size )
681 {
682 FT_ERROR(( "t42_parse_sfnts: invalid string\n" ));
683 error = FT_THROW( Invalid_File_Format );
684 goto Fail;
685 }
686
687 /* The whole TTF is now loaded into `string_buf'. We are */
688 /* checking its contents while copying it to `ttf_data'. */
689
690 size = (FT_ULong)( limit - parser->root.cursor );
691
692 for ( n = 0; n < string_size; n++ )
693 {
694 switch ( status )
695 {
696 case BEFORE_START:
697 /* load offset table, 12 bytes */
698 if ( count < 12 )
699 {
700 face->ttf_data[count++] = string_buf[n];
701 continue;
702 }
703 else
704 {
705 num_tables = 16 * face->ttf_data[4] + face->ttf_data[5];
707 face->ttf_size = 12 + 16 * num_tables;
708
709 if ( (FT_Long)size < face->ttf_size )
710 {
711 FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
712 error = FT_THROW( Invalid_File_Format );
713 goto Fail;
714 }
715
716 if ( FT_REALLOC( face->ttf_data, 12, face->ttf_size ) )
717 goto Fail;
718 }
719 /* fall through */
720
721 case BEFORE_TABLE_DIR:
722 /* the offset table is read; read the table directory */
723 if ( count < face->ttf_size )
724 {
725 face->ttf_data[count++] = string_buf[n];
726 continue;
727 }
728 else
729 {
730 int i;
732
733
734 for ( i = 0; i < num_tables; i++ )
735 {
736 FT_Byte* p = face->ttf_data + 12 + 16 * i + 12;
737
738
739 len = FT_PEEK_ULONG( p );
740 if ( len > size ||
741 face->ttf_size > (FT_Long)( size - len ) )
742 {
743 FT_ERROR(( "t42_parse_sfnts:"
744 " invalid data in sfnts array\n" ));
745 error = FT_THROW( Invalid_File_Format );
746 goto Fail;
747 }
748
749 /* Pad to a 4-byte boundary length */
750 face->ttf_size += (FT_Long)( ( len + 3 ) & ~3U );
751 }
752
754
755 if ( FT_REALLOC( face->ttf_data, 12 + 16 * num_tables,
756 face->ttf_size + 1 ) )
757 goto Fail;
758 }
759 /* fall through */
760
761 case OTHER_TABLES:
762 /* all other tables are just copied */
763 if ( count >= face->ttf_size )
764 {
765 FT_ERROR(( "t42_parse_sfnts: too much binary data\n" ));
766 error = FT_THROW( Invalid_File_Format );
767 goto Fail;
768 }
769 face->ttf_data[count++] = string_buf[n];
770 }
771 }
772
774 }
775
776 /* if control reaches this point, the format was not valid */
777 error = FT_THROW( Invalid_File_Format );
778
779 Fail:
780 parser->root.error = error;
781
782 Exit:
783 if ( allocated )
784 FT_FREE( string_buf );
785 }
786
787
788 static void
790 T42_Loader loader )
791 {
792 T42_Parser parser = &loader->parser;
793 PS_Table code_table = &loader->charstrings;
794 PS_Table name_table = &loader->glyph_names;
795 PS_Table swap_table = &loader->swap_table;
796 FT_Memory memory = parser->root.memory;
798
799 PSAux_Service psaux = (PSAux_Service)face->psaux;
800
801 FT_Byte* cur;
802 FT_Byte* limit = parser->root.limit;
803 FT_Int n;
804 FT_Int notdef_index = 0;
805 FT_Byte notdef_found = 0;
806
807
809
810 if ( parser->root.cursor >= limit )
811 {
812 FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
813 error = FT_THROW( Invalid_File_Format );
814 goto Fail;
815 }
816
817 if ( ft_isdigit( *parser->root.cursor ) )
818 {
819 loader->num_glyphs = T1_ToInt( parser );
820 if ( parser->root.error )
821 return;
822 if ( loader->num_glyphs < 0 )
823 {
824 FT_ERROR(( "t42_parse_encoding: invalid number of glyphs\n" ));
825 error = FT_THROW( Invalid_File_Format );
826 goto Fail;
827 }
828
829 /* we certainly need more than 4 bytes per glyph */
830 if ( loader->num_glyphs > ( limit - parser->root.cursor ) >> 2 )
831 {
832 FT_TRACE0(( "t42_parse_charstrings: adjusting number of glyphs"
833 " (from %d to %d)\n",
834 loader->num_glyphs,
835 ( limit - parser->root.cursor ) >> 2 ));
836 loader->num_glyphs = ( limit - parser->root.cursor ) >> 2;
837 }
838
839 }
840 else if ( *parser->root.cursor == '<' )
841 {
842 /* We have `<< ... >>'. Count the number of `/' in the dictionary */
843 /* to get its size. */
844 FT_Int count = 0;
845
846
848 if ( parser->root.error )
849 return;
851 cur = parser->root.cursor;
852
853 while ( parser->root.cursor < limit )
854 {
855 if ( *parser->root.cursor == '/' )
856 count++;
857 else if ( *parser->root.cursor == '>' )
858 {
859 loader->num_glyphs = count;
860 parser->root.cursor = cur; /* rewind */
861 break;
862 }
864 if ( parser->root.error )
865 return;
867 }
868 }
869 else
870 {
871 FT_ERROR(( "t42_parse_charstrings: invalid token\n" ));
872 error = FT_THROW( Invalid_File_Format );
873 goto Fail;
874 }
875
876 if ( parser->root.cursor >= limit )
877 {
878 FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
879 error = FT_THROW( Invalid_File_Format );
880 goto Fail;
881 }
882
883 /* initialize tables */
884
885 /* contrary to Type1, we disallow multiple CharStrings arrays */
886 if ( swap_table->init )
887 {
888 FT_ERROR(( "t42_parse_charstrings:"
889 " only one CharStrings array allowed\n" ));
890 error = FT_THROW( Invalid_File_Format );
891 goto Fail;
892 }
893
894 error = psaux->ps_table_funcs->init( code_table,
895 loader->num_glyphs,
896 memory );
897 if ( error )
898 goto Fail;
899
900 error = psaux->ps_table_funcs->init( name_table,
901 loader->num_glyphs,
902 memory );
903 if ( error )
904 goto Fail;
905
906 /* Initialize table for swapping index notdef_index and */
907 /* index 0 names and codes (if necessary). */
908
909 error = psaux->ps_table_funcs->init( swap_table, 4, memory );
910 if ( error )
911 goto Fail;
912
913 n = 0;
914
915 for (;;)
916 {
917 /* We support two formats. */
918 /* */
919 /* `/glyphname' + index [+ `def'] */
920 /* `(glyphname)' [+ `cvn'] + index [+ `def'] */
921 /* */
922 /* The latter format gets created by the */
923 /* LilyPond typesetting program. */
924
926
927 cur = parser->root.cursor;
928 if ( cur >= limit )
929 break;
930
931 /* We stop when we find an `end' keyword or '>' */
932 if ( *cur == 'e' &&
933 cur + 3 < limit &&
934 cur[1] == 'n' &&
935 cur[2] == 'd' &&
936 t42_is_space( cur[3] ) )
937 break;
938 if ( *cur == '>' )
939 break;
940
942 if ( parser->root.cursor >= limit )
943 {
944 FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
945 error = FT_THROW( Invalid_File_Format );
946 goto Fail;
947 }
948 if ( parser->root.error )
949 return;
950
951 if ( *cur == '/' || *cur == '(' )
952 {
953 FT_UInt len;
954 FT_Bool have_literal = FT_BOOL( *cur == '(' );
955
956
957 if ( cur + ( have_literal ? 3 : 2 ) >= limit )
958 {
959 FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
960 error = FT_THROW( Invalid_File_Format );
961 goto Fail;
962 }
963
964 cur++; /* skip `/' */
965 len = (FT_UInt)( parser->root.cursor - cur );
966 if ( have_literal )
967 len--;
968
969 error = T1_Add_Table( name_table, n, cur, len + 1 );
970 if ( error )
971 goto Fail;
972
973 /* add a trailing zero to the name table */
974 name_table->elements[n][len] = '\0';
975
976 /* record index of /.notdef */
977 if ( *cur == '.' &&
978 ft_strcmp( ".notdef",
979 (const char*)(name_table->elements[n]) ) == 0 )
980 {
981 notdef_index = n;
982 notdef_found = 1;
983 }
984
986
987 if ( have_literal )
989
990 cur = parser->root.cursor;
991
992 (void)T1_ToInt( parser );
993 if ( parser->root.cursor >= limit )
994 {
995 FT_ERROR(( "t42_parse_charstrings: out of bounds\n" ));
996 error = FT_THROW( Invalid_File_Format );
997 goto Fail;
998 }
999
1000 len = (FT_UInt)( parser->root.cursor - cur );
1001
1002 error = T1_Add_Table( code_table, n, cur, len + 1 );
1003 if ( error )
1004 goto Fail;
1005
1006 code_table->elements[n][len] = '\0';
1007
1008 n++;
1009 if ( n >= loader->num_glyphs )
1010 break;
1011 }
1012 }
1013
1014 loader->num_glyphs = n;
1015
1016 if ( !notdef_found )
1017 {
1018 FT_ERROR(( "t42_parse_charstrings: no /.notdef glyph\n" ));
1019 error = FT_THROW( Invalid_File_Format );
1020 goto Fail;
1021 }
1022
1023 /* if /.notdef does not occupy index 0, do our magic. */
1024 if ( ft_strcmp( (const char*)".notdef",
1025 (const char*)name_table->elements[0] ) )
1026 {
1027 /* Swap glyph in index 0 with /.notdef glyph. First, add index 0 */
1028 /* name and code entries to swap_table. Then place notdef_index */
1029 /* name and code entries into swap_table. Then swap name and code */
1030 /* entries at indices notdef_index and 0 using values stored in */
1031 /* swap_table. */
1032
1033 /* Index 0 name */
1034 error = T1_Add_Table( swap_table, 0,
1035 name_table->elements[0],
1036 name_table->lengths [0] );
1037 if ( error )
1038 goto Fail;
1039
1040 /* Index 0 code */
1041 error = T1_Add_Table( swap_table, 1,
1042 code_table->elements[0],
1043 code_table->lengths [0] );
1044 if ( error )
1045 goto Fail;
1046
1047 /* Index notdef_index name */
1048 error = T1_Add_Table( swap_table, 2,
1049 name_table->elements[notdef_index],
1050 name_table->lengths [notdef_index] );
1051 if ( error )
1052 goto Fail;
1053
1054 /* Index notdef_index code */
1055 error = T1_Add_Table( swap_table, 3,
1056 code_table->elements[notdef_index],
1057 code_table->lengths [notdef_index] );
1058 if ( error )
1059 goto Fail;
1060
1061 error = T1_Add_Table( name_table, notdef_index,
1062 swap_table->elements[0],
1063 swap_table->lengths [0] );
1064 if ( error )
1065 goto Fail;
1066
1067 error = T1_Add_Table( code_table, notdef_index,
1068 swap_table->elements[1],
1069 swap_table->lengths [1] );
1070 if ( error )
1071 goto Fail;
1072
1073 error = T1_Add_Table( name_table, 0,
1074 swap_table->elements[2],
1075 swap_table->lengths [2] );
1076 if ( error )
1077 goto Fail;
1078
1079 error = T1_Add_Table( code_table, 0,
1080 swap_table->elements[3],
1081 swap_table->lengths [3] );
1082 if ( error )
1083 goto Fail;
1084
1085 }
1086
1087 return;
1088
1089 Fail:
1090 parser->root.error = error;
1091 }
1092
1093
1094 static FT_Error
1096 T42_Loader loader,
1097 T1_Field field )
1098 {
1100 void* dummy_object;
1101 void** objects;
1102 FT_UInt max_objects = 0;
1103
1104
1105 /* if the keyword has a dedicated callback, call it */
1107 {
1108 field->reader( (FT_Face)face, loader );
1109 error = loader->parser.root.error;
1110 goto Exit;
1111 }
1112
1113 /* now the keyword is either a simple field or a table of fields; */
1114 /* we are now going to take care of it */
1115
1116 switch ( field->location )
1117 {
1119 dummy_object = &face->type1.font_info;
1120 break;
1121
1123 dummy_object = &face->type1.font_extra;
1124 break;
1125
1127 dummy_object = &face->type1.font_bbox;
1128 break;
1129
1130 default:
1131 dummy_object = &face->type1;
1132 }
1133
1134 objects = &dummy_object;
1135
1139 objects, max_objects, 0 );
1140 else
1141 error = T1_Load_Field( &loader->parser, field,
1142 objects, max_objects, 0 );
1143
1144 Exit:
1145 return error;
1146 }
1147
1148
1151 T42_Loader loader,
1152 FT_Byte* base,
1153 FT_Long size )
1154 {
1155 T42_Parser parser = &loader->parser;
1156 FT_Byte* limit;
1157 FT_Int n_keywords = (FT_Int)( sizeof ( t42_keywords ) /
1158 sizeof ( t42_keywords[0] ) );
1159
1160
1161 parser->root.cursor = base;
1162 parser->root.limit = base + size;
1163 parser->root.error = FT_Err_Ok;
1164
1165 limit = parser->root.limit;
1166
1168
1169 while ( parser->root.cursor < limit )
1170 {
1171 FT_Byte* cur;
1172
1173
1174 cur = parser->root.cursor;
1175
1176 /* look for `FontDirectory' which causes problems for some fonts */
1177 if ( *cur == 'F' && cur + 25 < limit &&
1178 ft_strncmp( (char*)cur, "FontDirectory", 13 ) == 0 )
1179 {
1180 FT_Byte* cur2;
1181
1182
1183 /* skip the `FontDirectory' keyword */
1186 cur = cur2 = parser->root.cursor;
1187
1188 /* look up the `known' keyword */
1189 while ( cur < limit )
1190 {
1191 if ( *cur == 'k' && cur + 5 < limit &&
1192 ft_strncmp( (char*)cur, "known", 5 ) == 0 )
1193 break;
1194
1196 if ( parser->root.error )
1197 goto Exit;
1199 cur = parser->root.cursor;
1200 }
1201
1202 if ( cur < limit )
1203 {
1205
1206
1207 /* skip the `known' keyword and the token following it */
1209 T1_ToToken( parser, &token );
1210
1211 /* if the last token was an array, skip it! */
1212 if ( token.type == T1_TOKEN_TYPE_ARRAY )
1213 cur2 = parser->root.cursor;
1214 }
1215 parser->root.cursor = cur2;
1216 }
1217
1218 /* look for immediates */
1219 else if ( *cur == '/' && cur + 2 < limit )
1220 {
1221 FT_UInt len;
1222
1223
1224 cur++;
1225
1226 parser->root.cursor = cur;
1228 if ( parser->root.error )
1229 goto Exit;
1230
1231 len = (FT_UInt)( parser->root.cursor - cur );
1232
1233 if ( len > 0 && len < 22 && parser->root.cursor < limit )
1234 {
1235 int i;
1236
1237
1238 /* now compare the immediate name to the keyword table */
1239
1240 /* loop through all known keywords */
1241 for ( i = 0; i < n_keywords; i++ )
1242 {
1244 FT_Byte *name = (FT_Byte*)keyword->ident;
1245
1246
1247 if ( !name )
1248 continue;
1249
1250 if ( cur[0] == name[0] &&
1251 len == ft_strlen( (const char *)name ) &&
1252 ft_memcmp( cur, name, len ) == 0 )
1253 {
1254 /* we found it -- run the parsing callback! */
1256 loader,
1257 keyword );
1258 if ( parser->root.error )
1259 return parser->root.error;
1260 break;
1261 }
1262 }
1263 }
1264 }
1265 else
1266 {
1268 if ( parser->root.error )
1269 goto Exit;
1270 }
1271
1273 }
1274
1275 Exit:
1276 return parser->root.error;
1277 }
1278
1279
1280 FT_LOCAL_DEF( void )
1282 T42_Face face )
1283 {
1284 FT_UNUSED( face );
1285
1286 FT_ZERO( loader );
1287 loader->num_glyphs = 0;
1288 loader->num_chars = 0;
1289
1290 /* initialize the tables -- simply set their `init' field to 0 */
1291 loader->encoding_table.init = 0;
1292 loader->charstrings.init = 0;
1293 loader->glyph_names.init = 0;
1294 }
1295
1296
1297 FT_LOCAL_DEF( void )
1299 {
1300 T42_Parser parser = &loader->parser;
1301
1302
1303 /* finalize tables */
1304 T1_Release_Table( &loader->encoding_table );
1305 T1_Release_Table( &loader->charstrings );
1306 T1_Release_Table( &loader->glyph_names );
1307 T1_Release_Table( &loader->swap_table );
1308
1309 /* finalize parser */
1311 }
1312
1313
1314/* END */
#define NULL
Definition: types.h:112
static const WCHAR version[]
Definition: asmname.c:66
int Fail
Definition: ehthrow.cxx:24
FT_DivFix(FT_Long a, FT_Long b)
Definition: ftcalc.c:608
return FT_Err_Ok
Definition: ftbbox.c:527
FT_Matrix_Check(const FT_Matrix *matrix)
Definition: ftcalc.c:751
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:387
#define FT_UNUSED(arg)
Definition: ftconfig.h:100
#define FT_TRACE0(varformat)
Definition: ftdebug.h:185
#define FT_ERROR(varformat)
Definition: ftdebug.h:209
#define FT_TRACE6(varformat)
Definition: ftdebug.h:191
#define FT_THROW(e)
Definition: ftdebug.h:241
#define FT_TRACE2(varformat)
Definition: ftdebug.h:187
#define FT_REALLOC(ptr, cursz, newsz)
Definition: ftmemory.h:305
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:332
#define FT_SET_ERROR(expression)
Definition: ftmemory.h:42
#define FT_ALLOC(ptr, size)
Definition: ftmemory.h:302
#define FT_FREE(ptr)
Definition: ftmemory.h:328
#define FT_ZERO(p)
Definition: ftmemory.h:237
#define FT_ABS(a)
Definition: ftobjs.h:73
#define ft_isdigit(x)
Definition: ftobjs.h:116
#define ft_memcmp
Definition: ftstdlib.h:81
#define ft_strcmp
Definition: ftstdlib.h:86
#define ft_strncmp
Definition: ftstdlib.h:89
#define ft_strlen
Definition: ftstdlib.h:88
#define FT_FRAME_ENTER(size)
Definition: ftstream.h:537
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:514
#define FT_FRAME_EXIT()
Definition: ftstream.h:542
#define FT_STREAM_SKIP(distance)
Definition: ftstream.h:518
#define FT_STREAM_READ(buffer, count)
Definition: ftstream.h:522
#define FT_PEEK_ULONG(p)
Definition: ftstream.h:183
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:65
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
unsigned long FT_ULong
Definition: fttypes.h:253
unsigned char FT_Byte
Definition: fttypes.h:154
signed long FT_Fixed
Definition: fttypes.h:287
int FT_Error
Definition: fttypes.h:299
signed long FT_Long
Definition: fttypes.h:242
#define FT_ERR(e)
Definition: fttypes.h:599
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_BOOL(x)
Definition: fttypes.h:591
signed int FT_Int
Definition: fttypes.h:220
FxCollectionEntry * cur
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble n
Definition: glext.h:7729
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
const GLubyte * c
Definition: glext.h:8905
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLint limit
Definition: glext.h:10326
GLuint GLenum matrix
Definition: glext.h:9407
GLuint64EXT * result
Definition: glext.h:11304
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
if(dx< 0)
Definition: linetemp.h:194
__u8 fs_type[8]
Definition: mkdosfs.c:5
#define error(str)
Definition: mkdosfs.c:1605
static const CLSID * objects[]
Definition: apphelp.c:112
static char memory[1024 *256]
Definition: process.c:116
#define L(x)
Definition: ntvdm.h:50
#define T1_FIELD_BOOL(_ident, _fname, _dict)
Definition: psaux.h:320
@ T1_TOKEN_TYPE_ARRAY
Definition: psaux.h:190
#define T1_FIELD_NUM(_ident, _fname, _dict)
Definition: psaux.h:323
#define T1_FIELD_FIXED(_ident, _fname, _dict)
Definition: psaux.h:326
#define T1_FIELD_KEY(_ident, _fname, _dict)
Definition: psaux.h:336
#define T1_FIELD_BBOX(_ident, _fname, _dict)
Definition: psaux.h:339
struct PSAux_ServiceRec_ * PSAux_Service
@ T1_FIELD_TYPE_INTEGER_ARRAY
Definition: psaux.h:221
@ T1_FIELD_TYPE_NONE
Definition: psaux.h:212
@ T1_FIELD_TYPE_CALLBACK
Definition: psaux.h:223
@ T1_FIELD_TYPE_FIXED_ARRAY
Definition: psaux.h:222
#define T1_FIELD_STRING(_ident, _fname, _dict)
Definition: psaux.h:333
#define T1_FIELD_CALLBACK(_ident, _name, _dict)
Definition: psaux.h:359
@ T1_FIELD_LOCATION_FONT_EXTRA
Definition: psaux.h:235
@ T1_FIELD_LOCATION_CID_INFO
Definition: psaux.h:233
@ T1_FIELD_LOCATION_BBOX
Definition: psaux.h:238
@ T1_FIELD_LOCATION_FONT_INFO
Definition: psaux.h:236
struct T1_FieldRec_ * T1_Field
Definition: psaux.h:181
static calc_node_t temp
Definition: rpn_ieee.c:38
weight
Definition: sortkey.c:157
static void Exit(void)
Definition: sock.c:1330
const PS_Table_FuncsRec * ps_table_funcs
Definition: psaux.h:1348
FT_Byte ** elements
Definition: psaux.h:160
FT_ULong init
Definition: psaux.h:156
FT_UInt * lengths
Definition: psaux.h:161
FT_Error(* init)(PS_Table table, FT_Int count, FT_Memory memory)
Definition: psaux.h:91
PS_TableRec encoding_table
Definition: t42parse.h:47
FT_Int num_chars
Definition: t42parse.h:46
PS_TableRec glyph_names
Definition: t42parse.h:51
T42_ParserRec parser
Definition: t42parse.h:44
PS_TableRec charstrings
Definition: t42parse.h:52
PS_TableRec swap_table
Definition: t42parse.h:53
FT_Int num_glyphs
Definition: t42parse.h:50
Definition: parser.c:44
Definition: name.c:39
Definition: import.c:81
unsigned int error
Definition: inffile.c:97
Definition: ps.c:97
Definition: parse.h:23
ULARGE_INTEGER pos
Definition: request.c:4380
unsigned int size
Definition: parse.h:27
@ T1_ENCODING_TYPE_ISOLATIN1
Definition: t1tables.h:569
@ T1_ENCODING_TYPE_STANDARD
Definition: t1tables.h:568
@ T1_ENCODING_TYPE_ARRAY
Definition: t1tables.h:567
@ T1_ENCODING_TYPE_EXPERT
Definition: t1tables.h:570
T1_FIELD_DICT_FONTDICT family_name
Definition: t1tokens.h:30
notice
Definition: t1tokens.h:26
T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT underline_position
Definition: t1tokens.h:40
T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT italic_angle
Definition: t1tokens.h:36
FT_BEGIN_HEADER struct T1_EncodingRecRec_ * T1_Encoding
static void t42_parse_font_matrix(T42_Face face, T42_Loader loader)
Definition: t42parse.c:243
#define T1_ToToken(p, t)
Definition: t42parse.c:124
t42_parse_dict(T42_Face face, T42_Loader loader, FT_Byte *base, FT_Long size)
Definition: t42parse.c:1150
static void t42_parse_encoding(T42_Face face, T42_Loader loader)
Definition: t42parse.c:301
#define T1_ToBytes(p, b, m, n, d)
Definition: t42parse.c:119
#define T1_ToFixedArray(p, m, f, t)
Definition: t42parse.c:122
t42_parser_init(T42_Parser parser, FT_Stream stream, FT_Memory memory, PSAux_Service psaux)
Definition: t42parse.c:136
#define T1_Add_Table(p, i, o, l)
Definition: t42parse.c:106
#define T1_Release_Table(p)
Definition: t42parse.c:107
#define T1_Skip_Spaces(p)
Definition: t42parse.c:114
#define T1_Skip_PS_Token(p)
Definition: t42parse.c:115
#define T1_ToInt(p)
Definition: t42parse.c:117
static void t42_parse_charstrings(T42_Face face, T42_Loader loader)
Definition: t42parse.c:789
t42_loader_done(T42_Loader loader)
Definition: t42parse.c:1298
static void t42_parse_sfnts(T42_Face face, T42_Loader loader)
Definition: t42parse.c:536
T42_Load_Status_
Definition: t42parse.c:527
@ BEFORE_TABLE_DIR
Definition: t42parse.c:529
@ OTHER_TABLES
Definition: t42parse.c:530
@ BEFORE_START
Definition: t42parse.c:528
static int t42_is_space(FT_Byte c)
Definition: t42parse.c:234
static const T1_FieldRec t42_keywords[]
Definition: t42parse.c:55
t42_loader_init(T42_Loader loader, T42_Face face)
Definition: t42parse.c:1281
static FT_Error t42_load_keyword(T42_Face face, T42_Loader loader, T1_Field field)
Definition: t42parse.c:1095
#define T1_Load_Field(p, f, o, m, pf)
Definition: t42parse.c:127
t42_parser_done(T42_Parser parser)
Definition: t42parse.c:220
enum T42_Load_Status_ T42_Load_Status
#define T1_Load_Field_Table(p, f, o, m, pf)
Definition: t42parse.c:129
FT_BEGIN_HEADER struct T42_ParserRec_ * T42_Parser
FT_BEGIN_HEADER struct T42_FaceRec_ * T42_Face