[arabic-pua] Rename symbols

This commit is contained in:
Behdad Esfahbod 2022-06-19 10:47:38 -06:00
parent 7698962911
commit 8c27c51c27
3 changed files with 24 additions and 24 deletions

View File

@ -326,10 +326,10 @@ hb_ft_get_nominal_glyph (hb_font_t *font,
break;
#ifndef HB_NO_OT_SHAPER_ARABIC_FALLBACK
case OT::OS2::font_page_t::FONT_PAGE_SIMP_ARABIC:
g = FT_Get_Char_Index (ft_font->ft_face, _hb_remap_arabic_pua1 (unicode));
g = FT_Get_Char_Index (ft_font->ft_face, _hb_arabic_pua_simp_map (unicode));
break;
case OT::OS2::font_page_t::FONT_PAGE_TRAD_ARABIC:
g = FT_Get_Char_Index (ft_font->ft_face, _hb_remap_arabic_pua2 (unicode));
g = FT_Get_Char_Index (ft_font->ft_face, _hb_arabic_pua_trad_map (unicode));
break;
#endif
default:

View File

@ -1505,7 +1505,7 @@ struct SubtableUnicodesCache {
};
static inline hb_codepoint_t
_hb_remap_symbol_pua (hb_codepoint_t codepoint)
_hb_symbol_pua_map (hb_codepoint_t codepoint)
{
if (codepoint <= 0x00FFu)
{
@ -1745,14 +1745,14 @@ struct cmap
{
switch ((unsigned) face->table.OS2->get_font_page ()) {
case OS2::font_page_t::FONT_PAGE_NONE:
this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_remap_symbol_pua>;
this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_symbol_pua_map>;
break;
#ifndef HB_NO_OT_SHAPER_ARABIC_FALLBACK
case OS2::font_page_t::FONT_PAGE_SIMP_ARABIC:
this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_remap_arabic_pua1>;
this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_arabic_pua_simp_map>;
break;
case OS2::font_page_t::FONT_PAGE_TRAD_ARABIC:
this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_remap_arabic_pua2>;
this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_arabic_pua_trad_map>;
break;
#endif
default:

View File

@ -2,7 +2,7 @@
#ifndef HB_OT_SHAPER_ARABIC_PUA_HH
#define HB_OT_SHAPER_ARABIC_PUA_HH
static const uint16_t _arabic_table_pua1[][128] = {
static const uint16_t _arabic_table_pua_simp[][128] = {
{ /* 0x0000u..0x007Fu */
0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u,
0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u,
@ -96,17 +96,17 @@ static const uint16_t _arabic_table_pua1[][128] = {
};
static inline hb_codepoint_t
_hb_remap_arabic_pua1(hb_codepoint_t codepoint)
_hb_arabic_pua_simp_map (hb_codepoint_t codepoint)
{
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0000u, 0x007Fu)) return _arabic_table_pua1[0][codepoint];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0080u, 0x00FFu)) return _arabic_table_pua1[1][codepoint - 0x0080u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0600u, 0x067Fu)) return _arabic_table_pua1[2][codepoint - 0x0600u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x2000u, 0x207Fu)) return _arabic_table_pua1[3][codepoint - 0x2000u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFE80u, 0xFEFFu)) return _arabic_table_pua1[4][codepoint - 0xFE80u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0000u, 0x007Fu)) return _arabic_table_pua_simp[0][codepoint];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0080u, 0x00FFu)) return _arabic_table_pua_simp[1][codepoint - 0x0080u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0600u, 0x067Fu)) return _arabic_table_pua_simp[2][codepoint - 0x0600u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x2000u, 0x207Fu)) return _arabic_table_pua_simp[3][codepoint - 0x2000u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFE80u, 0xFEFFu)) return _arabic_table_pua_simp[4][codepoint - 0xFE80u];
return 0;
}
static const uint16_t _arabic_table_pua2[][128] = {
static const uint16_t _arabic_table_pua_trad[][128] = {
{ /* 0x0000u..0x007Fu */
0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u,
0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u,
@ -272,17 +272,17 @@ static const uint16_t _arabic_table_pua2[][128] = {
};
static inline hb_codepoint_t
_hb_remap_arabic_pua2(hb_codepoint_t codepoint)
_hb_arabic_pua_trad_map (hb_codepoint_t codepoint)
{
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0000u, 0x007Fu)) return _arabic_table_pua2[0][codepoint];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0080u, 0x00FFu)) return _arabic_table_pua2[1][codepoint - 0x0080u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0600u, 0x067Fu)) return _arabic_table_pua2[2][codepoint - 0x0600u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x2000u, 0x207Fu)) return _arabic_table_pua2[3][codepoint - 0x2000u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFBD0u, 0xFC4Fu)) return _arabic_table_pua2[4][codepoint - 0xFBD0u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFC50u, 0xFCCFu)) return _arabic_table_pua2[5][codepoint - 0xFC50u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFCD0u, 0xFD4Fu)) return _arabic_table_pua2[6][codepoint - 0xFCD0u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFD50u, 0xFDCFu)) return _arabic_table_pua2[7][codepoint - 0xFD50u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFE80u, 0xFEFFu)) return _arabic_table_pua2[8][codepoint - 0xFE80u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0000u, 0x007Fu)) return _arabic_table_pua_trad[0][codepoint];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0080u, 0x00FFu)) return _arabic_table_pua_trad[1][codepoint - 0x0080u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x0600u, 0x067Fu)) return _arabic_table_pua_trad[2][codepoint - 0x0600u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0x2000u, 0x207Fu)) return _arabic_table_pua_trad[3][codepoint - 0x2000u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFBD0u, 0xFC4Fu)) return _arabic_table_pua_trad[4][codepoint - 0xFBD0u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFC50u, 0xFCCFu)) return _arabic_table_pua_trad[5][codepoint - 0xFC50u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFCD0u, 0xFD4Fu)) return _arabic_table_pua_trad[6][codepoint - 0xFCD0u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFD50u, 0xFDCFu)) return _arabic_table_pua_trad[7][codepoint - 0xFD50u];
if (hb_in_range<hb_codepoint_t> (codepoint, 0xFE80u, 0xFEFFu)) return _arabic_table_pua_trad[8][codepoint - 0xFE80u];
return 0;
}