[cmap/ft] Only map 0xF000 range if font_page is NONE

This commit is contained in:
Behdad Esfahbod 2022-06-19 10:13:31 -06:00
parent 41a079bdec
commit 55350377b0
2 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -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<CmapSubtable, _hb_remap_symbol_pua>;
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<CmapSubtable, _hb_remap_arabic_pua2>;
break;
default:
this->get_glyph_funcZ = get_glyph_from<CmapSubtable>;
break;
}
}
else