diff options
-rw-r--r-- | pango/opentype/harfbuzz-dump-main.c | 4 | ||||
-rw-r--r-- | pango/opentype/harfbuzz-stream.c | 89 |
2 files changed, 46 insertions, 47 deletions
diff --git a/pango/opentype/harfbuzz-dump-main.c b/pango/opentype/harfbuzz-dump-main.c index 7e1b5a4a..d19d6ea9 100644 --- a/pango/opentype/harfbuzz-dump-main.c +++ b/pango/opentype/harfbuzz-dump-main.c @@ -200,7 +200,7 @@ main (int argc, char **argv) croak ("HB_Done_GSUB_Table", error); } else if (error != HB_Err_Not_Covered) - fprintf (stderr, "HB_Load_GSUB_Table %x\n", error); + fprintf (stderr, "HB_Load_GSUB_Table: error 0x%x\n", error); if (!(error = HB_Load_GPOS_Table (font, &gpos, NULL))) { @@ -210,7 +210,7 @@ main (int argc, char **argv) croak ("HB_Done_GPOS_Table", error); } else if (error != HB_Err_Not_Covered) - fprintf (stderr, "HB_Load_GPOS_Table %x\n", error); + fprintf (stderr, "HB_Load_GPOS_Table: error 0x%x\n", error); printf ("</OpenType>\n"); diff --git a/pango/opentype/harfbuzz-stream.c b/pango/opentype/harfbuzz-stream.c index 75e4d34e..29d280ae 100644 --- a/pango/opentype/harfbuzz-stream.c +++ b/pango/opentype/harfbuzz-stream.c @@ -164,65 +164,64 @@ _hb_font_goto_table( HB_Font font, { LOG(( "not a SFNT font !!\n" )); error = ERR(HB_Err_Invalid_Argument); + goto Exit; } - else - { - /* parse the directory table directly, without using - * FreeType's built-in data structures - */ - HB_UInt offset = 0; - HB_UInt count, nn; - if ( font->num_faces > 1 ) - { - /* deal with TrueType collections */ - LOG(( ">> This is a TrueType Collection\n" )); + /* parse the directory table directly, without using + * FreeType's built-in data structures + */ + HB_UInt offset = 0; + HB_UInt count, nn; + + if ( font->num_faces > 1 ) + { + /* deal with TrueType collections */ + LOG(( ">> This is a TrueType Collection\n" )); - if ( FILE_Seek( 12 + font->face_index*4 ) || - ACCESS_Frame( 4 ) ) - goto Exit; + if ( FILE_Seek( 12 + font->face_index*4 ) || + ACCESS_Frame( 4 ) ) + goto Exit; - offset = GET_ULong(); + offset = GET_ULong(); - FORGET_Frame(); - } + FORGET_Frame(); + } - LOG(( "TrueType offset = %ld\n", offset )); + LOG(( "TrueType offset = %ld\n", offset )); - if ( FILE_Seek( offset+4 ) || - ACCESS_Frame( 2 ) ) - goto Exit; + if ( FILE_Seek( offset+4 ) || + ACCESS_Frame( 2 ) ) + goto Exit; - count = GET_UShort(); + count = GET_UShort(); - FORGET_Frame(); + FORGET_Frame(); - if ( FILE_Seek( offset+12 ) || - ACCESS_Frame( count*16 ) ) - goto Exit; + if ( FILE_Seek( offset+12 ) || + ACCESS_Frame( count*16 ) ) + goto Exit; - for ( nn = 0; nn < count; nn++ ) + for ( nn = 0; nn < count; nn++ ) + { + HB_UInt tag = GET_ULong(); + HB_UInt checksum = GET_ULong(); + HB_UInt start = GET_ULong(); + HB_UInt size = GET_ULong(); + + HB_UNUSED(checksum); + HB_UNUSED(size); + + if ( tag == the_tag ) { - HB_UInt tag = GET_ULong(); - HB_UInt checksum = GET_ULong(); - HB_UInt start = GET_ULong(); - HB_UInt size = GET_ULong(); - - HB_UNUSED(checksum); - HB_UNUSED(size); - - if ( tag == the_tag ) - { - LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size )); - error = _hb_stream_seek( stream, start ); - goto FoundIt; - } + LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size )); + error = _hb_stream_seek( stream, start ); + goto FoundIt; } - error = HB_Err_Not_Covered; - - FoundIt: - FORGET_Frame(); } + error = HB_Err_Not_Covered; + +FoundIt: + FORGET_Frame(); Exit: LOG(( "TrueType error=%d\n", error )); |