ReactOS 0.4.15-dev-7711-g5627da4
afmparse.c
Go to the documentation of this file.
1/***************************************************************************/
2/* */
3/* afmparse.c */
4/* */
5/* AFM parser (body). */
6/* */
7/* Copyright 2006-2018 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
18#include <ft2build.h>
19#include FT_FREETYPE_H
20#include FT_INTERNAL_DEBUG_H
21#include FT_INTERNAL_POSTSCRIPT_AUX_H
22
23#ifndef T1_CONFIG_OPTION_NO_AFM
24
25#include "afmparse.h"
26#include "psconv.h"
27
28#include "psauxerr.h"
29
30
31/***************************************************************************/
32/* */
33/* AFM_Stream */
34/* */
35/* The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib. */
36/* */
37/* */
38
39 enum
40 {
45 };
46
47
48 typedef struct AFM_StreamRec_
49 {
53
55
57
58
59#ifndef EOF
60#define EOF -1
61#endif
62
63
64 /* this works because empty lines are ignored */
65#define AFM_IS_NEWLINE( ch ) ( (ch) == '\r' || (ch) == '\n' )
66
67#define AFM_IS_EOF( ch ) ( (ch) == EOF || (ch) == '\x1a' )
68#define AFM_IS_SPACE( ch ) ( (ch) == ' ' || (ch) == '\t' )
69
70 /* column separator; there is no `column' in the spec actually */
71#define AFM_IS_SEP( ch ) ( (ch) == ';' )
72
73#define AFM_GETC() \
74 ( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \
75 : EOF )
76
77#define AFM_STREAM_KEY_BEGIN( stream ) \
78 (char*)( (stream)->cursor - 1 )
79
80#define AFM_STREAM_KEY_LEN( stream, key ) \
81 (FT_Offset)( (char*)(stream)->cursor - key - 1 )
82
83#define AFM_STATUS_EOC( stream ) \
84 ( (stream)->status >= AFM_STREAM_STATUS_EOC )
85
86#define AFM_STATUS_EOL( stream ) \
87 ( (stream)->status >= AFM_STREAM_STATUS_EOL )
88
89#define AFM_STATUS_EOF( stream ) \
90 ( (stream)->status >= AFM_STREAM_STATUS_EOF )
91
92
93 static int
95 {
96 int ch = 0; /* make stupid compiler happy */
97
98
99 if ( AFM_STATUS_EOC( stream ) )
100 return ';';
101
102 while ( 1 )
103 {
104 ch = AFM_GETC();
105 if ( !AFM_IS_SPACE( ch ) )
106 break;
107 }
108
109 if ( AFM_IS_NEWLINE( ch ) )
111 else if ( AFM_IS_SEP( ch ) )
113 else if ( AFM_IS_EOF( ch ) )
115
116 return ch;
117 }
118
119
120 /* read a key or value in current column */
121 static char*
123 {
124 char* str;
125
126
128 if ( AFM_STATUS_EOC( stream ) )
129 return NULL;
130
132
133 while ( 1 )
134 {
135 int ch = AFM_GETC();
136
137
138 if ( AFM_IS_SPACE( ch ) )
139 break;
140 else if ( AFM_IS_NEWLINE( ch ) )
141 {
143 break;
144 }
145 else if ( AFM_IS_SEP( ch ) )
146 {
148 break;
149 }
150 else if ( AFM_IS_EOF( ch ) )
151 {
153 break;
154 }
155 }
156
157 return str;
158 }
159
160
161 /* read a string (i.e., read to EOL) */
162 static char*
164 {
165 char* str;
166
167
169 if ( AFM_STATUS_EOL( stream ) )
170 return NULL;
171
173
174 /* scan to eol */
175 while ( 1 )
176 {
177 int ch = AFM_GETC();
178
179
180 if ( AFM_IS_NEWLINE( ch ) )
181 {
183 break;
184 }
185 else if ( AFM_IS_EOF( ch ) )
186 {
188 break;
189 }
190 }
191
192 return str;
193 }
194
195
196 /*************************************************************************/
197 /* */
198 /* AFM_Parser */
199 /* */
200 /* */
201
202 /* all keys defined in Ch. 7-10 of 5004.AFM_Spec.pdf */
203 typedef enum AFM_Token_
204 {
281
283
284
285 static const char* const afm_key_table[N_AFM_TOKENS] =
286 {
287 "Ascender",
288 "AxisLabel",
289 "AxisType",
290 "B",
291 "BlendAxisTypes",
292 "BlendDesignMap",
293 "BlendDesignPositions",
294 "C",
295 "CC",
296 "CH",
297 "CapHeight",
298 "CharWidth",
299 "CharacterSet",
300 "Characters",
301 "Descender",
302 "EncodingScheme",
303 "EndAxis",
304 "EndCharMetrics",
305 "EndComposites",
306 "EndDirection",
307 "EndFontMetrics",
308 "EndKernData",
309 "EndKernPairs",
310 "EndTrackKern",
311 "EscChar",
312 "FamilyName",
313 "FontBBox",
314 "FontName",
315 "FullName",
316 "IsBaseFont",
317 "IsCIDFont",
318 "IsFixedPitch",
319 "IsFixedV",
320 "ItalicAngle",
321 "KP",
322 "KPH",
323 "KPX",
324 "KPY",
325 "L",
326 "MappingScheme",
327 "MetricsSets",
328 "N",
329 "Notice",
330 "PCC",
331 "StartAxis",
332 "StartCharMetrics",
333 "StartComposites",
334 "StartDirection",
335 "StartFontMetrics",
336 "StartKernData",
337 "StartKernPairs",
338 "StartKernPairs0",
339 "StartKernPairs1",
340 "StartTrackKern",
341 "StdHW",
342 "StdVW",
343 "TrackKern",
344 "UnderlinePosition",
345 "UnderlineThickness",
346 "VV",
347 "VVector",
348 "Version",
349 "W",
350 "W0",
351 "W0X",
352 "W0Y",
353 "W1",
354 "W1X",
355 "W1Y",
356 "WX",
357 "WY",
358 "Weight",
359 "WeightVector",
360 "XHeight"
361 };
362
363
364 /*
365 * `afm_parser_read_vals' and `afm_parser_next_key' provide
366 * high-level operations to an AFM_Stream. The rest of the
367 * parser functions should use them without accessing the
368 * AFM_Stream directly.
369 */
370
373 AFM_Value vals,
374 FT_Int n )
375 {
376 AFM_Stream stream = parser->stream;
377 char* str;
378 FT_Int i;
379
380
381 if ( n > AFM_MAX_ARGUMENTS )
382 return 0;
383
384 for ( i = 0; i < n; i++ )
385 {
387 AFM_Value val = vals + i;
388
389
390 if ( val->type == AFM_VALUE_TYPE_STRING )
392 else
394
395 if ( !str )
396 break;
397
399
400 switch ( val->type )
401 {
404 {
405 FT_Memory memory = parser->memory;
407
408
409 if ( !FT_QALLOC( val->u.s, len + 1 ) )
410 {
411 ft_memcpy( val->u.s, str, len );
412 val->u.s[len] = '\0';
413 }
414 }
415 break;
416
418 val->u.f = PS_Conv_ToFixed( (FT_Byte**)(void*)&str,
419 (FT_Byte*)str + len, 0 );
420 break;
421
423 val->u.i = PS_Conv_ToInt( (FT_Byte**)(void*)&str,
424 (FT_Byte*)str + len );
425 break;
426
428 val->u.b = FT_BOOL( len == 4 &&
429 !ft_strncmp( str, "true", 4 ) );
430 break;
431
433 if ( parser->get_index )
434 val->u.i = parser->get_index( str, len, parser->user_data );
435 else
436 val->u.i = 0;
437 break;
438 }
439 }
440
441 return i;
442 }
443
444
445 FT_LOCAL_DEF( char* )
448 FT_Offset* len )
449 {
450 AFM_Stream stream = parser->stream;
451 char* key = NULL; /* make stupid compiler happy */
452
453
454 if ( line )
455 {
456 while ( 1 )
457 {
458 /* skip current line */
459 if ( !AFM_STATUS_EOL( stream ) )
461
464
465 /* skip empty line */
466 if ( !key &&
469 continue;
470
471 break;
472 }
473 }
474 else
475 {
476 while ( 1 )
477 {
478 /* skip current column */
479 while ( !AFM_STATUS_EOC( stream ) )
481
484
485 /* skip empty column */
486 if ( !key &&
489 continue;
490
491 break;
492 }
493 }
494
495 if ( len )
497 : 0;
498
499 return key;
500 }
501
502
503 static AFM_Token
504 afm_tokenize( const char* key,
505 FT_Offset len )
506 {
507 int n;
508
509
510 for ( n = 0; n < N_AFM_TOKENS; n++ )
511 {
512 if ( *( afm_key_table[n] ) == *key )
513 {
514 for ( ; n < N_AFM_TOKENS; n++ )
515 {
516 if ( *( afm_key_table[n] ) != *key )
517 return AFM_TOKEN_UNKNOWN;
518
519 if ( ft_strncmp( afm_key_table[n], key, len ) == 0 )
520 return (AFM_Token) n;
521 }
522 }
523 }
524
525 return AFM_TOKEN_UNKNOWN;
526 }
527
528
532 FT_Byte* base,
533 FT_Byte* limit )
534 {
537
538
539 if ( FT_NEW( stream ) )
540 return error;
541
542 stream->cursor = stream->base = base;
543 stream->limit = limit;
544
545 /* don't skip the first line during the first call */
547
548 parser->memory = memory;
549 parser->stream = stream;
550 parser->FontInfo = NULL;
551 parser->get_index = NULL;
552
553 return FT_Err_Ok;
554 }
555
556
557 FT_LOCAL( void )
559 {
560 FT_Memory memory = parser->memory;
561
562
563 FT_FREE( parser->stream );
564 }
565
566
567 static FT_Error
569 FT_Int* aint )
570 {
572
573
575
576 if ( afm_parser_read_vals( parser, &val, 1 ) == 1 )
577 {
578 *aint = val.u.i;
579
580 return FT_Err_Ok;
581 }
582 else
583 return FT_THROW( Syntax_Error );
584 }
585
586
587 static FT_Error
589 {
590 AFM_FontInfo fi = parser->FontInfo;
591 AFM_TrackKern tk;
592 char* key;
594 int n = -1;
595 FT_Int tmp;
596
597
598 if ( afm_parser_read_int( parser, &tmp ) )
599 goto Fail;
600
601 if ( tmp < 0 )
602 goto Fail;
603
604 fi->NumTrackKern = (FT_UInt)tmp;
605
606 if ( fi->NumTrackKern )
607 {
608 FT_Memory memory = parser->memory;
610
611
612 if ( FT_QNEW_ARRAY( fi->TrackKerns, fi->NumTrackKern ) )
613 return error;
614 }
615
616 while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
617 {
618 AFM_ValueRec shared_vals[5];
619
620
621 switch ( afm_tokenize( key, len ) )
622 {
624 n++;
625
626 if ( n >= (int)fi->NumTrackKern )
627 goto Fail;
628
629 tk = fi->TrackKerns + n;
630
631 shared_vals[0].type = AFM_VALUE_TYPE_INTEGER;
632 shared_vals[1].type = AFM_VALUE_TYPE_FIXED;
633 shared_vals[2].type = AFM_VALUE_TYPE_FIXED;
634 shared_vals[3].type = AFM_VALUE_TYPE_FIXED;
635 shared_vals[4].type = AFM_VALUE_TYPE_FIXED;
636 if ( afm_parser_read_vals( parser, shared_vals, 5 ) != 5 )
637 goto Fail;
638
639 tk->degree = shared_vals[0].u.i;
640 tk->min_ptsize = shared_vals[1].u.f;
641 tk->min_kern = shared_vals[2].u.f;
642 tk->max_ptsize = shared_vals[3].u.f;
643 tk->max_kern = shared_vals[4].u.f;
644
645 break;
646
650 fi->NumTrackKern = (FT_UInt)( n + 1 );
651 return FT_Err_Ok;
652
654 break;
655
656 default:
657 goto Fail;
658 }
659 }
660
661 Fail:
662 return FT_THROW( Syntax_Error );
663 }
664
665
666#undef KERN_INDEX
667#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 )
668
669
670 /* compare two kerning pairs */
671 FT_CALLBACK_DEF( int )
673 const void* b )
674 {
677
678 FT_ULong index1 = KERN_INDEX( kp1->index1, kp1->index2 );
679 FT_ULong index2 = KERN_INDEX( kp2->index1, kp2->index2 );
680
681
682 if ( index1 > index2 )
683 return 1;
684 else if ( index1 < index2 )
685 return -1;
686 else
687 return 0;
688 }
689
690
691 static FT_Error
693 {
694 AFM_FontInfo fi = parser->FontInfo;
695 AFM_KernPair kp;
696 char* key;
698 int n = -1;
699 FT_Int tmp;
700
701
702 if ( afm_parser_read_int( parser, &tmp ) )
703 goto Fail;
704
705 if ( tmp < 0 )
706 goto Fail;
707
708 fi->NumKernPair = (FT_UInt)tmp;
709
710 if ( fi->NumKernPair )
711 {
712 FT_Memory memory = parser->memory;
714
715
716 if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) )
717 return error;
718 }
719
720 while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
721 {
723
724
725 switch ( token )
726 {
727 case AFM_TOKEN_KP:
728 case AFM_TOKEN_KPX:
729 case AFM_TOKEN_KPY:
730 {
731 FT_Int r;
732 AFM_ValueRec shared_vals[4];
733
734
735 n++;
736
737 if ( n >= (int)fi->NumKernPair )
738 goto Fail;
739
740 kp = fi->KernPairs + n;
741
742 shared_vals[0].type = AFM_VALUE_TYPE_INDEX;
743 shared_vals[1].type = AFM_VALUE_TYPE_INDEX;
744 shared_vals[2].type = AFM_VALUE_TYPE_INTEGER;
745 shared_vals[3].type = AFM_VALUE_TYPE_INTEGER;
746 r = afm_parser_read_vals( parser, shared_vals, 4 );
747 if ( r < 3 )
748 goto Fail;
749
750 /* index values can't be negative */
751 kp->index1 = shared_vals[0].u.u;
752 kp->index2 = shared_vals[1].u.u;
753 if ( token == AFM_TOKEN_KPY )
754 {
755 kp->x = 0;
756 kp->y = shared_vals[2].u.i;
757 }
758 else
759 {
760 kp->x = shared_vals[2].u.i;
761 kp->y = ( token == AFM_TOKEN_KP && r == 4 )
762 ? shared_vals[3].u.i : 0;
763 }
764 }
765 break;
766
770 fi->NumKernPair = (FT_UInt)( n + 1 );
774 return FT_Err_Ok;
775
777 break;
778
779 default:
780 goto Fail;
781 }
782 }
783
784 Fail:
785 return FT_THROW( Syntax_Error );
786 }
787
788
789 static FT_Error
791 {
793 char* key;
795
796
797 while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
798 {
799 switch ( afm_tokenize( key, len ) )
800 {
803 if ( error )
804 return error;
805 break;
806
810 if ( error )
811 return error;
812 break;
813
816 return FT_Err_Ok;
817
819 break;
820
821 default:
822 goto Fail;
823 }
824 }
825
826 Fail:
827 return FT_THROW( Syntax_Error );
828 }
829
830
831 static FT_Error
833 FT_Int n,
834 AFM_Token end_section )
835 {
836 char* key;
838
839
840 while ( n-- > 0 )
841 {
843 if ( !key )
844 goto Fail;
845 }
846
847 while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
848 {
850
851
852 if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS )
853 return FT_Err_Ok;
854 }
855
856 Fail:
857 return FT_THROW( Syntax_Error );
858 }
859
860
863 {
864 FT_Memory memory = parser->memory;
865 AFM_FontInfo fi = parser->FontInfo;
866 FT_Error error = FT_ERR( Syntax_Error );
867 char* key;
869 FT_Int metrics_sets = 0;
870
871
872 if ( !fi )
873 return FT_THROW( Invalid_Argument );
874
876 if ( !key || len != 16 ||
877 ft_strncmp( key, "StartFontMetrics", 16 ) != 0 )
878 return FT_THROW( Unknown_File_Format );
879
880 while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
881 {
882 AFM_ValueRec shared_vals[4];
883
884
885 switch ( afm_tokenize( key, len ) )
886 {
888 if ( afm_parser_read_int( parser, &metrics_sets ) )
889 goto Fail;
890
891 if ( metrics_sets != 0 && metrics_sets != 2 )
892 {
893 error = FT_THROW( Unimplemented_Feature );
894
895 goto Fail;
896 }
897 break;
898
900 shared_vals[0].type = AFM_VALUE_TYPE_BOOL;
901 if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )
902 goto Fail;
903
904 fi->IsCIDFont = shared_vals[0].u.b;
905 break;
906
908 shared_vals[0].type = AFM_VALUE_TYPE_FIXED;
909 shared_vals[1].type = AFM_VALUE_TYPE_FIXED;
910 shared_vals[2].type = AFM_VALUE_TYPE_FIXED;
911 shared_vals[3].type = AFM_VALUE_TYPE_FIXED;
912 if ( afm_parser_read_vals( parser, shared_vals, 4 ) != 4 )
913 goto Fail;
914
915 fi->FontBBox.xMin = shared_vals[0].u.f;
916 fi->FontBBox.yMin = shared_vals[1].u.f;
917 fi->FontBBox.xMax = shared_vals[2].u.f;
918 fi->FontBBox.yMax = shared_vals[3].u.f;
919 break;
920
922 shared_vals[0].type = AFM_VALUE_TYPE_FIXED;
923 if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )
924 goto Fail;
925
926 fi->Ascender = shared_vals[0].u.f;
927 break;
928
930 shared_vals[0].type = AFM_VALUE_TYPE_FIXED;
931 if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )
932 goto Fail;
933
934 fi->Descender = shared_vals[0].u.f;
935 break;
936
938 {
939 FT_Int n = 0;
940
941
942 if ( afm_parser_read_int( parser, &n ) )
943 goto Fail;
944
947 if ( error )
948 return error;
949 }
950 break;
951
954 if ( error )
955 goto Fail;
956 /* fall through since we only support kern data */
957
959 return FT_Err_Ok;
960
961 default:
962 break;
963 }
964 }
965
966 Fail:
967 FT_FREE( fi->TrackKerns );
968 fi->NumTrackKern = 0;
969
970 FT_FREE( fi->KernPairs );
971 fi->NumKernPair = 0;
972
973 fi->IsCIDFont = 0;
974
975 return error;
976 }
977
978#else /* T1_CONFIG_OPTION_NO_AFM */
979
980 /* ANSI C doesn't like empty source files */
981 typedef int _afm_parse_dummy;
982
983#endif /* T1_CONFIG_OPTION_NO_AFM */
984
985
986/* END */
#define AFM_STREAM_KEY_BEGIN(stream)
Definition: afmparse.c:77
afm_parser_init(AFM_Parser parser, FT_Memory memory, FT_Byte *base, FT_Byte *limit)
Definition: afmparse.c:530
#define AFM_STREAM_KEY_LEN(stream, key)
Definition: afmparse.c:80
#define AFM_IS_SPACE(ch)
Definition: afmparse.c:68
#define AFM_STATUS_EOC(stream)
Definition: afmparse.c:83
enum AFM_Token_ AFM_Token
#define AFM_STATUS_EOF(stream)
Definition: afmparse.c:89
static FT_Error afm_parse_kern_pairs(AFM_Parser parser)
Definition: afmparse.c:692
static FT_Error afm_parse_track_kern(AFM_Parser parser)
Definition: afmparse.c:588
static FT_Error afm_parser_skip_section(AFM_Parser parser, FT_Int n, AFM_Token end_section)
Definition: afmparse.c:832
afm_compare_kern_pairs(const void *a, const void *b)
Definition: afmparse.c:672
#define AFM_STATUS_EOL(stream)
Definition: afmparse.c:86
static const char *const afm_key_table[N_AFM_TOKENS]
Definition: afmparse.c:285
static char * afm_stream_read_one(AFM_Stream stream)
Definition: afmparse.c:122
static FT_Error afm_parse_kern_data(AFM_Parser parser)
Definition: afmparse.c:790
@ AFM_STREAM_STATUS_NORMAL
Definition: afmparse.c:41
@ AFM_STREAM_STATUS_EOL
Definition: afmparse.c:43
@ AFM_STREAM_STATUS_EOF
Definition: afmparse.c:44
@ AFM_STREAM_STATUS_EOC
Definition: afmparse.c:42
#define AFM_IS_SEP(ch)
Definition: afmparse.c:71
afm_parser_read_vals(AFM_Parser parser, AFM_Value vals, FT_Int n)
Definition: afmparse.c:372
static int afm_stream_skip_spaces(AFM_Stream stream)
Definition: afmparse.c:94
static FT_Error afm_parser_read_int(AFM_Parser parser, FT_Int *aint)
Definition: afmparse.c:568
#define AFM_IS_NEWLINE(ch)
Definition: afmparse.c:65
struct AFM_StreamRec_ AFM_StreamRec
#define AFM_IS_EOF(ch)
Definition: afmparse.c:67
afm_parser_parse(AFM_Parser parser)
Definition: afmparse.c:862
AFM_Token_
Definition: afmparse.c:204
@ AFM_TOKEN_UNDERLINEPOSITION
Definition: afmparse.c:262
@ AFM_TOKEN_W0X
Definition: afmparse.c:269
@ AFM_TOKEN_W1
Definition: afmparse.c:271
@ AFM_TOKEN_KP
Definition: afmparse.c:239
@ AFM_TOKEN_ENCODINGSCHEME
Definition: afmparse.c:220
@ AFM_TOKEN_STARTTRACKKERN
Definition: afmparse.c:258
@ AFM_TOKEN_STARTKERNDATA
Definition: afmparse.c:254
@ AFM_TOKEN_W0Y
Definition: afmparse.c:270
@ AFM_TOKEN_ENDCOMPOSITES
Definition: afmparse.c:223
@ AFM_TOKEN_BLENDAXISTYPES
Definition: afmparse.c:209
@ AFM_TOKEN_CC
Definition: afmparse.c:213
@ AFM_TOKEN_KPH
Definition: afmparse.c:240
@ AFM_TOKEN_STARTFONTMETRICS
Definition: afmparse.c:253
@ AFM_TOKEN_STARTCOMPOSITES
Definition: afmparse.c:251
@ N_AFM_TOKENS
Definition: afmparse.c:279
@ AFM_TOKEN_STDVW
Definition: afmparse.c:260
@ AFM_TOKEN_VERSION
Definition: afmparse.c:266
@ AFM_TOKEN_UNDERLINETHICKNESS
Definition: afmparse.c:263
@ AFM_TOKEN_W
Definition: afmparse.c:267
@ AFM_TOKEN_ASCENDER
Definition: afmparse.c:205
@ AFM_TOKEN_W1Y
Definition: afmparse.c:273
@ AFM_TOKEN_NOTICE
Definition: afmparse.c:247
@ AFM_TOKEN_ENDKERNPAIRS
Definition: afmparse.c:227
@ AFM_TOKEN_STARTKERNPAIRS0
Definition: afmparse.c:256
@ AFM_TOKEN_ISBASEFONT
Definition: afmparse.c:234
@ AFM_TOKEN_FAMILYNAME
Definition: afmparse.c:230
@ AFM_TOKEN_XHEIGHT
Definition: afmparse.c:278
@ AFM_TOKEN_L
Definition: afmparse.c:243
@ AFM_TOKEN_STARTAXIS
Definition: afmparse.c:249
@ AFM_TOKEN_ENDKERNDATA
Definition: afmparse.c:226
@ AFM_TOKEN_AXISTYPE
Definition: afmparse.c:207
@ AFM_TOKEN_FULLNAME
Definition: afmparse.c:233
@ AFM_TOKEN_KPX
Definition: afmparse.c:241
@ AFM_TOKEN_FONTBBOX
Definition: afmparse.c:231
@ AFM_TOKEN_CH
Definition: afmparse.c:214
@ AFM_TOKEN_ENDDIRECTION
Definition: afmparse.c:224
@ AFM_TOKEN_KPY
Definition: afmparse.c:242
@ AFM_TOKEN_C
Definition: afmparse.c:212
@ AFM_TOKEN_FONTNAME
Definition: afmparse.c:232
@ AFM_TOKEN_ENDTRACKKERN
Definition: afmparse.c:228
@ AFM_TOKEN_TRACKKERN
Definition: afmparse.c:261
@ AFM_TOKEN_CHARACTERS
Definition: afmparse.c:218
@ AFM_TOKEN_MAPPINGSCHEME
Definition: afmparse.c:244
@ AFM_TOKEN_WX
Definition: afmparse.c:274
@ AFM_TOKEN_STARTCHARMETRICS
Definition: afmparse.c:250
@ AFM_TOKEN_STDHW
Definition: afmparse.c:259
@ AFM_TOKEN_N
Definition: afmparse.c:246
@ AFM_TOKEN_WEIGHTVECTOR
Definition: afmparse.c:277
@ AFM_TOKEN_CHARACTERSET
Definition: afmparse.c:217
@ AFM_TOKEN_AXISLABEL
Definition: afmparse.c:206
@ AFM_TOKEN_DESCENDER
Definition: afmparse.c:219
@ AFM_TOKEN_STARTKERNPAIRS
Definition: afmparse.c:255
@ AFM_TOKEN_ENDCHARMETRICS
Definition: afmparse.c:222
@ AFM_TOKEN_VVECTOR
Definition: afmparse.c:265
@ AFM_TOKEN_W0
Definition: afmparse.c:268
@ AFM_TOKEN_ITALICANGLE
Definition: afmparse.c:238
@ AFM_TOKEN_ISFIXEDPITCH
Definition: afmparse.c:236
@ AFM_TOKEN_W1X
Definition: afmparse.c:272
@ AFM_TOKEN_UNKNOWN
Definition: afmparse.c:280
@ AFM_TOKEN_B
Definition: afmparse.c:208
@ AFM_TOKEN_BLENDDESIGNPOSITIONS
Definition: afmparse.c:211
@ AFM_TOKEN_ENDAXIS
Definition: afmparse.c:221
@ AFM_TOKEN_ESCCHAR
Definition: afmparse.c:229
@ AFM_TOKEN_CAPHEIGHT
Definition: afmparse.c:215
@ AFM_TOKEN_WY
Definition: afmparse.c:275
@ AFM_TOKEN_STARTKERNPAIRS1
Definition: afmparse.c:257
@ AFM_TOKEN_ENDFONTMETRICS
Definition: afmparse.c:225
@ AFM_TOKEN_WEIGHT
Definition: afmparse.c:276
@ AFM_TOKEN_ISCIDFONT
Definition: afmparse.c:235
@ AFM_TOKEN_PCC
Definition: afmparse.c:248
@ AFM_TOKEN_VV
Definition: afmparse.c:264
@ AFM_TOKEN_CHARWIDTH
Definition: afmparse.c:216
@ AFM_TOKEN_METRICSSETS
Definition: afmparse.c:245
@ AFM_TOKEN_BLENDDESIGNMAP
Definition: afmparse.c:210
@ AFM_TOKEN_ISFIXEDV
Definition: afmparse.c:237
@ AFM_TOKEN_STARTDIRECTION
Definition: afmparse.c:252
static char * afm_stream_read_string(AFM_Stream stream)
Definition: afmparse.c:163
afm_parser_next_key(AFM_Parser parser, FT_Bool line, FT_Offset *len)
Definition: afmparse.c:446
#define AFM_GETC()
Definition: afmparse.c:73
static AFM_Token afm_tokenize(const char *key, FT_Offset len)
Definition: afmparse.c:504
afm_parser_done(AFM_Parser parser)
Definition: afmparse.c:558
#define KERN_INDEX(g1, g2)
Definition: afmparse.c:667
#define AFM_MAX_ARGUMENTS
Definition: afmparse.h:71
@ AFM_VALUE_TYPE_NAME
Definition: afmparse.h:48
@ AFM_VALUE_TYPE_STRING
Definition: afmparse.h:47
@ AFM_VALUE_TYPE_INDEX
Definition: afmparse.h:52
@ AFM_VALUE_TYPE_INTEGER
Definition: afmparse.h:50
@ AFM_VALUE_TYPE_BOOL
Definition: afmparse.h:51
@ AFM_VALUE_TYPE_FIXED
Definition: afmparse.h:49
#define NULL
Definition: types.h:112
int Fail
Definition: ehthrow.cxx:24
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_CALLBACK_DEF(x)
Definition: ftconfig.h:533
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:388
#define FT_LOCAL(x)
Definition: ftconfig.h:387
#define FT_THROW(e)
Definition: ftdebug.h:213
#define FT_NEW(ptr)
Definition: ftmemory.h:331
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define FT_QALLOC(ptr, size)
Definition: ftmemory.h:316
#define FT_QNEW_ARRAY(ptr, count)
Definition: ftmemory.h:342
#define ft_memcpy
Definition: ftstdlib.h:82
#define ft_strncmp
Definition: ftstdlib.h:89
#define ft_qsort
Definition: ftstdlib.h:122
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
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
int FT_Error
Definition: fttypes.h:300
#define FT_ERR(e)
Definition: fttypes.h:586
unsigned int FT_UInt
Definition: fttypes.h:231
#define FT_BOOL(x)
Definition: fttypes.h:578
size_t FT_Offset
Definition: fttypes.h:324
signed int FT_Int
Definition: fttypes.h:220
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLint limit
Definition: glext.h:10326
GLuint GLfloat * val
Definition: glext.h:7180
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
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 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 * u
Definition: glfuncs.h:240
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
#define error(str)
Definition: mkdosfs.c:1605
static char memory[1024 *256]
Definition: process.c:116
PS_Conv_ToInt(FT_Byte **cursor, FT_Byte *limit)
Definition: psconv.c:162
PS_Conv_ToFixed(FT_Byte **cursor, FT_Byte *limit, FT_Long power_ten)
Definition: psconv.c:196
const WCHAR * str
FT_Fixed Ascender
Definition: t1types.h:173
AFM_KernPair KernPairs
Definition: t1types.h:177
FT_Fixed Descender
Definition: t1types.h:174
FT_Bool IsCIDFont
Definition: t1types.h:171
FT_UInt NumKernPair
Definition: t1types.h:178
AFM_TrackKern TrackKerns
Definition: t1types.h:175
FT_UInt NumTrackKern
Definition: t1types.h:176
FT_BBox FontBBox
Definition: t1types.h:172
FT_UInt index2
Definition: t1types.h:163
FT_UInt index1
Definition: t1types.h:162
FT_Byte * limit
Definition: afmparse.c:52
FT_Int status
Definition: afmparse.c:54
FT_Byte * cursor
Definition: afmparse.c:50
FT_Byte * base
Definition: afmparse.c:51
FT_Fixed max_ptsize
Definition: t1types.h:155
FT_Fixed min_ptsize
Definition: t1types.h:153
FT_Fixed max_kern
Definition: t1types.h:156
FT_Fixed min_kern
Definition: t1types.h:154
FT_UInt u
Definition: afmparse.h:64
enum AFM_ValueType_ type
Definition: afmparse.h:58
FT_Pos xMin
Definition: ftimage.h:117
FT_Pos yMax
Definition: ftimage.h:118
FT_Pos yMin
Definition: ftimage.h:117
FT_Pos xMax
Definition: ftimage.h:118
Definition: copy.c:22
Definition: parser.c:49
Definition: import.c:81
Definition: parse.h:23
struct AFM_KernPairRec_ * AFM_KernPair
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define const
Definition: zconf.h:233