1 /****************************************************************************
5 * FreeType PFR loader (body).
7 * Copyright (C) 2002-2020 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
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.
20 #include <freetype/internal/ftdebug.h>
21 #include <freetype/internal/ftstream.h>
26 #define FT_COMPONENT pfr
30 * The overall structure of a PFR file is as follows.
33 * 58 bytes (contains nPhysFonts)
35 * Logical font directory (size at most 2^16 bytes)
37 * + nLogFonts * 5 bytes
39 * ==> nLogFonts <= 13106
41 * Logical font section (size at most 2^24 bytes)
42 * nLogFonts * logFontRecord
44 * logFontRecord (size at most 2^16 bytes)
45 * 12 bytes (fontMatrix)
47 * + 0-5 bytes (depending on `flags')
48 * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags')
49 * + 5 bytes (physical font info)
50 * + 0-1 bytes (depending on PFR header)
52 * ==> minimum size 18 bytes
54 * Physical font section (size at most 2^24 bytes)
55 * nPhysFonts * (physFontRecord
56 * + nBitmapSizes * nBmapChars * bmapCharRecord)
58 * physFontRecord (size at most 2^24 bytes)
59 * 14 bytes (font info)
61 * + 0-2 (depending on `flags')
62 * + 0-? (structure too complicated to be shown here; depending on
63 * `flags'; contains `nBitmapSizes' and `nBmapChars')
64 * + 3 bytes (nAuxBytes)
66 * + 1 byte (nBlueValues)
68 * + 6 bytes (hinting data)
69 * + 2 bytes (nCharacters)
70 * + nCharacters * (4-10 bytes) (depending on `flags')
72 * ==> minimum size 27 bytes
77 * Glyph program strings (three possible types: simpleGps, compoundGps,
78 * and bitmapGps; size at most 2^24 bytes)
79 * simpleGps (size at most 2^16 bytes)
81 * 1-2 bytes (n[XY]orus, depending on `flags')
82 * 0-(64+512*2) = 0-1088 bytes (depending on `n[XY]orus')
83 * 0-? (structure too complicated to be shown here; depending on
85 * 1-? glyph data (faintly resembling PS Type 1 charstrings)
87 * ==> minimum size 3 bytes
89 * compoundGps (size at most 2^16 bytes)
90 * 1 byte (nElements <= 63, flags)
91 * + 0-(1+255*(2+255)) = 0-65536 (depending on `flags')
92 * + nElements * (6-14 bytes)
94 * bitmapGps (size at most 2^16 bytes)
96 * 3-13 bytes (position info, depending on `flags')
99 * ==> minimum size 4 bytes
105 * ==> minimum size of a valid PFR:
108 * + 27 (1 physFontRecord)
116 /*************************************************************************/
117 /*************************************************************************/
119 /***** EXTRA ITEMS *****/
121 /*************************************************************************/
122 /*************************************************************************/
125 FT_LOCAL_DEF( FT_Error )
126 pfr_extra_items_skip( FT_Byte* *pp,
129 return pfr_extra_items_parse( pp, limit, NULL, NULL );
133 FT_LOCAL_DEF( FT_Error )
134 pfr_extra_items_parse( FT_Byte* *pp,
136 PFR_ExtraItem item_list,
137 FT_Pointer item_data )
139 FT_Error error = FT_Err_Ok;
141 FT_UInt num_items, item_type, item_size;
145 num_items = PFR_NEXT_BYTE( p );
147 for ( ; num_items > 0; num_items-- )
150 item_size = PFR_NEXT_BYTE( p );
151 item_type = PFR_NEXT_BYTE( p );
153 PFR_CHECK( item_size );
157 PFR_ExtraItem extra = item_list;
160 for ( extra = item_list; extra->parser != NULL; extra++ )
162 if ( extra->type == item_type )
164 error = extra->parser( p, p + item_size, item_data );
181 FT_ERROR(( "pfr_extra_items_parse: invalid extra items table\n" ));
182 error = FT_THROW( Invalid_Table );
187 /*************************************************************************/
188 /*************************************************************************/
190 /***** PFR HEADER *****/
192 /*************************************************************************/
193 /*************************************************************************/
195 static const FT_Frame_Field pfr_header_fields[] =
198 #define FT_STRUCTURE PFR_HeaderRec
200 FT_FRAME_START( 58 ),
201 FT_FRAME_ULONG ( signature ),
202 FT_FRAME_USHORT( version ),
203 FT_FRAME_USHORT( signature2 ),
204 FT_FRAME_USHORT( header_size ),
206 FT_FRAME_USHORT( log_dir_size ),
207 FT_FRAME_USHORT( log_dir_offset ),
209 FT_FRAME_USHORT( log_font_max_size ),
210 FT_FRAME_UOFF3 ( log_font_section_size ),
211 FT_FRAME_UOFF3 ( log_font_section_offset ),
213 FT_FRAME_USHORT( phy_font_max_size ),
214 FT_FRAME_UOFF3 ( phy_font_section_size ),
215 FT_FRAME_UOFF3 ( phy_font_section_offset ),
217 FT_FRAME_USHORT( gps_max_size ),
218 FT_FRAME_UOFF3 ( gps_section_size ),
219 FT_FRAME_UOFF3 ( gps_section_offset ),
221 FT_FRAME_BYTE ( max_blue_values ),
222 FT_FRAME_BYTE ( max_x_orus ),
223 FT_FRAME_BYTE ( max_y_orus ),
225 FT_FRAME_BYTE ( phy_font_max_size_high ),
226 FT_FRAME_BYTE ( color_flags ),
228 FT_FRAME_UOFF3 ( bct_max_size ),
229 FT_FRAME_UOFF3 ( bct_set_max_size ),
230 FT_FRAME_UOFF3 ( phy_bct_set_max_size ),
232 FT_FRAME_USHORT( num_phy_fonts ),
233 FT_FRAME_BYTE ( max_vert_stem_snap ),
234 FT_FRAME_BYTE ( max_horz_stem_snap ),
235 FT_FRAME_USHORT( max_chars ),
240 FT_LOCAL_DEF( FT_Error )
241 pfr_header_load( PFR_Header header,
247 /* read header directly */
248 if ( !FT_STREAM_SEEK( 0 ) &&
249 !FT_STREAM_READ_FIELDS( pfr_header_fields, header ) )
251 /* make a few adjustments to the header */
252 header->phy_font_max_size +=
253 (FT_UInt32)header->phy_font_max_size_high << 16;
260 FT_LOCAL_DEF( FT_Bool )
261 pfr_header_check( PFR_Header header )
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 */
279 /***********************************************************************/
280 /***********************************************************************/
282 /***** PFR LOGICAL FONTS *****/
284 /***********************************************************************/
285 /***********************************************************************/
288 FT_LOCAL_DEF( FT_Error )
289 pfr_log_font_count( FT_Stream stream,
290 FT_UInt32 section_offset,
298 if ( FT_STREAM_SEEK( section_offset ) ||
299 FT_READ_USHORT( count ) )
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 )
312 FT_ERROR(( "pfr_log_font_count:"
313 " invalid number of logical fonts\n" ));
314 error = FT_THROW( Invalid_Table );
321 *acount = (FT_Long)result;
326 FT_LOCAL_DEF( FT_Error )
327 pfr_log_font_load( PFR_LogFont log_font,
330 FT_UInt32 section_offset,
331 FT_Bool size_increment )
333 FT_UInt num_log_fonts;
340 if ( FT_STREAM_SEEK( section_offset ) ||
341 FT_READ_USHORT( num_log_fonts ) )
344 if ( idx >= num_log_fonts )
345 return FT_THROW( Invalid_Argument );
347 if ( FT_STREAM_SKIP( idx * 5 ) ||
348 FT_READ_USHORT( size ) ||
349 FT_READ_UOFF3 ( offset ) )
352 /* save logical font size and offset */
353 log_font->size = size;
354 log_font->offset = offset;
356 /* now, check the rest of the table before loading it */
363 if ( FT_STREAM_SEEK( offset ) ||
364 FT_FRAME_ENTER( size ) )
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 );
377 flags = PFR_NEXT_BYTE( p );
380 if ( flags & PFR_LOG_STROKE )
383 if ( flags & PFR_LOG_2BYTE_STROKE )
386 if ( ( flags & PFR_LINE_JOIN_MASK ) == PFR_LINE_JOIN_MITER )
389 if ( flags & PFR_LOG_BOLD )
392 if ( flags & PFR_LOG_2BYTE_BOLD )
398 if ( flags & PFR_LOG_STROKE )
400 log_font->stroke_thickness = ( flags & PFR_LOG_2BYTE_STROKE )
401 ? PFR_NEXT_SHORT( p )
402 : PFR_NEXT_BYTE( p );
404 if ( ( flags & PFR_LINE_JOIN_MASK ) == PFR_LINE_JOIN_MITER )
405 log_font->miter_limit = PFR_NEXT_LONG( p );
408 if ( flags & PFR_LOG_BOLD )
410 log_font->bold_thickness = ( flags & PFR_LOG_2BYTE_BOLD )
411 ? PFR_NEXT_SHORT( p )
412 : PFR_NEXT_BYTE( p );
415 if ( flags & PFR_LOG_EXTRA_ITEMS )
417 error = pfr_extra_items_skip( &p, limit );
423 log_font->phys_size = PFR_NEXT_USHORT( p );
424 log_font->phys_offset = PFR_NEXT_ULONG( p );
425 if ( size_increment )
428 log_font->phys_size += (FT_UInt32)PFR_NEXT_BYTE( p ) << 16;
439 FT_ERROR(( "pfr_log_font_load: invalid logical font table\n" ));
440 error = FT_THROW( Invalid_Table );
445 /***********************************************************************/
446 /***********************************************************************/
448 /***** PFR PHYSICAL FONTS *****/
450 /***********************************************************************/
451 /***********************************************************************/
454 /* load bitmap strikes lists */
455 FT_CALLBACK_DEF( FT_Error )
456 pfr_extra_item_load_bitmap_info( FT_Byte* p,
458 PFR_PhyFont phy_font )
460 FT_Memory memory = phy_font->memory;
463 FT_UInt n, count, size1;
464 FT_Error error = FT_Err_Ok;
469 p += 3; /* skip bctSize */
470 flags0 = PFR_NEXT_BYTE( p );
471 count = PFR_NEXT_BYTE( p );
473 /* re-allocate when needed */
474 if ( phy_font->num_strikes + count > phy_font->max_strikes )
476 FT_UInt new_max = FT_PAD_CEIL( phy_font->num_strikes + count, 4 );
479 if ( FT_RENEW_ARRAY( phy_font->strikes,
480 phy_font->num_strikes,
484 phy_font->max_strikes = new_max;
487 size1 = 1 + 1 + 1 + 2 + 2 + 1;
488 if ( flags0 & PFR_STRIKE_2BYTE_XPPM )
491 if ( flags0 & PFR_STRIKE_2BYTE_YPPM )
494 if ( flags0 & PFR_STRIKE_3BYTE_SIZE )
497 if ( flags0 & PFR_STRIKE_3BYTE_OFFSET )
500 if ( flags0 & PFR_STRIKE_2BYTE_COUNT )
503 strike = phy_font->strikes + phy_font->num_strikes;
505 PFR_CHECK( count * size1 );
507 for ( n = 0; n < count; n++, strike++ )
509 strike->x_ppm = ( flags0 & PFR_STRIKE_2BYTE_XPPM )
510 ? PFR_NEXT_USHORT( p )
511 : PFR_NEXT_BYTE( p );
513 strike->y_ppm = ( flags0 & PFR_STRIKE_2BYTE_YPPM )
514 ? PFR_NEXT_USHORT( p )
515 : PFR_NEXT_BYTE( p );
517 strike->flags = PFR_NEXT_BYTE( p );
519 strike->bct_size = ( flags0 & PFR_STRIKE_3BYTE_SIZE )
520 ? PFR_NEXT_ULONG( p )
521 : PFR_NEXT_USHORT( p );
523 strike->bct_offset = ( flags0 & PFR_STRIKE_3BYTE_OFFSET )
524 ? PFR_NEXT_ULONG( p )
525 : PFR_NEXT_USHORT( p );
527 strike->num_bitmaps = ( flags0 & PFR_STRIKE_2BYTE_COUNT )
528 ? PFR_NEXT_USHORT( p )
529 : PFR_NEXT_BYTE( p );
532 phy_font->num_strikes += count;
538 error = FT_THROW( Invalid_Table );
539 FT_ERROR(( "pfr_extra_item_load_bitmap_info:"
540 " invalid bitmap info table\n" ));
545 /* Load font ID. This is a so-called `unique' name that is rather
546 * long and descriptive (like `Tiresias ScreenFont v7.51').
548 * Note that a PFR font's family name is contained in an *undocumented*
549 * string of the `auxiliary data' portion of a physical font record. This
550 * may also contain the `real' style name!
552 * If no family name is present, the font ID is used instead for the
555 FT_CALLBACK_DEF( FT_Error )
556 pfr_extra_item_load_font_id( FT_Byte* p,
558 PFR_PhyFont phy_font )
560 FT_Error error = FT_Err_Ok;
561 FT_Memory memory = phy_font->memory;
562 FT_UInt len = (FT_UInt)( limit - p );
565 if ( phy_font->font_id )
568 if ( FT_ALLOC( phy_font->font_id, len + 1 ) )
571 /* copy font ID name, and terminate it for safety */
572 FT_MEM_COPY( phy_font->font_id, p, len );
573 phy_font->font_id[len] = 0;
580 /* load stem snap tables */
581 FT_CALLBACK_DEF( FT_Error )
582 pfr_extra_item_load_stem_snaps( FT_Byte* p,
584 PFR_PhyFont phy_font )
586 FT_UInt count, num_vert, num_horz;
587 FT_Int* snaps = NULL;
588 FT_Error error = FT_Err_Ok;
589 FT_Memory memory = phy_font->memory;
592 if ( phy_font->vertical.stem_snaps )
596 count = PFR_NEXT_BYTE( p );
598 num_vert = count & 15;
599 num_horz = count >> 4;
600 count = num_vert + num_horz;
602 PFR_CHECK( count * 2 );
604 if ( FT_NEW_ARRAY( snaps, count ) )
607 phy_font->vertical.stem_snaps = snaps;
608 phy_font->horizontal.stem_snaps = snaps + num_vert;
610 for ( ; count > 0; count--, snaps++ )
611 *snaps = FT_NEXT_SHORT( p );
617 error = FT_THROW( Invalid_Table );
618 FT_ERROR(( "pfr_extra_item_load_stem_snaps:"
619 " invalid stem snaps table\n" ));
625 /* load kerning pair data */
626 FT_CALLBACK_DEF( FT_Error )
627 pfr_extra_item_load_kerning_pairs( FT_Byte* p,
629 PFR_PhyFont phy_font )
631 PFR_KernItem item = NULL;
632 FT_Error error = FT_Err_Ok;
633 FT_Memory memory = phy_font->memory;
636 if ( FT_NEW( item ) )
641 item->pair_count = PFR_NEXT_BYTE( p );
642 item->base_adj = PFR_NEXT_SHORT( p );
643 item->flags = PFR_NEXT_BYTE( p );
644 item->offset = phy_font->offset +
645 (FT_Offset)( p - phy_font->cursor );
647 #ifndef PFR_CONFIG_NO_CHECKS
650 if ( item->flags & PFR_KERN_2BYTE_CHAR )
651 item->pair_size += 2;
653 if ( item->flags & PFR_KERN_2BYTE_ADJ )
654 item->pair_size += 1;
656 PFR_CHECK( item->pair_count * item->pair_size );
659 /* load first and last pairs into the item to speed up */
660 /* lookup later... */
661 if ( item->pair_count > 0 )
663 FT_UInt char1, char2;
667 if ( item->flags & PFR_KERN_2BYTE_CHAR )
670 char1 = PFR_NEXT_USHORT( q );
671 char2 = PFR_NEXT_USHORT( q );
673 item->pair1 = PFR_KERN_INDEX( char1, char2 );
675 q = p + item->pair_size * ( item->pair_count - 1 );
676 char1 = PFR_NEXT_USHORT( q );
677 char2 = PFR_NEXT_USHORT( q );
679 item->pair2 = PFR_KERN_INDEX( char1, char2 );
684 char1 = PFR_NEXT_BYTE( q );
685 char2 = PFR_NEXT_BYTE( q );
687 item->pair1 = PFR_KERN_INDEX( char1, char2 );
689 q = p + item->pair_size * ( item->pair_count - 1 );
690 char1 = PFR_NEXT_BYTE( q );
691 char2 = PFR_NEXT_BYTE( q );
693 item->pair2 = PFR_KERN_INDEX( char1, char2 );
696 /* add new item to the current list */
698 *phy_font->kern_items_tail = item;
699 phy_font->kern_items_tail = &item->next;
700 phy_font->num_kern_pairs += item->pair_count;
714 error = FT_THROW( Invalid_Table );
715 FT_ERROR(( "pfr_extra_item_load_kerning_pairs:"
716 " invalid kerning pairs table\n" ));
721 static const PFR_ExtraItemRec pfr_phy_font_extra_items[] =
723 { 1, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_bitmap_info },
724 { 2, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_font_id },
725 { 3, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_stem_snaps },
726 { 4, (PFR_ExtraItem_ParseFunc)pfr_extra_item_load_kerning_pairs },
732 * Load a name from the auxiliary data. Since this extracts undocumented
733 * strings from the font file, we need to be careful here.
736 pfr_aux_name_load( FT_Byte* p,
739 FT_String* *astring )
741 FT_Error error = FT_Err_Ok;
742 FT_String* result = NULL;
749 if ( len > 0 && p[len - 1] == 0 )
752 /* check that each character is ASCII */
753 /* for making sure not to load garbage */
755 for ( n = 0; n < len; n++ )
756 if ( p[n] < 32 || p[n] > 127 )
764 if ( FT_ALLOC( result, len + 1 ) )
767 FT_MEM_COPY( result, p, len );
778 pfr_phy_font_done( PFR_PhyFont phy_font,
781 FT_FREE( phy_font->font_id );
782 FT_FREE( phy_font->family_name );
783 FT_FREE( phy_font->style_name );
785 FT_FREE( phy_font->vertical.stem_snaps );
786 phy_font->vertical.num_stem_snaps = 0;
788 phy_font->horizontal.stem_snaps = NULL;
789 phy_font->horizontal.num_stem_snaps = 0;
791 FT_FREE( phy_font->strikes );
792 phy_font->num_strikes = 0;
793 phy_font->max_strikes = 0;
795 FT_FREE( phy_font->chars );
796 phy_font->num_chars = 0;
797 phy_font->chars_offset = 0;
799 FT_FREE( phy_font->blue_values );
800 phy_font->num_blue_values = 0;
803 PFR_KernItem item, next;
806 item = phy_font->kern_items;
813 phy_font->kern_items = NULL;
814 phy_font->kern_items_tail = NULL;
817 phy_font->num_kern_pairs = 0;
821 FT_LOCAL_DEF( FT_Error )
822 pfr_phy_font_load( PFR_PhyFont phy_font,
828 FT_Memory memory = stream->memory;
835 phy_font->memory = memory;
836 phy_font->offset = offset;
838 phy_font->kern_items = NULL;
839 phy_font->kern_items_tail = &phy_font->kern_items;
841 if ( FT_STREAM_SEEK( offset ) ||
842 FT_FRAME_ENTER( size ) )
845 phy_font->cursor = stream->cursor;
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 );
860 /* get the standard advance for non-proportional fonts */
861 if ( !(flags & PFR_PHY_PROPORTIONAL) )
864 phy_font->standard_advance = PFR_NEXT_SHORT( p );
867 /* load the extra items when present */
868 if ( flags & PFR_PHY_EXTRA_ITEMS )
870 error = pfr_extra_items_parse( &p, limit,
871 pfr_phy_font_extra_items, phy_font );
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. */
881 num_aux = PFR_NEXT_ULONG( p );
889 PFR_CHECK_SIZE( num_aux );
892 while ( num_aux > 0 )
894 FT_UInt length, type;
900 length = PFR_NEXT_USHORT( q );
901 if ( length < 4 || length > num_aux )
905 type = PFR_NEXT_USHORT( q );
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 */
912 error = pfr_aux_name_load( q, length - 4U, memory,
913 &phy_font->family_name );
923 phy_font->ascent = PFR_NEXT_SHORT( q );
924 phy_font->descent = PFR_NEXT_SHORT( q );
925 phy_font->leading = PFR_NEXT_SHORT( q );
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 */
931 error = pfr_aux_name_load( q, length - 4U, memory,
932 &phy_font->style_name );
946 /* read the blue values */
952 phy_font->num_blue_values = count = PFR_NEXT_BYTE( p );
954 PFR_CHECK( count * 2 );
956 if ( FT_NEW_ARRAY( phy_font->blue_values, count ) )
959 for ( n = 0; n < count; n++ )
960 phy_font->blue_values[n] = PFR_NEXT_SHORT( p );
964 phy_font->blue_fuzz = PFR_NEXT_BYTE( p );
965 phy_font->blue_scale = PFR_NEXT_BYTE( p );
967 phy_font->vertical.standard = PFR_NEXT_USHORT( p );
968 phy_font->horizontal.standard = PFR_NEXT_USHORT( p );
970 /* read the character descriptors */
972 FT_UInt n, count, Size;
975 phy_font->num_chars = count = PFR_NEXT_USHORT( p );
976 phy_font->chars_offset = offset + (FT_Offset)( p - stream->cursor );
979 if ( flags & PFR_PHY_2BYTE_CHARCODE )
982 if ( flags & PFR_PHY_PROPORTIONAL )
985 if ( flags & PFR_PHY_ASCII_CODE )
988 if ( flags & PFR_PHY_2BYTE_GPS_SIZE )
991 if ( flags & PFR_PHY_3BYTE_GPS_OFFSET )
994 PFR_CHECK_SIZE( count * Size );
996 if ( FT_NEW_ARRAY( phy_font->chars, count ) )
999 for ( n = 0; n < count; n++ )
1001 PFR_Char cur = &phy_font->chars[n];
1004 cur->char_code = ( flags & PFR_PHY_2BYTE_CHARCODE )
1005 ? PFR_NEXT_USHORT( p )
1006 : PFR_NEXT_BYTE( p );
1008 cur->advance = ( flags & PFR_PHY_PROPORTIONAL )
1009 ? PFR_NEXT_SHORT( p )
1010 : phy_font->standard_advance;
1013 cur->ascii = ( flags & PFR_PHY_ASCII_CODE )
1014 ? PFR_NEXT_BYTE( p )
1017 if ( flags & PFR_PHY_ASCII_CODE )
1020 cur->gps_size = ( flags & PFR_PHY_2BYTE_GPS_SIZE )
1021 ? PFR_NEXT_USHORT( p )
1022 : PFR_NEXT_BYTE( p );
1024 cur->gps_offset = ( flags & PFR_PHY_3BYTE_GPS_OFFSET )
1025 ? PFR_NEXT_ULONG( p )
1026 : PFR_NEXT_USHORT( p );
1035 /* save position of bitmap info */
1036 phy_font->bct_offset = FT_STREAM_POS();
1037 phy_font->cursor = NULL;
1043 error = FT_THROW( Invalid_Table );
1044 FT_ERROR(( "pfr_phy_font_load: invalid physical font table\n" ));