ReactOS  0.4.15-dev-1203-g0e5a4d5
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 
56  } AFM_StreamRec;
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 ) )
110  stream->status = AFM_STREAM_STATUS_EOL;
111  else if ( AFM_IS_SEP( ch ) )
112  stream->status = AFM_STREAM_STATUS_EOC;
113  else if ( AFM_IS_EOF( ch ) )
114  stream->status = AFM_STREAM_STATUS_EOF;
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  {
142  stream->status = AFM_STREAM_STATUS_EOL;
143  break;
144  }
145  else if ( AFM_IS_SEP( ch ) )
146  {
147  stream->status = AFM_STREAM_STATUS_EOC;
148  break;
149  }
150  else if ( AFM_IS_EOF( ch ) )
151  {
152  stream->status = AFM_STREAM_STATUS_EOF;
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  {
182  stream->status = AFM_STREAM_STATUS_EOL;
183  break;
184  }
185  else if ( AFM_IS_EOF( ch ) )
186  {
187  stream->status = AFM_STREAM_STATUS_EOF;
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 
282  } AFM_Token;
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  {
386  FT_Offset len;
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  {
403  case AFM_VALUE_TYPE_NAME:
404  {
405  FT_Memory memory = parser->memory;
406  FT_Error error;
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 
427  case AFM_VALUE_TYPE_BOOL:
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* )
447  FT_Bool line,
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 &&
467  !AFM_STATUS_EOF( stream ) &&
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 &&
487  !AFM_STATUS_EOF( stream ) &&
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  {
536  FT_Error error;
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 */
546  stream->status = AFM_STREAM_STATUS_EOL;
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;
593  FT_Offset len;
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;
609  FT_Error error;
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  {
623  case AFM_TOKEN_TRACKKERN:
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 
653  case AFM_TOKEN_UNKNOWN:
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  {
675  AFM_KernPair kp1 = (AFM_KernPair)a;
676  AFM_KernPair kp2 = (AFM_KernPair)b;
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;
697  FT_Offset len;
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;
713  FT_Error error;
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 );
771  ft_qsort( fi->KernPairs, fi->NumKernPair,
774  return FT_Err_Ok;
775 
776  case AFM_TOKEN_UNKNOWN:
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  {
792  FT_Error error;
793  char* key;
794  FT_Offset len;
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 
818  case AFM_TOKEN_UNKNOWN:
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;
837  FT_Offset len;
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;
868  FT_Offset len;
869  FT_Int metrics_sets = 0;
870 
871 
872  if ( !fi )
873  return FT_THROW( Invalid_Argument );
874 
875  key = afm_parser_next_key( parser, 1, &len );
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 
899  case AFM_TOKEN_ISCIDFONT:
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 
907  case AFM_TOKEN_FONTBBOX:
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 
921  case AFM_TOKEN_ASCENDER:
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 
929  case AFM_TOKEN_DESCENDER:
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 */
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
FT_Fixed max_kern
Definition: t1types.h:156
static const char *const afm_key_table[N_AFM_TOKENS]
Definition: afmparse.c:285
int FT_Error
Definition: fttypes.h:300
FT_Fixed Descender
Definition: t1types.h:174
#define AFM_STATUS_EOC(stream)
Definition: afmparse.c:83
#define ft_strncmp
Definition: ftstdlib.h:89
struct AFM_KernPairRec_ * AFM_KernPair
unsigned long FT_ULong
Definition: fttypes.h:253
AFM_KernPair KernPairs
Definition: t1types.h:177
FT_Bool IsCIDFont
Definition: t1types.h:171
#define error(str)
Definition: mkdosfs.c:1605
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
FT_Fixed min_ptsize
Definition: t1types.h:153
PS_Conv_ToFixed(FT_Byte **cursor, FT_Byte *limit, FT_Long power_ten)
Definition: psconv.c:196
signed int FT_Int
Definition: fttypes.h:220
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define AFM_IS_SPACE(ch)
Definition: afmparse.c:68
afm_parser_parse(AFM_Parser parser)
Definition: afmparse.c:862
GLdouble n
Definition: glext.h:7729
static char * afm_stream_read_one(AFM_Stream stream)
Definition: afmparse.c:122
#define FT_QALLOC(ptr, size)
Definition: ftmemory.h:316
#define FT_QNEW_ARRAY(ptr, count)
Definition: ftmemory.h:342
#define KERN_INDEX(g1, g2)
Definition: afmparse.c:667
AFM_Token_
Definition: afmparse.c:203
static FT_Error afm_parse_kern_pairs(AFM_Parser parser)
Definition: afmparse.c:692
FT_UInt index2
Definition: t1types.h:163
#define AFM_IS_NEWLINE(ch)
Definition: afmparse.c:65
#define AFM_STREAM_KEY_BEGIN(stream)
Definition: afmparse.c:77
return FT_Err_Ok
Definition: ftbbox.c:511
static char memory[1024 *256]
Definition: process.c:116
#define AFM_GETC()
Definition: afmparse.c:73
afm_parser_next_key(AFM_Parser parser, FT_Bool line, FT_Offset *len)
Definition: afmparse.c:446
GLint limit
Definition: glext.h:10326
AFM_TrackKern TrackKerns
Definition: t1types.h:175
afm_parser_done(AFM_Parser parser)
Definition: afmparse.c:558
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
static FT_Error afm_parse_track_kern(AFM_Parser parser)
Definition: afmparse.c:588
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
#define ft_qsort
Definition: ftstdlib.h:122
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_THROW(e)
Definition: ftdebug.h:213
GLuint base
Definition: 3dtext.c:35
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 AFM_STATUS_EOF(stream)
Definition: afmparse.c:89
afm_parser_read_vals(AFM_Parser parser, AFM_Value vals, FT_Int n)
Definition: afmparse.c:372
#define FT_LOCAL(x)
Definition: ftconfig.h:387
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
FT_Pos yMax
Definition: ftimage.h:118
Definition: parser.c:48
FT_BBox FontBBox
Definition: t1types.h:172
#define FT_FREE(ptr)
Definition: ftmemory.h:329
#define AFM_STATUS_EOL(stream)
Definition: afmparse.c:86
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:388
GLuint GLfloat * val
Definition: glext.h:7180
#define FT_ERR(e)
Definition: fttypes.h:586
FT_UInt NumKernPair
Definition: t1types.h:178
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
FT_Fixed min_kern
Definition: t1types.h:154
FT_Pos xMin
Definition: ftimage.h:117
static FT_Error afm_parser_skip_section(AFM_Parser parser, FT_Int n, AFM_Token end_section)
Definition: afmparse.c:832
FT_Pos xMax
Definition: ftimage.h:118
FT_Byte * base
Definition: afmparse.c:51
FT_Byte * limit
Definition: afmparse.c:52
static FT_Error afm_parse_kern_data(AFM_Parser parser)
Definition: afmparse.c:790
static char * afm_stream_read_string(AFM_Stream stream)
Definition: afmparse.c:163
enum AFM_ValueType_ type
Definition: afmparse.h:58
#define FT_CALLBACK_DEF(x)
Definition: ftconfig.h:533
afm_compare_kern_pairs(const void *a, const void *b)
Definition: afmparse.c:672
FT_Byte * cursor
Definition: afmparse.c:50
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
HKEY key
Definition: reg.c:42
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
GLenum GLsizei len
Definition: glext.h:6722
#define FT_BOOL(x)
Definition: fttypes.h:578
enum AFM_Token_ AFM_Token
Definition: hiveinit.c:368
#define AFM_IS_SEP(ch)
Definition: afmparse.c:71
unsigned int FT_UInt
Definition: fttypes.h:231
static FT_Error afm_parser_read_int(AFM_Parser parser, FT_Int *aint)
Definition: afmparse.c:568
FT_Pos yMin
Definition: ftimage.h:117
FT_UInt NumTrackKern
Definition: t1types.h:176
afm_parser_init(AFM_Parser parser, FT_Memory memory, FT_Byte *base, FT_Byte *limit)
Definition: afmparse.c:530
static AFM_Token afm_tokenize(const char *key, FT_Offset len)
Definition: afmparse.c:504
FT_Fixed max_ptsize
Definition: t1types.h:155
static int afm_stream_skip_spaces(AFM_Stream stream)
Definition: afmparse.c:94
FT_UInt index1
Definition: t1types.h:162
Definition: import.c:85
struct AFM_StreamRec_ AFM_StreamRec
#define const
Definition: zconf.h:230
#define FT_NEW(ptr)
Definition: ftmemory.h:331
FT_Fixed Ascender
Definition: t1types.h:173
#define AFM_STREAM_KEY_LEN(stream, key)
Definition: afmparse.c:80
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
PS_Conv_ToInt(FT_Byte **cursor, FT_Byte *limit)
Definition: psconv.c:162
#define ft_memcpy
Definition: ftstdlib.h:82
FT_Int status
Definition: afmparse.c:54
#define AFM_MAX_ARGUMENTS
Definition: afmparse.h:71
FT_UInt u
Definition: afmparse.h:64
#define AFM_IS_EOF(ch)
Definition: afmparse.c:67
size_t FT_Offset
Definition: fttypes.h:324
Definition: path.c:41