Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
afmparse.c
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* afmparse.c */
4 /* */
5 /* AFM parser (body). */
6 /* */
7 /* Copyright 2006-2010, 2012, 2013 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 #include "afmparse.h"
24 #include "psconv.h"
25 
26 #include "psauxerr.h"
27 
28 
29 /***************************************************************************/
30 /* */
31 /* AFM_Stream */
32 /* */
33 /* The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib. */
34 /* */
35 /* */
36 
37  enum
38  {
43  };
44 
45 
46  typedef struct AFM_StreamRec_
47  {
48  FT_Byte* cursor;
49  FT_Byte* base;
50  FT_Byte* limit;
51 
52  FT_Int status;
53 
54  } AFM_StreamRec;
55 
56 
57 #ifndef EOF
58 #define EOF -1
59 #endif
60 
61 
62  /* this works because empty lines are ignored */
63 #define AFM_IS_NEWLINE( ch ) ( (ch) == '\r' || (ch) == '\n' )
64 
65 #define AFM_IS_EOF( ch ) ( (ch) == EOF || (ch) == '\x1a' )
66 #define AFM_IS_SPACE( ch ) ( (ch) == ' ' || (ch) == '\t' )
67 
68  /* column separator; there is no `column' in the spec actually */
69 #define AFM_IS_SEP( ch ) ( (ch) == ';' )
70 
71 #define AFM_GETC() \
72  ( ( (stream)->cursor < (stream)->limit ) ? *(stream)->cursor++ \
73  : EOF )
74 
75 #define AFM_STREAM_KEY_BEGIN( stream ) \
76  (char*)( (stream)->cursor - 1 )
77 
78 #define AFM_STREAM_KEY_LEN( stream, key ) \
79  ( (char*)(stream)->cursor - key - 1 )
80 
81 #define AFM_STATUS_EOC( stream ) \
82  ( (stream)->status >= AFM_STREAM_STATUS_EOC )
83 
84 #define AFM_STATUS_EOL( stream ) \
85  ( (stream)->status >= AFM_STREAM_STATUS_EOL )
86 
87 #define AFM_STATUS_EOF( stream ) \
88  ( (stream)->status >= AFM_STREAM_STATUS_EOF )
89 
90 
91  static int
92  afm_stream_skip_spaces( AFM_Stream stream )
93  {
94  int ch = 0; /* make stupid compiler happy */
95 
96 
97  if ( AFM_STATUS_EOC( stream ) )
98  return ';';
99 
100  while ( 1 )
101  {
102  ch = AFM_GETC();
103  if ( !AFM_IS_SPACE( ch ) )
104  break;
105  }
106 
107  if ( AFM_IS_NEWLINE( ch ) )
108  stream->status = AFM_STREAM_STATUS_EOL;
109  else if ( AFM_IS_SEP( ch ) )
110  stream->status = AFM_STREAM_STATUS_EOC;
111  else if ( AFM_IS_EOF( ch ) )
112  stream->status = AFM_STREAM_STATUS_EOF;
113 
114  return ch;
115  }
116 
117 
118  /* read a key or value in current column */
119  static char*
120  afm_stream_read_one( AFM_Stream stream )
121  {
122  char* str;
123  int ch;
124 
125 
126  afm_stream_skip_spaces( stream );
127  if ( AFM_STATUS_EOC( stream ) )
128  return NULL;
129 
130  str = AFM_STREAM_KEY_BEGIN( stream );
131 
132  while ( 1 )
133  {
134  ch = AFM_GETC();
135  if ( AFM_IS_SPACE( ch ) )
136  break;
137  else if ( AFM_IS_NEWLINE( ch ) )
138  {
139  stream->status = AFM_STREAM_STATUS_EOL;
140  break;
141  }
142  else if ( AFM_IS_SEP( ch ) )
143  {
144  stream->status = AFM_STREAM_STATUS_EOC;
145  break;
146  }
147  else if ( AFM_IS_EOF( ch ) )
148  {
149  stream->status = AFM_STREAM_STATUS_EOF;
150  break;
151  }
152  }
153 
154  return str;
155  }
156 
157 
158  /* read a string (i.e., read to EOL) */
159  static char*
160  afm_stream_read_string( AFM_Stream stream )
161  {
162  char* str;
163  int ch;
164 
165 
166  afm_stream_skip_spaces( stream );
167  if ( AFM_STATUS_EOL( stream ) )
168  return NULL;
169 
170  str = AFM_STREAM_KEY_BEGIN( stream );
171 
172  /* scan to eol */
173  while ( 1 )
174  {
175  ch = AFM_GETC();
176  if ( AFM_IS_NEWLINE( ch ) )
177  {
178  stream->status = AFM_STREAM_STATUS_EOL;
179  break;
180  }
181  else if ( AFM_IS_EOF( ch ) )
182  {
183  stream->status = AFM_STREAM_STATUS_EOF;
184  break;
185  }
186  }
187 
188  return str;
189  }
190 
191 
192  /*************************************************************************/
193  /* */
194  /* AFM_Parser */
195  /* */
196  /* */
197 
198  /* all keys defined in Ch. 7-10 of 5004.AFM_Spec.pdf */
199  typedef enum AFM_Token_
200  {
277 
278  } AFM_Token;
279 
280 
281  static const char* const afm_key_table[N_AFM_TOKENS] =
282  {
283  "Ascender",
284  "AxisLabel",
285  "AxisType",
286  "B",
287  "BlendAxisTypes",
288  "BlendDesignMap",
289  "BlendDesignPositions",
290  "C",
291  "CC",
292  "CH",
293  "CapHeight",
294  "CharWidth",
295  "CharacterSet",
296  "Characters",
297  "Descender",
298  "EncodingScheme",
299  "EndAxis",
300  "EndCharMetrics",
301  "EndComposites",
302  "EndDirection",
303  "EndFontMetrics",
304  "EndKernData",
305  "EndKernPairs",
306  "EndTrackKern",
307  "EscChar",
308  "FamilyName",
309  "FontBBox",
310  "FontName",
311  "FullName",
312  "IsBaseFont",
313  "IsCIDFont",
314  "IsFixedPitch",
315  "IsFixedV",
316  "ItalicAngle",
317  "KP",
318  "KPH",
319  "KPX",
320  "KPY",
321  "L",
322  "MappingScheme",
323  "MetricsSets",
324  "N",
325  "Notice",
326  "PCC",
327  "StartAxis",
328  "StartCharMetrics",
329  "StartComposites",
330  "StartDirection",
331  "StartFontMetrics",
332  "StartKernData",
333  "StartKernPairs",
334  "StartKernPairs0",
335  "StartKernPairs1",
336  "StartTrackKern",
337  "StdHW",
338  "StdVW",
339  "TrackKern",
340  "UnderlinePosition",
341  "UnderlineThickness",
342  "VV",
343  "VVector",
344  "Version",
345  "W",
346  "W0",
347  "W0X",
348  "W0Y",
349  "W1",
350  "W1X",
351  "W1Y",
352  "WX",
353  "WY",
354  "Weight",
355  "WeightVector",
356  "XHeight"
357  };
358 
359 
360  /*
361  * `afm_parser_read_vals' and `afm_parser_next_key' provide
362  * high-level operations to an AFM_Stream. The rest of the
363  * parser functions should use them without accessing the
364  * AFM_Stream directly.
365  */
366 
369  AFM_Value vals,
370  FT_UInt n )
371  {
372  AFM_Stream stream = parser->stream;
373  char* str;
374  FT_UInt i;
375 
376 
377  if ( n > AFM_MAX_ARGUMENTS )
378  return 0;
379 
380  for ( i = 0; i < n; i++ )
381  {
382  FT_Offset len;
383  AFM_Value val = vals + i;
384 
385 
386  if ( val->type == AFM_VALUE_TYPE_STRING )
387  str = afm_stream_read_string( stream );
388  else
389  str = afm_stream_read_one( stream );
390 
391  if ( !str )
392  break;
393 
394  len = AFM_STREAM_KEY_LEN( stream, str );
395 
396  switch ( val->type )
397  {
399  case AFM_VALUE_TYPE_NAME:
400  {
401  FT_Memory memory = parser->memory;
402  FT_Error error;
403 
404 
405  if ( !FT_QALLOC( val->u.s, len + 1 ) )
406  {
407  ft_memcpy( val->u.s, str, len );
408  val->u.s[len] = '\0';
409  }
410  }
411  break;
412 
414  val->u.f = PS_Conv_ToFixed( (FT_Byte**)(void*)&str,
415  (FT_Byte*)str + len, 0 );
416  break;
417 
419  val->u.i = PS_Conv_ToInt( (FT_Byte**)(void*)&str,
420  (FT_Byte*)str + len );
421  break;
422 
423  case AFM_VALUE_TYPE_BOOL:
424  val->u.b = FT_BOOL( len == 4 &&
425  !ft_strncmp( str, "true", 4 ) );
426  break;
427 
429  if ( parser->get_index )
430  val->u.i = parser->get_index( str, len, parser->user_data );
431  else
432  val->u.i = 0;
433  break;
434  }
435  }
436 
437  return i;
438  }
439 
440 
441  FT_LOCAL_DEF( char* )
443  FT_Bool line,
444  FT_Offset* len )
445  {
446  AFM_Stream stream = parser->stream;
447  char* key = 0; /* make stupid compiler happy */
448 
449 
450  if ( line )
451  {
452  while ( 1 )
453  {
454  /* skip current line */
455  if ( !AFM_STATUS_EOL( stream ) )
456  afm_stream_read_string( stream );
457 
459  key = afm_stream_read_one( stream );
460 
461  /* skip empty line */
462  if ( !key &&
463  !AFM_STATUS_EOF( stream ) &&
465  continue;
466 
467  break;
468  }
469  }
470  else
471  {
472  while ( 1 )
473  {
474  /* skip current column */
475  while ( !AFM_STATUS_EOC( stream ) )
476  afm_stream_read_one( stream );
477 
479  key = afm_stream_read_one( stream );
480 
481  /* skip empty column */
482  if ( !key &&
483  !AFM_STATUS_EOF( stream ) &&
485  continue;
486 
487  break;
488  }
489  }
490 
491  if ( len )
492  *len = ( key ) ? (FT_Offset)AFM_STREAM_KEY_LEN( stream, key )
493  : 0;
494 
495  return key;
496  }
497 
498 
499  static AFM_Token
500  afm_tokenize( const char* key,
501  FT_Offset len )
502  {
503  int n;
504 
505 
506  for ( n = 0; n < N_AFM_TOKENS; n++ )
507  {
508  if ( *( afm_key_table[n] ) == *key )
509  {
510  for ( ; n < N_AFM_TOKENS; n++ )
511  {
512  if ( *( afm_key_table[n] ) != *key )
513  return AFM_TOKEN_UNKNOWN;
514 
515  if ( ft_strncmp( afm_key_table[n], key, len ) == 0 )
516  return (AFM_Token) n;
517  }
518  }
519  }
520 
521  return AFM_TOKEN_UNKNOWN;
522  }
523 
524 
527  FT_Memory memory,
528  FT_Byte* base,
529  FT_Byte* limit )
530  {
532  FT_Error error;
533 
534 
535  if ( FT_NEW( stream ) )
536  return error;
537 
538  stream->cursor = stream->base = base;
539  stream->limit = limit;
540 
541  /* don't skip the first line during the first call */
542  stream->status = AFM_STREAM_STATUS_EOL;
543 
544  parser->memory = memory;
545  parser->stream = stream;
546  parser->FontInfo = NULL;
547  parser->get_index = NULL;
548 
549  return FT_Err_Ok;
550  }
551 
552 
553  FT_LOCAL( void )
555  {
556  FT_Memory memory = parser->memory;
557 
558 
559  FT_FREE( parser->stream );
560  }
561 
562 
565  FT_Int* aint )
566  {
568 
569 
571 
572  if ( afm_parser_read_vals( parser, &val, 1 ) == 1 )
573  {
574  *aint = val.u.i;
575 
576  return FT_Err_Ok;
577  }
578  else
579  return FT_THROW( Syntax_Error );
580  }
581 
582 
583  static FT_Error
584  afm_parse_track_kern( AFM_Parser parser )
585  {
586  AFM_FontInfo fi = parser->FontInfo;
587  AFM_TrackKern tk;
588  char* key;
589  FT_Offset len;
590  int n = -1;
591 
592 
593  if ( afm_parser_read_int( parser, &fi->NumTrackKern ) )
594  goto Fail;
595 
596  if ( fi->NumTrackKern )
597  {
598  FT_Memory memory = parser->memory;
599  FT_Error error;
600 
601 
602  if ( FT_QNEW_ARRAY( fi->TrackKerns, fi->NumTrackKern ) )
603  return error;
604  }
605 
606  while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
607  {
608  AFM_ValueRec shared_vals[5];
609 
610 
611  switch ( afm_tokenize( key, len ) )
612  {
613  case AFM_TOKEN_TRACKKERN:
614  n++;
615 
616  if ( n >= fi->NumTrackKern )
617  goto Fail;
618 
619  tk = fi->TrackKerns + n;
620 
621  shared_vals[0].type = AFM_VALUE_TYPE_INTEGER;
622  shared_vals[1].type = AFM_VALUE_TYPE_FIXED;
623  shared_vals[2].type = AFM_VALUE_TYPE_FIXED;
624  shared_vals[3].type = AFM_VALUE_TYPE_FIXED;
625  shared_vals[4].type = AFM_VALUE_TYPE_FIXED;
626  if ( afm_parser_read_vals( parser, shared_vals, 5 ) != 5 )
627  goto Fail;
628 
629  tk->degree = shared_vals[0].u.i;
630  tk->min_ptsize = shared_vals[1].u.f;
631  tk->min_kern = shared_vals[2].u.f;
632  tk->max_ptsize = shared_vals[3].u.f;
633  tk->max_kern = shared_vals[4].u.f;
634 
635  break;
636 
640  fi->NumTrackKern = n + 1;
641  return FT_Err_Ok;
642 
643  case AFM_TOKEN_UNKNOWN:
644  break;
645 
646  default:
647  goto Fail;
648  }
649  }
650 
651  Fail:
652  return FT_THROW( Syntax_Error );
653  }
654 
655 
656 #undef KERN_INDEX
657 #define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 )
658 
659 
660  /* compare two kerning pairs */
661  FT_CALLBACK_DEF( int )
663  const void* b )
664  {
665  AFM_KernPair kp1 = (AFM_KernPair)a;
666  AFM_KernPair kp2 = (AFM_KernPair)b;
667 
668  FT_ULong index1 = KERN_INDEX( kp1->index1, kp1->index2 );
669  FT_ULong index2 = KERN_INDEX( kp2->index1, kp2->index2 );
670 
671 
672  if ( index1 > index2 )
673  return 1;
674  else if ( index1 < index2 )
675  return -1;
676  else
677  return 0;
678  }
679 
680 
681  static FT_Error
682  afm_parse_kern_pairs( AFM_Parser parser )
683  {
684  AFM_FontInfo fi = parser->FontInfo;
685  AFM_KernPair kp;
686  char* key;
687  FT_Offset len;
688  int n = -1;
689 
690 
691  if ( afm_parser_read_int( parser, &fi->NumKernPair ) )
692  goto Fail;
693 
694  if ( fi->NumKernPair )
695  {
696  FT_Memory memory = parser->memory;
697  FT_Error error;
698 
699 
700  if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) )
701  return error;
702  }
703 
704  while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
705  {
706  AFM_Token token = afm_tokenize( key, len );
707 
708 
709  switch ( token )
710  {
711  case AFM_TOKEN_KP:
712  case AFM_TOKEN_KPX:
713  case AFM_TOKEN_KPY:
714  {
715  FT_Int r;
716  AFM_ValueRec shared_vals[4];
717 
718 
719  n++;
720 
721  if ( n >= fi->NumKernPair )
722  goto Fail;
723 
724  kp = fi->KernPairs + n;
725 
726  shared_vals[0].type = AFM_VALUE_TYPE_INDEX;
727  shared_vals[1].type = AFM_VALUE_TYPE_INDEX;
728  shared_vals[2].type = AFM_VALUE_TYPE_INTEGER;
729  shared_vals[3].type = AFM_VALUE_TYPE_INTEGER;
730  r = afm_parser_read_vals( parser, shared_vals, 4 );
731  if ( r < 3 )
732  goto Fail;
733 
734  kp->index1 = shared_vals[0].u.i;
735  kp->index2 = shared_vals[1].u.i;
736  if ( token == AFM_TOKEN_KPY )
737  {
738  kp->x = 0;
739  kp->y = shared_vals[2].u.i;
740  }
741  else
742  {
743  kp->x = shared_vals[2].u.i;
744  kp->y = ( token == AFM_TOKEN_KP && r == 4 )
745  ? shared_vals[3].u.i : 0;
746  }
747  }
748  break;
749 
753  fi->NumKernPair = n + 1;
754  ft_qsort( fi->KernPairs, fi->NumKernPair,
757  return FT_Err_Ok;
758 
759  case AFM_TOKEN_UNKNOWN:
760  break;
761 
762  default:
763  goto Fail;
764  }
765  }
766 
767  Fail:
768  return FT_THROW( Syntax_Error );
769  }
770 
771 
772  static FT_Error
773  afm_parse_kern_data( AFM_Parser parser )
774  {
775  FT_Error error;
776  char* key;
777  FT_Offset len;
778 
779 
780  while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
781  {
782  switch ( afm_tokenize( key, len ) )
783  {
785  error = afm_parse_track_kern( parser );
786  if ( error )
787  return error;
788  break;
789 
792  error = afm_parse_kern_pairs( parser );
793  if ( error )
794  return error;
795  break;
796 
799  return FT_Err_Ok;
800 
801  case AFM_TOKEN_UNKNOWN:
802  break;
803 
804  default:
805  goto Fail;
806  }
807  }
808 
809  Fail:
810  return FT_THROW( Syntax_Error );
811  }
812 
813 
814  static FT_Error
815  afm_parser_skip_section( AFM_Parser parser,
816  FT_UInt n,
817  AFM_Token end_section )
818  {
819  char* key;
820  FT_Offset len;
821 
822 
823  while ( n-- > 0 )
824  {
825  key = afm_parser_next_key( parser, 1, NULL );
826  if ( !key )
827  goto Fail;
828  }
829 
830  while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
831  {
832  AFM_Token token = afm_tokenize( key, len );
833 
834 
835  if ( token == end_section || token == AFM_TOKEN_ENDFONTMETRICS )
836  return FT_Err_Ok;
837  }
838 
839  Fail:
840  return FT_THROW( Syntax_Error );
841  }
842 
843 
846  {
847  FT_Memory memory = parser->memory;
848  AFM_FontInfo fi = parser->FontInfo;
849  FT_Error error = FT_ERR( Syntax_Error );
850  char* key;
851  FT_Offset len;
852  FT_Int metrics_sets = 0;
853 
854 
855  if ( !fi )
856  return FT_THROW( Invalid_Argument );
857 
858  key = afm_parser_next_key( parser, 1, &len );
859  if ( !key || len != 16 ||
860  ft_strncmp( key, "StartFontMetrics", 16 ) != 0 )
861  return FT_THROW( Unknown_File_Format );
862 
863  while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 )
864  {
865  AFM_ValueRec shared_vals[4];
866 
867 
868  switch ( afm_tokenize( key, len ) )
869  {
871  if ( afm_parser_read_int( parser, &metrics_sets ) )
872  goto Fail;
873 
874  if ( metrics_sets != 0 && metrics_sets != 2 )
875  {
876  error = FT_THROW( Unimplemented_Feature );
877 
878  goto Fail;
879  }
880  break;
881 
882  case AFM_TOKEN_ISCIDFONT:
883  shared_vals[0].type = AFM_VALUE_TYPE_BOOL;
884  if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )
885  goto Fail;
886 
887  fi->IsCIDFont = shared_vals[0].u.b;
888  break;
889 
890  case AFM_TOKEN_FONTBBOX:
891  shared_vals[0].type = AFM_VALUE_TYPE_FIXED;
892  shared_vals[1].type = AFM_VALUE_TYPE_FIXED;
893  shared_vals[2].type = AFM_VALUE_TYPE_FIXED;
894  shared_vals[3].type = AFM_VALUE_TYPE_FIXED;
895  if ( afm_parser_read_vals( parser, shared_vals, 4 ) != 4 )
896  goto Fail;
897 
898  fi->FontBBox.xMin = shared_vals[0].u.f;
899  fi->FontBBox.yMin = shared_vals[1].u.f;
900  fi->FontBBox.xMax = shared_vals[2].u.f;
901  fi->FontBBox.yMax = shared_vals[3].u.f;
902  break;
903 
904  case AFM_TOKEN_ASCENDER:
905  shared_vals[0].type = AFM_VALUE_TYPE_FIXED;
906  if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )
907  goto Fail;
908 
909  fi->Ascender = shared_vals[0].u.f;
910  break;
911 
912  case AFM_TOKEN_DESCENDER:
913  shared_vals[0].type = AFM_VALUE_TYPE_FIXED;
914  if ( afm_parser_read_vals( parser, shared_vals, 1 ) != 1 )
915  goto Fail;
916 
917  fi->Descender = shared_vals[0].u.f;
918  break;
919 
921  {
922  FT_Int n = 0;
923 
924 
925  if ( afm_parser_read_int( parser, &n ) )
926  goto Fail;
927 
928  error = afm_parser_skip_section( parser, n,
930  if ( error )
931  return error;
932  }
933  break;
934 
936  error = afm_parse_kern_data( parser );
937  if ( error )
938  goto Fail;
939  /* fall through since we only support kern data */
940 
942  return FT_Err_Ok;
943 
944  default:
945  break;
946  }
947  }
948 
949  Fail:
950  FT_FREE( fi->TrackKerns );
951  fi->NumTrackKern = 0;
952 
953  FT_FREE( fi->KernPairs );
954  fi->NumKernPair = 0;
955 
956  fi->IsCIDFont = 0;
957 
958  return error;
959  }
960 
961 
962 /* END */
char * s
Definition: afmparse.h:61
int FT_Error
Definition: fttypes.h:296
FT_Bool IsCIDFont
Definition: t1types.h:169
GLuint GLuint stream
#define AFM_STATUS_EOC(stream)
Definition: afmparse.c:81
#define ft_strncmp
Definition: ftstdlib.h:88
struct AFM_KernPairRec_ * AFM_KernPair
unsigned long FT_ULong
Definition: fttypes.h:249
GLboolean GLboolean GLboolean GLboolean a
FT_Fixed max_ptsize
Definition: t1types.h:153
struct AFM_StreamRec_ * AFM_Stream
Definition: psaux.h:731
PS_Conv_ToFixed(FT_Byte **cursor, FT_Byte *limit, FT_Long power_ten)
Definition: psconv.c:192
FT_Memory memory
Definition: psaux.h:755
#define NULL
Definition: ftobjs.h:61
signed int FT_Int
Definition: fttypes.h:216
sizeof(AF_ModuleRec)
#define AFM_IS_SPACE(ch)
Definition: afmparse.c:66
afm_parser_parse(AFM_Parser parser)
Definition: afmparse.c:845
return FT_THROW(Missing_Property)
#define FT_QALLOC(ptr, size)
Definition: ftmemory.h:273
#define FT_QNEW_ARRAY(ptr, count)
Definition: ftmemory.h:299
#define KERN_INDEX(g1, g2)
Definition: afmparse.c:657
AFM_Token_
Definition: afmparse.c:199
#define AFM_IS_NEWLINE(ch)
Definition: afmparse.c:63
#define AFM_STREAM_KEY_BEGIN(stream)
Definition: afmparse.c:75
return FT_Err_Ok
Definition: ftbbox.c:645
FT_Int NumTrackKern
Definition: t1types.h:174
#define AFM_GETC()
Definition: afmparse.c:71
afm_parser_next_key(AFM_Parser parser, FT_Bool line, FT_Offset *len)
Definition: afmparse.c:442
FT_Fixed min_kern
Definition: t1types.h:152
GLboolean GLboolean GLboolean b
png_uint_32 i
Definition: png.h:2640
FT_Int i
Definition: afmparse.h:63
afm_parser_done(AFM_Parser parser)
Definition: afmparse.c:554
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
FT_Int index2
Definition: t1types.h:161
#define const
Definition: zconf.h:91
#define ft_qsort
Definition: ftstdlib.h:121
unsigned char FT_Byte
Definition: fttypes.h:150
#define AFM_STATUS_EOF(stream)
Definition: afmparse.c:87
FT_Fixed f
Definition: afmparse.h:62
#define FT_FREE(ptr)
Definition: ftmemory.h:286
FT_Fixed Descender
Definition: t1types.h:172
#define FT_LOCAL(x)
Definition: ftconfig.h:235
#define AFM_STATUS_EOL(stream)
Definition: afmparse.c:84
FT_Pos yMax
Definition: ftimage.h:119
FT_Pos xMin
Definition: ftimage.h:118
GLenum GLsizei len
FT_Fixed min_ptsize
Definition: t1types.h:151
#define FT_ERR(e)
Definition: fttypes.h:582
FT_Error error
Definition: cffdrivr.c:411
GLdouble GLdouble GLdouble r
GLuint GLfloat * val
GLdouble n
#define FT_CALLBACK_DEF(x)
Definition: ftconfig.h:323
AFM_KernPair KernPairs
Definition: t1types.h:175
FT_Pos xMax
Definition: ftimage.h:119
afm_compare_kern_pairs(const void *a, const void *b)
Definition: afmparse.c:662
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_BOOL(x)
Definition: fttypes.h:574
FT_Fixed max_kern
Definition: t1types.h:154
enum AFM_Token_ AFM_Token
FT_Bool b
Definition: afmparse.h:64
#define AFM_IS_SEP(ch)
Definition: afmparse.c:69
afm_parser_read_int(AFM_Parser parser, FT_Int *aint)
Definition: afmparse.c:564
unsigned int FT_UInt
Definition: fttypes.h:227
AFM_TrackKern TrackKerns
Definition: t1types.h:173
union AFM_ValueRec_::@29 u
afm_parser_init(AFM_Parser parser, FT_Memory memory, FT_Byte *base, FT_Byte *limit)
Definition: afmparse.c:526
FT_Int index1
Definition: t1types.h:160
FT_Fixed Ascender
Definition: t1types.h:171
struct AFM_StreamRec_ AFM_StreamRec
FT_BBox FontBBox
Definition: t1types.h:170
#define FT_NEW(ptr)
Definition: ftmemory.h:288
AFM_FontInfo FontInfo
Definition: psaux.h:758
#define AFM_STREAM_KEY_LEN(stream, key)
Definition: afmparse.c:78
PS_Conv_ToInt(FT_Byte **cursor, FT_Byte *limit)
Definition: psconv.c:158
FT_Pos yMin
Definition: ftimage.h:118
#define ft_memcpy
Definition: ftstdlib.h:81
#define AFM_MAX_ARGUMENTS
Definition: afmparse.h:70
enum AFM_ValueType_ type
Definition: afmparse.h:58
FT_Int NumKernPair
Definition: t1types.h:176
GLint limit
#define AFM_IS_EOF(ch)
Definition: afmparse.c:65
#define FT_LOCAL_DEF(x)
Definition: ftconfig.h:236
afm_parser_read_vals(AFM_Parser parser, AFM_Value vals, FT_UInt n)
Definition: afmparse.c:368
size_t FT_Offset
Definition: fttypes.h:320