ReactOS  0.4.15-dev-3181-g4acf100
pfrload.h File Reference
#include "pfrobjs.h"
Include dependency graph for pfrload.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PFR_ExtraItemRec_
 

Macros

#define PFR_CHECK_SIZE(x)
 
#define PFR_CHECK   PFR_CHECK_SIZE
 
#define PFR_NEXT_BYTE(p)   FT_NEXT_BYTE( p )
 
#define PFR_NEXT_INT8(p)   FT_NEXT_CHAR( p )
 
#define PFR_NEXT_SHORT(p)   FT_NEXT_SHORT( p )
 
#define PFR_NEXT_USHORT(p)   FT_NEXT_USHORT( p )
 
#define PFR_NEXT_LONG(p)   FT_NEXT_OFF3( p )
 
#define PFR_NEXT_ULONG(p)   FT_NEXT_UOFF3( p )
 

Typedefs

typedef FT_Error(* PFR_ExtraItem_ParseFunc) (FT_Byte *p, FT_Byte *limit, FT_Pointer data)
 
typedef struct PFR_ExtraItemRec_ PFR_ExtraItemRec
 
typedef const struct PFR_ExtraItemRec_PFR_ExtraItem
 

Functions

 pfr_extra_items_skip (FT_Byte **pp, FT_Byte *limit)
 
 pfr_extra_items_parse (FT_Byte **pp, FT_Byte *limit, PFR_ExtraItem item_list, FT_Pointer item_data)
 
 pfr_header_load (PFR_Header header, FT_Stream stream)
 
 pfr_header_check (PFR_Header header)
 
 pfr_log_font_count (FT_Stream stream, FT_UInt32 log_section_offset, FT_Long *acount)
 
 pfr_log_font_load (PFR_LogFont log_font, FT_Stream stream, FT_UInt face_index, FT_UInt32 section_offset, FT_Bool size_increment)
 
 pfr_phy_font_load (PFR_PhyFont phy_font, FT_Stream stream, FT_UInt32 offset, FT_UInt32 size)
 
 pfr_phy_font_done (PFR_PhyFont phy_font, FT_Memory memory)
 

Macro Definition Documentation

◆ PFR_CHECK

#define PFR_CHECK   PFR_CHECK_SIZE

Definition at line 40 of file pfrload.h.

◆ PFR_CHECK_SIZE

#define PFR_CHECK_SIZE (   x)
Value:
do \
{ \
if ( p + (x) > limit ) \
goto Too_Short; \
} while ( 0 )
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint limit
Definition: glext.h:10326
GLfloat GLfloat p
Definition: glext.h:8902

Definition at line 30 of file pfrload.h.

◆ PFR_NEXT_BYTE

#define PFR_NEXT_BYTE (   p)    FT_NEXT_BYTE( p )

Definition at line 43 of file pfrload.h.

◆ PFR_NEXT_INT8

#define PFR_NEXT_INT8 (   p)    FT_NEXT_CHAR( p )

Definition at line 44 of file pfrload.h.

◆ PFR_NEXT_LONG

#define PFR_NEXT_LONG (   p)    FT_NEXT_OFF3( p )

Definition at line 47 of file pfrload.h.

◆ PFR_NEXT_SHORT

#define PFR_NEXT_SHORT (   p)    FT_NEXT_SHORT( p )

Definition at line 45 of file pfrload.h.

◆ PFR_NEXT_ULONG

#define PFR_NEXT_ULONG (   p)    FT_NEXT_UOFF3( p )

Definition at line 48 of file pfrload.h.

◆ PFR_NEXT_USHORT

#define PFR_NEXT_USHORT (   p)    FT_NEXT_USHORT( p )

Definition at line 46 of file pfrload.h.

Typedef Documentation

◆ PFR_ExtraItem

Definition at line 65 of file pfrload.h.

◆ PFR_ExtraItem_ParseFunc

typedef FT_Error(* PFR_ExtraItem_ParseFunc) (FT_Byte *p, FT_Byte *limit, FT_Pointer data)

