diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-12-10 22:32:05 -0500 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2021-12-10 22:32:05 -0500 |
commit | 0dc811b548a8487ea5b2456676b9dd0c1fb4eb37 (patch) | |
tree | 243ba0aea53cb7186768f28884622647d3bd94dd /include/freetype/internal/tttypes.h | |
parent | eaa10b993bb5badf5fd524016a520a3539f1678c (diff) | |
download | freetype2-0dc811b548a8487ea5b2456676b9dd0c1fb4eb37.tar.gz |
[truetype] Binary search through `hdmx` records.hdmx-advances
The `hdmx` table is supposed to be sorted by ppem size, which
enables binary search. We also drop the check for the sufficient
length of the record because it is now enforced when the table
is loaded.
* include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx`
record pointers sorted by ppem instead of ppem's themselves.
* src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records.
(tt_face_get_device_metrics): Implement binary search to retrieve
advances.
Diffstat (limited to 'include/freetype/internal/tttypes.h')
-rw-r--r-- | include/freetype/internal/tttypes.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h index fcd97cff0..286f14f5c 100644 --- a/include/freetype/internal/tttypes.h +++ b/include/freetype/internal/tttypes.h @@ -1390,8 +1390,8 @@ FT_BEGIN_HEADER * hdmx_record_size :: * The size of a single hdmx record. * - * hdmx_record_sizes :: - * An array holding the ppem sizes available in the 'hdmx' table. + * hdmx_records :: + * A array of pointers to the 'hdmx' table records sorted by ppem. * * sbit_table :: * A pointer to the font's embedded bitmap location table. @@ -1605,7 +1605,7 @@ FT_BEGIN_HEADER FT_ULong hdmx_table_size; FT_UInt hdmx_record_count; FT_ULong hdmx_record_size; - FT_Byte* hdmx_record_sizes; + FT_Byte** hdmx_records; FT_Byte* sbit_table; FT_ULong sbit_table_size; |