From 55350377b0d26c06f152f0cd30c3911fd6060b85 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 19 Jun 2022 10:13:31 -0600 Subject: [PATCH] [cmap/ft] Only map 0xF000 range if font_page is NONE --- src/hb-ft.cc | 4 +++- src/hb-ot-cmap-table.hh | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 2da90a2e3..74ac6853b 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -315,7 +315,7 @@ hb_ft_get_nominal_glyph (hb_font_t *font, if (unlikely (ft_font->symbol)) { switch ((unsigned) font->face->table.OS2->get_font_page ()) { - default: + case OT::OS2::font_page_t::FONT_PAGE_NONE: if (unicode <= 0x00FFu) /* For symbol-encoded OpenType fonts, we duplicate the * U+F000..F0FF range at U+0000..U+00FF. That's what @@ -330,6 +330,8 @@ hb_ft_get_nominal_glyph (hb_font_t *font, case OT::OS2::font_page_t::FONT_PAGE_TRAD_ARABIC: g = FT_Get_Char_Index (ft_font->ft_face, _hb_remap_arabic_pua2 (unicode)); break; + default: + break; } if (!g) return false; diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index ac96f9c84..a21ae49eb 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -1744,7 +1744,7 @@ struct cmap if (unlikely (symbol)) { switch ((unsigned) face->table.OS2->get_font_page ()) { - default: + case OS2::font_page_t::FONT_PAGE_NONE: this->get_glyph_funcZ = get_glyph_from_symbol; break; case OS2::font_page_t::FONT_PAGE_SIMP_ARABIC: @@ -1753,6 +1753,9 @@ struct cmap case OS2::font_page_t::FONT_PAGE_TRAD_ARABIC: this->get_glyph_funcZ = get_glyph_from_symbol; break; + default: + this->get_glyph_funcZ = get_glyph_from; + break; } } else