diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh index fc94836a2..c2d65eb1d 100644 --- a/src/hb-open-file.hh +++ b/src/hb-open-file.hh @@ -102,7 +102,13 @@ typedef struct OpenTypeOffsetTable { Tag t; t = tag; - return tables.bfind (t, table_index, HB_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX); + /* Use lfind for small fonts; there are fonts that have unsorted table entries; + * those tend to work in other tools, so tolerate them. + * https://github.com/harfbuzz/harfbuzz/issues/3065 */ + if (tables.len < 16) + return tables.lfind (t, table_index, HB_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX); + else + return tables.bfind (t, table_index, HB_NOT_FOUND_STORE, Index::NOT_FOUND_INDEX); } const TableRecord& get_table_by_tag (hb_tag_t tag) const {