From ce34f0b07e5324ed52e6e2c43000c2b09ee010d4 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 4 Jun 2014 18:57:46 -0400 Subject: [PATCH] [ot-font] Use binary search for format12 cmap subtable --- src/hb-open-type-private.hh | 4 ++++ src/hb-ot-cmap-table.hh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index fcdee025f..c4446ce08 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -985,6 +985,10 @@ struct GenericSortedArrayOf : GenericArrayOf template struct SortedArrayOf : GenericSortedArrayOf {}; +/* A sorted array with a ULONG number of elements. */ +template +struct LongSortedArrayOf : GenericSortedArrayOf {}; + } /* namespace OT */ diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 65434c406..b7c89ce9a 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -264,7 +264,7 @@ struct CmapSubtableLongSegmented USHORT reserved; /* Reserved; set to 0. */ ULONG length; /* Byte length of this subtable. */ ULONG language; /* Ignore. */ - LongArrayOf + LongSortedArrayOf groups; /* Groupings. */ public: DEFINE_SIZE_ARRAY (16, groups);