20 #include FT_INTERNAL_DEBUG_H
21 #include FT_INTERNAL_STREAM_H
26 #define FT_COMPONENT trace_pfr
54 FT_UInt num_items, item_type, item_size;
60 for ( ; num_items > 0; num_items-- )
73 for ( extra = item_list; extra->
parser !=
NULL; extra++ )
75 if ( extra->
type == item_type )
77 error = extra->
parser( p, p + item_size, item_data );
78 if ( error )
goto Exit;
93 FT_ERROR((
"pfr_extra_items_parse: invalid extra items table\n" ));
94 error = PFR_Err_Invalid_Table;
110 #define FT_STRUCTURE PFR_HeaderRec
164 header->phy_font_max_size +=
165 (FT_UInt32)header->phy_font_max_size_high << 16;
179 if ( header->signature != 0x50465230L ||
180 header->version > 4 ||
181 header->header_size < 58 ||
182 header->signature2 != 0x0d0a )
201 FT_UInt32 section_offset,
224 FT_UInt32 section_offset,
238 if ( idx >= num_log_fonts )
239 return PFR_Err_Invalid_Argument;
247 log_font->size =
size;
248 log_font->offset =
offset;
291 if ( flags & PFR_LOG_STROKE )
301 if ( flags & PFR_LOG_BOLD )
311 if (error)
goto Fail;
317 if ( size_increment )
331 FT_ERROR((
"pfr_log_font_load: invalid logical font table\n" ));
332 error = PFR_Err_Invalid_Table;
366 if ( phy_font->num_strikes + count > phy_font->max_strikes )
372 phy_font->num_strikes,
376 phy_font->max_strikes = new_max;
379 size1 = 1 + 1 + 1 + 2 + 2 + 1;
395 strike = phy_font->strikes + phy_font->num_strikes;
399 for ( n = 0; n <
count; n++, strike++ )
424 phy_font->num_strikes +=
count;
430 error = PFR_Err_Invalid_Table;
431 FT_ERROR((
"pfr_extra_item_load_bitmap_info:"
432 " invalid bitmap info table\n" ));
457 if ( phy_font->font_id !=
NULL )
460 if (
FT_ALLOC( phy_font->font_id, len + 1 ) )
465 phy_font->font_id[
len] = 0;
484 if ( phy_font->vertical.stem_snaps !=
NULL )
490 num_vert = count & 15;
491 num_horz = count >> 4;
492 count = num_vert + num_horz;
499 phy_font->vertical.stem_snaps = snaps;
500 phy_font->horizontal.stem_snaps = snaps + num_vert;
502 for ( ; count > 0; count--, snaps++ )
509 error = PFR_Err_Invalid_Table;
510 FT_ERROR((
"pfr_exta_item_load_stem_snaps:"
511 " invalid stem snaps table\n" ));
528 FT_TRACE2((
"pfr_extra_item_load_kerning_pairs()\n" ));
538 item->
offset = phy_font->offset + ( p - phy_font->cursor );
540 #ifndef PFR_CONFIG_NO_CHECKS
591 *phy_font->kern_items_tail = item;
592 phy_font->kern_items_tail = &item->
next;
607 error = PFR_Err_Invalid_Table;
608 FT_ERROR((
"pfr_extra_item_load_kerning_pairs:"
609 " invalid kerning pairs table\n" ));
639 if ( len > 0 && p[len - 1] == 0 )
646 for ( n = 0; n <
len; n++ )
647 if ( p[n] < 32 || p[n] > 127 )
672 FT_FREE( phy_font->family_name );
673 FT_FREE( phy_font->style_name );
675 FT_FREE( phy_font->vertical.stem_snaps );
676 phy_font->vertical.num_stem_snaps = 0;
678 phy_font->horizontal.stem_snaps =
NULL;
679 phy_font->horizontal.num_stem_snaps = 0;
682 phy_font->num_strikes = 0;
683 phy_font->max_strikes = 0;
686 phy_font->num_chars = 0;
687 phy_font->chars_offset = 0;
689 FT_FREE( phy_font->blue_values );
690 phy_font->num_blue_values = 0;
696 item = phy_font->kern_items;
703 phy_font->kern_items =
NULL;
704 phy_font->kern_items_tail =
NULL;
707 phy_font->num_kern_pairs = 0;
725 phy_font->memory = memory;
726 phy_font->offset =
offset;
728 phy_font->kern_items =
NULL;
729 phy_font->kern_items_tail = &phy_font->kern_items;
734 phy_font->cursor = stream->cursor;
760 pfr_phy_font_extra_items, phy_font );
781 while ( num_aux > 0 )
803 &phy_font->family_name );
824 &phy_font->style_name );
851 for ( n = 0; n <
count; n++ )
868 phy_font->chars_offset = offset + ( p - stream->cursor );
877 if ( flags & PFR_PHY_PROPORTIONAL )
891 for ( n = 0; n <
count; n++ )
902 : (
FT_Int) phy_font->standard_advance;
905 cur->ascii = ( flags & PFR_PHY_ASCII_CODE )
909 if ( flags & PFR_PHY_ASCII_CODE )
929 phy_font->cursor =
NULL;
935 error = PFR_Err_Invalid_Table;
936 FT_ERROR((
"pfr_phy_font_load: invalid physical font table\n" ));
#define FT_ALLOC(ptr, size)
FT_BEGIN_HEADER struct PFR_HeaderRec_ * PFR_Header
pfr_header_load(PFR_Header header, FT_Stream stream)
pfr_extra_item_load_stem_snaps(FT_Byte *p, FT_Byte *limit, PFR_PhyFont phy_font)
cannot open resource broken file module version is too low unimplemented feature broken offset within table missing module invalid character code cannot render this glyph format invalid composite glyph invalid pixel size invalid library handle invalid face handle invalid glyph slot handle invalid cache manager handle too many modules out of memory cannot open stream invalid stream skip invalid stream operation nested frame access raster uninitialized raster overflow too many registered caches too few arguments code overflow division by zero found debug opcode nested DEFS execution context too long too many instruction definitions horizontal header(hhea) table missing" ) FT_ERRORDEF_( Locations_Missing
#define FT_FRAME_UOFF3(f)
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
static const PFR_ExtraItemRec pfr_phy_font_extra_items[]
pfr_header_check(PFR_Header header)
#define FT_READ_UOFF3(var)
#define FT_READ_USHORT(var)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
pfr_log_font_count(FT_Stream stream, FT_UInt32 section_offset, FT_UInt *acount)
static FT_Error pfr_aux_name_load(FT_Byte *p, FT_UInt len, FT_Memory memory, FT_String **astring)
#define FT_ERROR(varformat)
#define FT_PAD_CEIL(x, n)
static const FT_Frame_Field pfr_header_fields[]
pfr_extra_items_skip(FT_Byte **pp, FT_Byte *limit)
#define FT_STREAM_READ_FIELDS(fields, object)
FT_Error(* PFR_ExtraItem_ParseFunc)(FT_Byte *p, FT_Byte *limit, FT_Pointer data)
#define FT_STREAM_SKIP(distance)
#define FT_FRAME_USHORT(f)
pfr_phy_font_load(PFR_PhyFont phy_font, FT_Stream stream, FT_UInt32 offset, FT_UInt32 size)
pfr_extra_item_load_bitmap_info(FT_Byte *p, FT_Byte *limit, PFR_PhyFont phy_font)
#define FT_TRACE2(varformat)
pfr_log_font_load(PFR_LogFont log_font, FT_Stream stream, FT_UInt idx, FT_UInt32 section_offset, FT_Bool size_increment)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_CALLBACK_DEF(x)
pfr_extra_items_parse(FT_Byte **pp, FT_Byte *limit, PFR_ExtraItem item_list, FT_Pointer item_data)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_NEW_ARRAY(ptr, count)
#define FT_STREAM_SEEK(position)
pfr_extra_item_load_kerning_pairs(FT_Byte *p, FT_Byte *limit, PFR_PhyFont phy_font)
#define FT_FRAME_ULONG(f)
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
GLdouble GLdouble GLdouble GLdouble q
#define PFR_KERN_INDEX(g1, g2)
pfr_extra_item_load_font_id(FT_Byte *p, FT_Byte *limit, PFR_PhyFont phy_font)
#define FT_FRAME_ENTER(size)
#define PFR_NEXT_USHORT(p)
#define FT_MEM_COPY(dest, source, count)
#define PFR_NEXT_ULONG(p)
#define FT_NEXT_SHORT(buffer)
pfr_phy_font_done(PFR_PhyFont phy_font, FT_Memory memory)
#define FT_FRAME_START(size)
#define PFR_NEXT_SHORT(p)