From d304d60e4d49df14ed85d6646680085f27bafbf2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Aug 2019 12:30:22 -0700 Subject: [PATCH] [ot-font] Prefer symbol cmap subtable if found Fixes https://github.com/harfbuzz/harfbuzz/issues/1918 Hopefully doesn't break anyone... --- src/hb-ot-cmap-table.hh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 746e87f48..23ea4659d 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -993,6 +993,15 @@ struct cmap const CmapSubtable *subtable; + /* Symbol subtable. + * Prefer symbol if available. + * https://github.com/harfbuzz/harfbuzz/issues/1918 */ + if ((subtable = this->find_subtable (3, 0))) + { + if (symbol) *symbol = true; + return subtable; + } + /* 32-bit subtables. */ if ((subtable = this->find_subtable (3, 10))) return subtable; if ((subtable = this->find_subtable (0, 6))) return subtable; @@ -1005,13 +1014,6 @@ struct cmap if ((subtable = this->find_subtable (0, 1))) return subtable; if ((subtable = this->find_subtable (0, 0))) return subtable; - /* Symbol subtable. */ - if ((subtable = this->find_subtable (3, 0))) - { - if (symbol) *symbol = true; - return subtable; - } - /* Meh. */ return &Null (CmapSubtable); }