Definition at line 54 of file pfrload.h.

◆ PFR_ExtraItemRec

Function Documentation

◆ pfr_extra_items_parse()

pfr_extra_items_parse ( FT_Byte **  pp,
FT_Byte limit,
PFR_ExtraItem  item_list,
FT_Pointer  item_data 
)

Definition at line 134 of file pfrload.c.

138  {
140  FT_Byte* p = *pp;
141  FT_UInt num_items, item_type, item_size;
142 
143 
144  PFR_CHECK( 1 );
145  num_items = PFR_NEXT_BYTE( p );
146 
147  for ( ; num_items > 0; num_items-- )
148  {
149  PFR_CHECK( 2 );
150  item_size = PFR_NEXT_BYTE( p );
151  item_type = PFR_NEXT_BYTE( p );
152 
153  PFR_CHECK( item_size );
154 
155  if ( item_list )
156  {
157  PFR_ExtraItem extra = item_list;
158 
159 
160  for ( extra = item_list; extra->parser != NULL; extra++ )
161  {
162  if ( extra->type == item_type )
163  {
164  error = extra->parser( p, p + item_size, item_data );
165  if ( error )
166  goto Exit;
167 
168  break;
169  }
170  }
171  }
172 
173  p += item_size;
174  }
175 
176  Exit:
177  *pp = p;
178  return error;
179 
180  Too_Short:
181  FT_ERROR(( "pfr_extra_items_parse: invalid extra items table\n" ));
182  error = FT_THROW( Invalid_Table );
183  goto Exit;
184  }
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
return FT_Err_Ok
Definition: ftbbox.c:511
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_THROW(e)
Definition: ftdebug.h:213
#define PFR_CHECK
Definition: pfrload.h:40
Definition: id3.c:95
static void Exit(void)
Definition: sock.c:1331
unsigned int FT_UInt
Definition: fttypes.h:231
#define NULL
Definition: types.h:112
#define PFR_NEXT_BYTE(p)
Definition: pfrload.h:43
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by pfr_extra_items_skip(), and pfr_phy_font_load().

◆ pfr_extra_items_skip()

pfr_extra_items_skip ( FT_Byte **  pp,
FT_Byte limit 
)

Definition at line 126 of file pfrload.c.

128  {
129  return pfr_extra_items_parse( pp, limit, NULL, NULL );
130  }
GLint limit
Definition: glext.h:10326
pfr_extra_items_parse(FT_Byte **pp, FT_Byte *limit, PFR_ExtraItem item_list, FT_Pointer item_data)
Definition: pfrload.c:134
#define NULL
Definition: types.h:112

Referenced by pfr_glyph_load_compound(), pfr_glyph_load_simple(), and pfr_log_font_load().

◆ pfr_header_check()

pfr_header_check ( PFR_Header  header)

Definition at line 261 of file pfrload.c.

262  {
263  FT_Bool result = 1;
264 
265 
266  /* check signature and header size */
267  if ( header->signature != 0x50465230L || /* "PFR0" */
268  header->version > 4 ||
269  header->header_size < 58 ||
270  header->signature2 != 0x0D0A ) /* CR/LF */
271  {
272  result = 0;
273  }
274 
275  return result;
276  }
GLuint64EXT * result
Definition: glext.h:11304
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108

Referenced by pfr_face_init().

◆ pfr_header_load()

pfr_header_load ( PFR_Header  header,
FT_Stream  stream 
)

Definition at line 241 of file pfrload.c.

