src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize.
A kerning table can be handled by binary search if it has equal entries. Fixes #1132.
This commit is contained in:
parent
20ec99be7e
commit
5b26e92a0f
|
@ -94,7 +94,7 @@
|
||||||
|
|
||||||
p_next = p;
|
p_next = p;
|
||||||
|
|
||||||
p += 2; /* skip version */
|
p += 2; /* skip version */
|
||||||
length = FT_NEXT_USHORT( p );
|
length = FT_NEXT_USHORT( p );
|
||||||
coverage = FT_NEXT_USHORT( p );
|
coverage = FT_NEXT_USHORT( p );
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
|
|
||||||
|
|
||||||
cur_pair = FT_NEXT_ULONG( p );
|
cur_pair = FT_NEXT_ULONG( p );
|
||||||
if ( cur_pair <= old_pair )
|
if ( cur_pair < old_pair )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
p += 2;
|
p += 2;
|
||||||
|
@ -187,8 +187,9 @@
|
||||||
FT_UInt left_glyph,
|
FT_UInt left_glyph,
|
||||||
FT_UInt right_glyph )
|
FT_UInt right_glyph )
|
||||||
{
|
{
|
||||||
FT_Int result = 0;
|
FT_Int result = 0;
|
||||||
FT_UInt count, mask;
|
FT_UInt count, mask;
|
||||||
|
|
||||||
FT_Byte* p = face->kern_table;
|
FT_Byte* p = face->kern_table;
|
||||||
FT_Byte* p_limit = p + face->kern_table_size;
|
FT_Byte* p_limit = p + face->kern_table_size;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue