* src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Accelerate the search.
This is mostly for consistency because PFR fonts with bitmap strikes do not seem to exist.
This commit is contained in:
parent
6139f2b647
commit
e00afdb35b
|
@ -282,7 +282,7 @@
|
|||
FT_ULong* found_offset,
|
||||
FT_ULong* found_size )
|
||||
{
|
||||
FT_UInt min, max, char_len;
|
||||
FT_UInt min, max, mid, char_len;
|
||||
FT_Bool two = FT_BOOL( *flags & PFR_BITMAP_2BYTE_CHARCODE );
|
||||
FT_Byte* buff;
|
||||
|
||||
|
@ -349,14 +349,14 @@
|
|||
|
||||
min = 0;
|
||||
max = count;
|
||||
mid = min + ( max - min ) / 2;
|
||||
|
||||
/* binary search */
|
||||
while ( min < max )
|
||||
{
|
||||
FT_UInt mid, code;
|
||||
FT_UInt code;
|
||||
|
||||
|
||||
mid = ( min + max ) >> 1;
|
||||
buff = base + mid * char_len;
|
||||
|
||||
if ( two )
|
||||
|
@ -370,6 +370,11 @@
|
|||
min = mid + 1;
|
||||
else
|
||||
goto Found_It;
|
||||
|
||||
/* reasonable prediction in a continuous block */
|
||||
mid += char_code - code;
|
||||
if ( mid >= max || mid < min )
|
||||
mid = min + ( max - min ) / 2;
|
||||
}
|
||||
|
||||
Fail:
|
||||
|
|
Loading…
Reference in New Issue