243  {
244  FT_Error error;
245 
246 
247  /* read header directly */
248  if ( !FT_STREAM_SEEK( 0 ) &&
250  {
251  /* make a few adjustments to the header */
252  header->phy_font_max_size +=
253  (FT_UInt32)header->phy_font_max_size_high << 16;
254  }
255 
256  return error;
257  }
int FT_Error
Definition: fttypes.h:300
#define error(str)
Definition: mkdosfs.c:1605
static const FT_Frame_Field pfr_header_fields[]
Definition: pfrload.c:195
#define FT_STREAM_READ_FIELDS(fields, object)
Definition: ftstream.h:508
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:489

Referenced by pfr_face_init().

◆ pfr_log_font_count()

pfr_log_font_count ( FT_Stream  stream,
FT_UInt32  log_section_offset,
FT_Long acount 
)

Definition at line 289 of file pfrload.c.

292  {
293  FT_Error error;
294  FT_UInt count;
295  FT_UInt result = 0;
296 
297 
298  if ( FT_STREAM_SEEK( section_offset ) ||
299  FT_READ_USHORT( count ) )
300  goto Exit;
301 
302  /* check maximum value and a rough minimum size: */
303  /* - no more than 13106 log fonts */
304  /* - we need 5 bytes for a log header record */
305  /* - we need at least 18 bytes for a log font record */
306  /* - the overall size is at least 95 bytes plus the */
307  /* log header and log font records */
308  if ( count > ( ( 1 << 16 ) - 2 ) / 5 ||
309  2 + count * 5 >= stream->size - section_offset ||
310  95 + count * ( 5 + 18 ) >= stream->size )
311  {
312  FT_ERROR(( "pfr_log_font_count:"
313  " invalid number of logical fonts\n" ));
314  error = FT_THROW( Invalid_Table );
315  goto Exit;
316  }
317 
318  result = count;
319 
320  Exit:
321  *acount = (FT_Long)result;
322  return error;
323  }
int FT_Error
Definition: fttypes.h:300
signed long FT_Long
Definition: fttypes.h:242
#define error(str)
Definition: mkdosfs.c:1605
GLuint64EXT * result
Definition: glext.h:11304
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define FT_READ_USHORT(var)
Definition: ftstream.h:309
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
#define FT_THROW(e)
Definition: ftdebug.h:213
static void Exit(void)
Definition: sock.c:1331
unsigned int size
Definition: parse.h:27
Definition: parse.h:22
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:489
unsigned int FT_UInt
Definition: fttypes.h:231

Referenced by pfr_face_init().

◆ pfr_log_font_load()

pfr_log_font_load ( PFR_LogFont  log_font,
FT_Stream  stream,
FT_UInt  face_index,
FT_UInt32  section_offset,
FT_Bool  size_increment 
)

Definition at line 327 of file pfrload.c.

332  {
333  FT_UInt num_log_fonts;
334  FT_UInt flags;
335  FT_UInt32 offset;
336  FT_UInt32 size;
337  FT_Error error;
338 
339 
340  if ( FT_STREAM_SEEK( section_offset ) ||
341  FT_READ_USHORT( num_log_fonts ) )
342  goto Exit;
343 
344  if ( idx >= num_log_fonts )
345  return FT_THROW( Invalid_Argument );
346 
347  if ( FT_STREAM_SKIP( idx * 5 ) ||
348  FT_READ_USHORT( size ) ||
349  FT_READ_UOFF3 ( offset ) )
350  goto Exit;
351 
352  /* save logical font size and offset */
353  log_font->size = size;
354  log_font->offset = offset;
355 
356  /* now, check the rest of the table before loading it */
357  {
358  FT_Byte* p;
359  FT_Byte* limit;
360  FT_UInt local;
361 
362 
363  if ( FT_STREAM_SEEK( offset ) ||
364  FT_FRAME_ENTER( size ) )
365  goto Exit;
366 
367  p = stream->cursor;
368  limit = p + size;
369 
370  PFR_CHECK( 13 );
371 
372  log_font->matrix[0] = PFR_NEXT_LONG( p );
373  log_font->matrix[1] = PFR_NEXT_LONG( p );
374  log_font->matrix[2] = PFR_NEXT_LONG( p );
375  log_font->matrix[3] = PFR_NEXT_LONG( p );
376 
377  flags = PFR_NEXT_BYTE( p );
378 
379  local = 0;
380  if ( flags & PFR_LOG_STROKE )
381  {
382  local++;
383  if ( flags & PFR_LOG_2BYTE_STROKE )
384  local++;
385 
387  local += 3;
388  }
389  if ( flags & PFR_LOG_BOLD )
390  {
391  local++;
392  if ( flags & PFR_LOG_2BYTE_BOLD )
393  local++;
394  }
395 
396  PFR_CHECK( local );
397 
398  if ( flags & PFR_LOG_STROKE )
399  {
401  ? PFR_NEXT_SHORT( p )
402  : PFR_NEXT_BYTE( p );
403 
405  log_font->miter_limit = PFR_NEXT_LONG( p );
406  }
407 
408  if ( flags & PFR_LOG_BOLD )
409  {
410  log_font->bold_thickness = ( flags & PFR_LOG_2BYTE_BOLD )
411  ? PFR_NEXT_SHORT( p )
412  : PFR_NEXT_BYTE( p );
413  }
414 
415  if ( flags & PFR_LOG_EXTRA_ITEMS )
416  {
418  if ( error )
419  goto Fail;
420  }
421 
422  PFR_CHECK( 5 );
423  log_font->phys_size = PFR_NEXT_USHORT( p );
424  log_font->phys_offset = PFR_NEXT_ULONG( p );
425  if ( size_increment )
426  {
427  PFR_CHECK( 1 );
428  log_font->phys_size += (FT_UInt32)PFR_NEXT_BYTE( p ) << 16;
429  }
430  }
431 
432  Fail:
433  FT_FRAME_EXIT();
434 
435  Exit:
436  return error;
437 
438  Too_Short:
439  FT_ERROR(( "pfr_log_font_load: invalid logical font table\n" ));
440  error = FT_THROW( Invalid_Table );
441  goto Fail;
442  }
FT_Int32 matrix[4]
Definition: pfrtypes.h:83
int FT_Error
Definition: fttypes.h:300
#define PFR_NEXT_LONG(p)
Definition: pfrload.h:47
#define error(str)
Definition: mkdosfs.c:1605
#define PFR_LOG_STROKE
Definition: pfrtypes.h:100
#define FT_READ_UOFF3(var)
Definition: ftstream.h:311
int Fail
Definition: ehthrow.cxx:24
#define FT_READ_USHORT(var)
Definition: ftstream.h:309
#define PFR_LOG_2BYTE_STROKE
Definition: pfrtypes.h:101
GLint limit
Definition: glext.h:10326
FT_Int stroke_thickness
Definition: pfrtypes.h:85
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_THROW(e)
Definition: ftdebug.h:213
FT_Int32 miter_limit
Definition: pfrtypes.h:87
FT_UInt32 phys_size
Definition: pfrtypes.h:89
unsigned int idx
Definition: utils.c:41
pfr_extra_items_skip(FT_Byte **pp, FT_Byte *limit)
Definition: pfrload.c:126
#define FT_STREAM_SKIP(distance)
Definition: ftstream.h:493
FT_UInt32 offset
Definition: pfrtypes.h:81
FT_Int bold_thickness
Definition: pfrtypes.h:86
#define PFR_CHECK
Definition: pfrload.h:40
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
static void Exit(void)
Definition: sock.c:1331
GLbitfield flags
Definition: glext.h:7161
FT_UInt32 phys_offset
Definition: pfrtypes.h:90
Definition: parse.h:22
#define PFR_LOG_2BYTE_BOLD
Definition: pfrtypes.h:103
#define FT_FRAME_EXIT()
Definition: ftstream.h:517
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:489
#define local
Definition: zutil.h:30
unsigned int FT_UInt
Definition: fttypes.h:231
FT_UInt32 size
Definition: pfrtypes.h:80
#define PFR_NEXT_BYTE(p)
Definition: pfrload.h:43
#define FT_FRAME_ENTER(size)
Definition: ftstream.h:512
#define PFR_LOG_BOLD
Definition: pfrtypes.h:102
#define PFR_NEXT_USHORT(p)
Definition: pfrload.h:46
#define PFR_NEXT_ULONG(p)
Definition: pfrload.h:48
#define PFR_LOG_EXTRA_ITEMS
Definition: pfrtypes.h:104
#define PFR_LINE_JOIN_MITER
Definition: pfrtypes.h:95
GLfloat GLfloat p
Definition: glext.h:8902
#define PFR_LINE_JOIN_MASK
Definition: pfrtypes.h:98
#define PFR_NEXT_SHORT(p)
Definition: pfrload.h:45

Referenced by pfr_face_init().

◆ pfr_phy_font_done()

pfr_phy_font_done ( PFR_PhyFont  phy_font,
FT_Memory  memory 
)

Definition at line 778 of file pfrload.c.

780  {
781  FT_FREE( phy_font->font_id );
782  FT_FREE( phy_font->family_name );
783  FT_FREE( phy_font->style_name );
784 
785  FT_FREE( phy_font->vertical.stem_snaps );
786  phy_font->vertical.num_stem_snaps = 0;
787 
788  phy_font->horizontal.stem_snaps = NULL;
789  phy_font->horizontal.num_stem_snaps = 0;
790 
791  FT_FREE( phy_font->strikes );
792  phy_font->num_strikes = 0;
793  phy_font->max_strikes = 0;
794 
795  FT_FREE( phy_font->chars );
796  phy_font->num_chars = 0;
797  phy_font->chars_offset = 0;
798 
799  FT_FREE( phy_font->blue_values );
800  phy_font->num_blue_values = 0;
801 
802  {
804 
805 
806  item = phy_font->kern_items;
807  while ( item )
808  {
809  next = item->next;
810  FT_FREE( item );
811  item = next;
812  }
813  phy_font->kern_items = NULL;
814  phy_font->kern_items_tail = NULL;
815  }
816 
817  phy_font->num_kern_pairs = 0;
818  }
FT_String * style_name
Definition: pfrtypes.h:226
FT_UInt num_blue_values
Definition: pfrtypes.h:232
PFR_DimensionRec horizontal
Definition: pfrtypes.h:221
PFR_KernItem kern_items
Definition: pfrtypes.h:242
#define FT_FREE(ptr)
Definition: ftmemory.h:329
FT_String * font_id
Definition: pfrtypes.h:224
FT_UInt num_stem_snaps
Definition: pfrtypes.h:170
FT_UInt num_kern_pairs
Definition: pfrtypes.h:241
FT_UInt num_strikes
Definition: pfrtypes.h:228
FT_Int * blue_values
Definition: pfrtypes.h:233
FT_UInt max_strikes
Definition: pfrtypes.h:229
FT_Offset chars_offset
Definition: pfrtypes.h:238
FT_Int * stem_snaps
Definition: pfrtypes.h:171
PFR_KernItem * kern_items_tail
Definition: pfrtypes.h:243
FT_UInt num_chars
Definition: pfrtypes.h:237
static unsigned __int64 next
Definition: rand_nt.c:6
static ATOM item
Definition: dde.c:856
FT_String * family_name
Definition: pfrtypes.h:225
#define NULL
Definition: types.h:112
PFR_DimensionRec vertical
Definition: pfrtypes.h:222
PFR_StrikeRec * strikes
Definition: pfrtypes.h:230
PFR_Char chars
Definition: pfrtypes.h:239

Referenced by pfr_face_done().

◆ pfr_phy_font_load()

pfr_phy_font_load ( PFR_PhyFont  phy_font,
FT_Stream  stream,
FT_UInt32  offset,
FT_UInt32  size 
)

Definition at line 822 of file pfrload.c.

826  {
827  FT_Error error;
828  FT_Memory memory = stream->memory;
829  FT_UInt flags;
830  FT_ULong num_aux;
831  FT_Byte* p;
832  FT_Byte* limit;
833 
834 
835  phy_font->memory = memory;
836  phy_font->offset = offset;
837 
838  phy_font->kern_items = NULL;
839  phy_font->kern_items_tail = &phy_font->kern_items;
840 
841  if ( FT_STREAM_SEEK( offset ) ||
842  FT_FRAME_ENTER( size ) )
843  goto Exit;
844 
845  phy_font->cursor = stream->cursor;
846 
847  p = stream->cursor;
848  limit = p + size;
849 
850  PFR_CHECK( 15 );
851  phy_font->font_ref_number = PFR_NEXT_USHORT( p );
852  phy_font->outline_resolution = PFR_NEXT_USHORT( p );
853  phy_font->metrics_resolution = PFR_NEXT_USHORT( p );
854  phy_font->bbox.xMin = PFR_NEXT_SHORT( p );
855  phy_font->bbox.yMin = PFR_NEXT_SHORT( p );
856  phy_font->bbox.xMax = PFR_NEXT_SHORT( p );
857  phy_font->bbox.yMax = PFR_NEXT_SHORT( p );
858  phy_font->flags = flags = PFR_NEXT_BYTE( p );
859 
860  /* get the standard advance for non-proportional fonts */
861  if ( !(flags & PFR_PHY_PROPORTIONAL) )
862  {
863  PFR_CHECK( 2 );
864  phy_font->standard_advance = PFR_NEXT_SHORT( p );
865  }
866 
867  /* load the extra items when present */
868  if ( flags & PFR_PHY_EXTRA_ITEMS )
869  {
871  pfr_phy_font_extra_items, phy_font );
872 
873  if ( error )
874  goto Fail;
875  }
876 
877  /* In certain fonts, the auxiliary bytes contain interesting */
878  /* information. These are not in the specification but can be */
879  /* guessed by looking at the content of a few PFR0 fonts. */
880  PFR_CHECK( 3 );
881  num_aux = PFR_NEXT_ULONG( p );
882 
883  if ( num_aux > 0 )
884  {
885  FT_Byte* q = p;
886  FT_Byte* q2;
887 
888 
889  PFR_CHECK_SIZE( num_aux );
890  p += num_aux;
891 
892  while ( num_aux > 0 )
893  {
895 
896 
897  if ( q + 4 > p )
898  break;
899 
900  length = PFR_NEXT_USHORT( q );
901  if ( length < 4 || length > num_aux )
902  break;
903 
904  q2 = q + length - 2;
905  type = PFR_NEXT_USHORT( q );
906 
907  switch ( type )
908  {
909  case 1:
910  /* this seems to correspond to the font's family name, padded to */
911  /* an even number of bytes with a zero byte appended if needed */
913  &phy_font->family_name );
914  if ( error )
915  goto Exit;
916  break;
917 
918  case 2:
919  if ( q + 32 > q2 )
920  break;
921 
922  q += 10;
923  phy_font->ascent = PFR_NEXT_SHORT( q );
924  phy_font->descent = PFR_NEXT_SHORT( q );
925  phy_font->leading = PFR_NEXT_SHORT( q );
926  break;
927 
928  case 3:
929  /* this seems to correspond to the font's style name, padded to */
930  /* an even number of bytes with a zero byte appended if needed */
932  &phy_font->style_name );
933  if ( error )
934  goto Exit;
935  break;
936 
937  default:
938  ;
939  }
940 
941  q = q2;
942  num_aux -= length;
943  }
944  }
945 
946  /* read the blue values */
947  {
948  FT_UInt n, count;
949 
950 
951  PFR_CHECK( 1 );
952  phy_font->num_blue_values = count = PFR_NEXT_BYTE( p );
953 
954  PFR_CHECK( count * 2 );
955 
956  if ( FT_NEW_ARRAY( phy_font->blue_values, count ) )
957  goto Fail;
958 
959  for ( n = 0; n < count; n++ )
960  phy_font->blue_values[n] = PFR_NEXT_SHORT( p );
961  }
962 
963  PFR_CHECK( 8 );
964  phy_font->blue_fuzz = PFR_NEXT_BYTE( p );
965  phy_font->blue_scale = PFR_NEXT_BYTE( p );
966 
967  phy_font->vertical.standard = PFR_NEXT_USHORT( p );
968  phy_font->horizontal.standard = PFR_NEXT_USHORT( p );
969 
970  /* read the character descriptors */
971  {
972  FT_UInt n, count, Size;
973 
974 
975  phy_font->num_chars = count = PFR_NEXT_USHORT( p );
976  phy_font->chars_offset = offset + (FT_Offset)( p - stream->cursor );
977 
978  Size = 1 + 1 + 2;
980  Size += 1;
981 
982  if ( flags & PFR_PHY_PROPORTIONAL )
983  Size += 2;
984 
985  if ( flags & PFR_PHY_ASCII_CODE )
986  Size += 1;
987 
989  Size += 1;
990 
992  Size += 1;
993 
995 
996  if ( FT_NEW_ARRAY( phy_font->chars, count ) )
997  goto Fail;
998 
999  for ( n = 0; n < count; n++ )
1000  {
1001  PFR_Char cur = &phy_font->chars[n];
1002 
1003 
1004  cur->char_code = ( flags & PFR_PHY_2BYTE_CHARCODE )
1005  ? PFR_NEXT_USHORT( p )
1006  : PFR_NEXT_BYTE( p );
1007 
1008  cur->advance = ( flags & PFR_PHY_PROPORTIONAL )
1009  ? PFR_NEXT_SHORT( p )
1010  : phy_font->standard_advance;
1011 
1012 #if 0
1013  cur->ascii = ( flags & PFR_PHY_ASCII_CODE )
1014  ? PFR_NEXT_BYTE( p )
1015  : 0;
1016 #else
1017  if ( flags & PFR_PHY_ASCII_CODE )
1018  p += 1;
1019 #endif
1020  cur->gps_size = ( flags & PFR_PHY_2BYTE_GPS_SIZE )
1021  ? PFR_NEXT_USHORT( p )
1022  : PFR_NEXT_BYTE( p );
1023 
1024  cur->gps_offset = ( flags & PFR_PHY_3BYTE_GPS_OFFSET )
1025  ? PFR_NEXT_ULONG( p )
1026  : PFR_NEXT_USHORT( p );
1027  }
1028  }
1029 
1030  /* that's it! */
1031 
1032  Fail:
1033  FT_FRAME_EXIT();
1034 
1035  /* save position of bitmap info */
1036  phy_font->bct_offset = FT_STREAM_POS();
1037  phy_font->cursor = NULL;
1038 
1039  Exit:
1040  return error;
1041 
1042  Too_Short:
1043  error = FT_THROW( Invalid_Table );
1044  FT_ERROR(( "pfr_phy_font_load: invalid physical font table\n" ));
1045  goto Fail;
1046  }
int FT_Error
Definition: fttypes.h:300
FT_BBox bbox
Definition: pfrtypes.h:213
unsigned long FT_ULong
Definition: fttypes.h:253
FT_UInt flags
Definition: pfrtypes.h:214
FT_UInt blue_fuzz
Definition: pfrtypes.h:234
#define error(str)
Definition: mkdosfs.c:1605
static const PFR_ExtraItemRec pfr_phy_font_extra_items[]
Definition: pfrload.c:721
FT_UInt outline_resolution
Definition: pfrtypes.h:211
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define PFR_CHECK_SIZE(x)
Definition: pfrload.h:30
#define U(x)
Definition: wordpad.c:45
FT_Int standard_advance
Definition: pfrtypes.h:215
GLdouble n
Definition: glext.h:7729
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
FT_String * style_name
Definition: pfrtypes.h:226
#define PFR_PHY_2BYTE_CHARCODE
Definition: pfrtypes.h:253
int Fail
Definition: ehthrow.cxx:24
static char memory[1024 *256]
Definition: process.c:116
GLint limit
Definition: glext.h:10326
FT_Int descent
Definition: pfrtypes.h:218
FT_ULong bct_offset
Definition: pfrtypes.h:246
#define PFR_PHY_EXTRA_ITEMS
Definition: pfrtypes.h:258
FT_UInt num_blue_values
Definition: pfrtypes.h:232
#define PFR_PHY_ASCII_CODE
Definition: pfrtypes.h:255
PFR_DimensionRec horizontal
Definition: pfrtypes.h:221
static FT_Error pfr_aux_name_load(FT_Byte *p, FT_UInt len, FT_Memory memory, FT_String **astring)
Definition: pfrload.c:736
FT_UInt font_ref_number
Definition: pfrtypes.h:210
#define FT_ERROR(varformat)
Definition: ftdebug.h:181
unsigned char FT_Byte
Definition: fttypes.h:154
#define FT_THROW(e)
Definition: ftdebug.h:213
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
PFR_KernItem kern_items
Definition: pfrtypes.h:242
FT_Pos yMax
Definition: ftimage.h:118
FT_Int * blue_values
Definition: pfrtypes.h:233
#define PFR_CHECK
Definition: pfrload.h:40
FT_UInt metrics_resolution
Definition: pfrtypes.h:212
GLsizeiptr size
Definition: glext.h:5919
FT_Pos xMin
Definition: ftimage.h:117
GLintptr offset
Definition: glext.h:5920
static void Exit(void)
Definition: sock.c:1331
#define PFR_PHY_PROPORTIONAL
Definition: pfrtypes.h:254
FT_UInt32 offset
Definition: pfrtypes.h:208
FT_Pos xMax
Definition: ftimage.h:118
FT_Offset chars_offset
Definition: pfrtypes.h:238
#define PFR_PHY_2BYTE_GPS_SIZE
Definition: pfrtypes.h:256
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLbitfield flags
Definition: glext.h:7161
PFR_KernItem * kern_items_tail
Definition: pfrtypes.h:243
pfr_extra_items_parse(FT_Byte **pp, FT_Byte *limit, PFR_ExtraItem item_list, FT_Pointer item_data)
Definition: pfrload.c:134
FT_Byte * cursor
Definition: pfrtypes.h:247
Definition: parse.h:22
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
#define FT_FRAME_EXIT()
Definition: ftstream.h:517
#define FT_NEW_ARRAY(ptr, count)
Definition: ftmemory.h:333
#define FT_STREAM_SEEK(position)
Definition: ftstream.h:489
FT_UInt num_chars
Definition: pfrtypes.h:237
FxCollectionEntry * cur
#define FT_STREAM_POS()
Definition: ftstream.h:486
#define PFR_PHY_3BYTE_GPS_OFFSET
Definition: pfrtypes.h:257
FT_String * family_name
Definition: pfrtypes.h:225
unsigned int FT_UInt
Definition: fttypes.h:231
FT_Pos yMin
Definition: ftimage.h:117
#define NULL
Definition: types.h:112
#define PFR_NEXT_BYTE(p)
Definition: pfrload.h:43
PFR_DimensionRec vertical
Definition: pfrtypes.h:222
FT_Int ascent
Definition: pfrtypes.h:217
#define FT_FRAME_ENTER(size)
Definition: ftstream.h:512
FT_Int leading
Definition: pfrtypes.h:219
FT_Memory memory
Definition: pfrtypes.h:207
#define PFR_NEXT_USHORT(p)
Definition: pfrload.h:46
#define PFR_NEXT_ULONG(p)
Definition: pfrload.h:48
FT_UInt standard
Definition: pfrtypes.h:169
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLfloat GLfloat p
Definition: glext.h:8902
FT_UInt blue_scale
Definition: pfrtypes.h:235
#define PFR_NEXT_SHORT(p)
Definition: pfrload.h:45
size_t FT_Offset
Definition: fttypes.h:324
PFR_Char chars
Definition: pfrtypes.h:239

Referenced by pfr_face_init().