diff options
author | David Turner <david@freetype.org> | 2006-10-23 10:23:17 +0000 |
---|---|---|
committer | David Turner <david@freetype.org> | 2006-10-23 10:23:17 +0000 |
commit | 29873a0ccd69376125323ded561e271872564077 (patch) | |
tree | f4ab08c89211f1f4deab6b4d64acc864712637e1 /src/sfnt/ttmtx.c | |
parent | e140f14232037570e241b42a3483f535a23da6e7 (diff) | |
download | freetype2-29873a0ccd69376125323ded561e271872564077.tar.gz |
* src/sfnt/ttmtx.c, src/cff/cffload.c: speeding up the CFF font
loader, with some large CFF fonts, FT_Open_Face is now 350% faster !
Diffstat (limited to 'src/sfnt/ttmtx.c')
-rw-r--r-- | src/sfnt/ttmtx.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c index d0140b3a1..2d4f02c1e 100644 --- a/src/sfnt/ttmtx.c +++ b/src/sfnt/ttmtx.c @@ -71,8 +71,8 @@ FT_ULong table_size; FT_Byte** ptable; FT_ULong* ptable_size; - - + + if ( vertical ) { error = face->goto_table( face, TTAG_vmtx, stream, &table_size ); @@ -91,10 +91,10 @@ ptable = &face->horz_metrics; ptable_size = &face->horz_metrics_size; } - + if ( FT_FRAME_EXTRACT( table_size, *ptable ) ) goto Fail; - + *ptable_size = table_size; Fail: @@ -116,6 +116,7 @@ TT_LongMetrics * longs; TT_ShortMetrics** shorts; + FT_Byte* p; if ( vertical ) @@ -175,6 +176,8 @@ if ( FT_FRAME_ENTER( table_len ) ) goto Fail; + p = stream->cursor; + { TT_LongMetrics cur = *longs; TT_LongMetrics limit = cur + num_longs; @@ -182,8 +185,8 @@ for ( ; cur < limit; cur++ ) { - cur->advance = FT_GET_USHORT(); - cur->bearing = FT_GET_SHORT(); + cur->advance = FT_NEXT_USHORT(p); + cur->bearing = FT_NEXT_SHORT(p); } } @@ -195,7 +198,7 @@ for ( ; cur < limit; cur++ ) - *cur = FT_GET_SHORT(); + *cur = FT_NEXT_SHORT(p); /* We fill up the missing left side bearings with the */ /* last valid value. Since this will occur for buggy CJK */ @@ -313,7 +316,7 @@ /*************************************************************************/ /* */ /* <Function> */ - /* tt_face_get_metrics */ + /* tt_face_get_metrics */ /* */ /* <Description> */ /* Returns the horizontal or vertical metrics in font units for a */ |