[arabic-fallback] Rename; towards supporting 3-letter ligatures

This commit is contained in:
Behdad Esfahbod 2022-06-18 13:41:30 -06:00
parent 8978a18f31
commit d86effa4a6
3 changed files with 75 additions and 77 deletions

View File

@ -274,7 +274,7 @@ def print_shaping_table(f):
print ("static const struct ligature_set_t {")
print (" uint16_t first;")
print (" struct ligature_pairs_t {")
print (" uint16_t second;")
print (" uint16_t components[1];")
print (" uint16_t ligature;")
print (" } ligatures[%d];" % max_i)
print ("} ligature_table[] =")
@ -283,7 +283,7 @@ def print_shaping_table(f):
print (" { 0x%04Xu, {" % (first))
for liga in ligas_2[first]:
print (" { 0x%04Xu, 0x%04Xu }, /* %s */" % (liga[0], liga[1], names[liga[1]]))
print (" { {0x%04Xu}, 0x%04Xu }, /* %s */" % (liga[0], liga[1], names[liga[1]]))
print (" }},")
print ("};")
@ -294,7 +294,7 @@ def print_shaping_table(f):
print ("static const struct ligature_mark_set_t {")
print (" uint16_t first;")
print (" struct ligature_pairs_t {")
print (" uint16_t second;")
print (" uint16_t components[1];")
print (" uint16_t ligature;")
print (" } ligatures[%d];" % max_i)
print ("} ligature_mark_table[] =")
@ -303,7 +303,7 @@ def print_shaping_table(f):
print (" { 0x%04Xu, {" % (first))
for liga in ligas_mark_2[first]:
print (" { 0x%04Xu, 0x%04Xu }, /* %s */" % (liga[0], liga[1], names[liga[1]]))
print (" { {0x%04Xu}, 0x%04Xu }, /* %s */" % (liga[0], liga[1], names[liga[1]]))
print (" }},")
print ("};")
@ -314,8 +314,7 @@ def print_shaping_table(f):
print ("static const struct ligature_3_set_t {")
print (" uint16_t first;")
print (" struct ligature_triplets_t {")
print (" uint16_t second;")
print (" uint16_t third;")
print (" uint16_t components[2];")
print (" uint16_t ligature;")
print (" } ligatures[%d];" % max_i)
print ("} ligature_3_table[] =")
@ -324,7 +323,7 @@ def print_shaping_table(f):
print (" { 0x%04Xu, {" % (first))
for liga in ligas_3[first]:
print (" { 0x%04Xu, 0x%04Xu, 0x%04Xu}, /* %s */" % (liga[0], liga[1], liga[2], names[liga[2]]))
print (" { {0x%04Xu, 0x%04Xu}, 0x%04Xu}, /* %s */" % (liga[0], liga[1], liga[2], names[liga[2]]))
print (" }},")
print ("};")

View File

@ -143,7 +143,7 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN
for (unsigned int second_glyph_idx = 0; second_glyph_idx < ARRAY_LENGTH (ligature_table[0].ligatures); second_glyph_idx++)
{
hb_codepoint_t second_u = ligature_table[first_glyph_idx].ligatures[second_glyph_idx].second;
hb_codepoint_t second_u = ligature_table[first_glyph_idx].ligatures[second_glyph_idx].components[0];
hb_codepoint_t ligature_u = ligature_table[first_glyph_idx].ligatures[second_glyph_idx].ligature;
hb_codepoint_t second_glyph, ligature_glyph;
if (!second_u ||

View File

@ -416,103 +416,103 @@ static const uint16_t shaping_table[][4] =
static const struct ligature_set_t {
uint16_t first;
struct ligature_pairs_t {
uint16_t second;
uint16_t components[1];
uint16_t ligature;
} ligatures[14];
} ligature_table[] =
{
{ 0xFE91u, {
{ 0xFEE2u, 0xFC08u }, /* ARABIC LIGATURE BEH WITH MEEM ISOLATED FORM */
{ 0xFEE4u, 0xFC9Fu }, /* ARABIC LIGATURE BEH WITH MEEM INITIAL FORM */
{ 0xFEA0u, 0xFC9Cu }, /* ARABIC LIGATURE BEH WITH JEEM INITIAL FORM */
{ 0xFEA4u, 0xFC9Du }, /* ARABIC LIGATURE BEH WITH HAH INITIAL FORM */
{ 0xFEA8u, 0xFC9Eu }, /* ARABIC LIGATURE BEH WITH KHAH INITIAL FORM */
{ {0xFEE2u}, 0xFC08u }, /* ARABIC LIGATURE BEH WITH MEEM ISOLATED FORM */
{ {0xFEE4u}, 0xFC9Fu }, /* ARABIC LIGATURE BEH WITH MEEM INITIAL FORM */
{ {0xFEA0u}, 0xFC9Cu }, /* ARABIC LIGATURE BEH WITH JEEM INITIAL FORM */
{ {0xFEA4u}, 0xFC9Du }, /* ARABIC LIGATURE BEH WITH HAH INITIAL FORM */
{ {0xFEA8u}, 0xFC9Eu }, /* ARABIC LIGATURE BEH WITH KHAH INITIAL FORM */
}},
{ 0xFE92u, {
{ 0xFEAEu, 0xFC6Au }, /* ARABIC LIGATURE BEH WITH REH FINAL FORM */
{ 0xFEE6u, 0xFC6Du }, /* ARABIC LIGATURE BEH WITH NOON FINAL FORM */
{ 0xFEF2u, 0xFC6Fu }, /* ARABIC LIGATURE BEH WITH YEH FINAL FORM */
{ {0xFEAEu}, 0xFC6Au }, /* ARABIC LIGATURE BEH WITH REH FINAL FORM */
{ {0xFEE6u}, 0xFC6Du }, /* ARABIC LIGATURE BEH WITH NOON FINAL FORM */
{ {0xFEF2u}, 0xFC6Fu }, /* ARABIC LIGATURE BEH WITH YEH FINAL FORM */
}},
{ 0xFE97u, {
{ 0xFEE2u, 0xFC0Eu }, /* ARABIC LIGATURE TEH WITH MEEM ISOLATED FORM */
{ 0xFEE4u, 0xFCA4u }, /* ARABIC LIGATURE TEH WITH MEEM INITIAL FORM */
{ 0xFEA0u, 0xFCA1u }, /* ARABIC LIGATURE TEH WITH JEEM INITIAL FORM */
{ 0xFEA4u, 0xFCA2u }, /* ARABIC LIGATURE TEH WITH HAH INITIAL FORM */
{ 0xFEA8u, 0xFCA3u }, /* ARABIC LIGATURE TEH WITH KHAH INITIAL FORM */
{ {0xFEE2u}, 0xFC0Eu }, /* ARABIC LIGATURE TEH WITH MEEM ISOLATED FORM */
{ {0xFEE4u}, 0xFCA4u }, /* ARABIC LIGATURE TEH WITH MEEM INITIAL FORM */
{ {0xFEA0u}, 0xFCA1u }, /* ARABIC LIGATURE TEH WITH JEEM INITIAL FORM */
{ {0xFEA4u}, 0xFCA2u }, /* ARABIC LIGATURE TEH WITH HAH INITIAL FORM */
{ {0xFEA8u}, 0xFCA3u }, /* ARABIC LIGATURE TEH WITH KHAH INITIAL FORM */
}},
{ 0xFE98u, {
{ 0xFEAEu, 0xFC70u }, /* ARABIC LIGATURE TEH WITH REH FINAL FORM */
{ 0xFEE6u, 0xFC73u }, /* ARABIC LIGATURE TEH WITH NOON FINAL FORM */
{ 0xFEF2u, 0xFC75u }, /* ARABIC LIGATURE TEH WITH YEH FINAL FORM */
{ {0xFEAEu}, 0xFC70u }, /* ARABIC LIGATURE TEH WITH REH FINAL FORM */
{ {0xFEE6u}, 0xFC73u }, /* ARABIC LIGATURE TEH WITH NOON FINAL FORM */
{ {0xFEF2u}, 0xFC75u }, /* ARABIC LIGATURE TEH WITH YEH FINAL FORM */
}},
{ 0xFE9Bu, {
{ 0xFEE2u, 0xFC12u }, /* ARABIC LIGATURE THEH WITH MEEM ISOLATED FORM */
{ {0xFEE2u}, 0xFC12u }, /* ARABIC LIGATURE THEH WITH MEEM ISOLATED FORM */
}},
{ 0xFE9Fu, {
{ 0xFEE4u, 0xFCA8u }, /* ARABIC LIGATURE JEEM WITH MEEM INITIAL FORM */
{ {0xFEE4u}, 0xFCA8u }, /* ARABIC LIGATURE JEEM WITH MEEM INITIAL FORM */
}},
{ 0xFEA3u, {
{ 0xFEE4u, 0xFCAAu }, /* ARABIC LIGATURE HAH WITH MEEM INITIAL FORM */
{ {0xFEE4u}, 0xFCAAu }, /* ARABIC LIGATURE HAH WITH MEEM INITIAL FORM */
}},
{ 0xFEA7u, {
{ 0xFEE4u, 0xFCACu }, /* ARABIC LIGATURE KHAH WITH MEEM INITIAL FORM */
{ {0xFEE4u}, 0xFCACu }, /* ARABIC LIGATURE KHAH WITH MEEM INITIAL FORM */
}},
{ 0xFEB3u, {
{ 0xFEE4u, 0xFCB0u }, /* ARABIC LIGATURE SEEN WITH MEEM INITIAL FORM */
{ {0xFEE4u}, 0xFCB0u }, /* ARABIC LIGATURE SEEN WITH MEEM INITIAL FORM */
}},
{ 0xFEB7u, {
{ 0xFEE4u, 0xFD30u }, /* ARABIC LIGATURE SHEEN WITH MEEM INITIAL FORM */
{ {0xFEE4u}, 0xFD30u }, /* ARABIC LIGATURE SHEEN WITH MEEM INITIAL FORM */
}},
{ 0xFED3u, {
{ 0xFEF2u, 0xFC32u }, /* ARABIC LIGATURE FEH WITH YEH ISOLATED FORM */
{ {0xFEF2u}, 0xFC32u }, /* ARABIC LIGATURE FEH WITH YEH ISOLATED FORM */
}},
{ 0xFEDFu, {
{ 0xFE9Eu, 0xFC3Fu }, /* ARABIC LIGATURE LAM WITH JEEM ISOLATED FORM */
{ 0xFEA0u, 0xFCC9u }, /* ARABIC LIGATURE LAM WITH JEEM INITIAL FORM */
{ 0xFEA2u, 0xFC40u }, /* ARABIC LIGATURE LAM WITH HAH ISOLATED FORM */
{ 0xFEA4u, 0xFCCAu }, /* ARABIC LIGATURE LAM WITH HAH INITIAL FORM */
{ 0xFEA6u, 0xFC41u }, /* ARABIC LIGATURE LAM WITH KHAH ISOLATED FORM */
{ 0xFEA8u, 0xFCCBu }, /* ARABIC LIGATURE LAM WITH KHAH INITIAL FORM */
{ 0xFEE2u, 0xFC42u }, /* ARABIC LIGATURE LAM WITH MEEM ISOLATED FORM */
{ 0xFEE4u, 0xFCCCu }, /* ARABIC LIGATURE LAM WITH MEEM INITIAL FORM */
{ 0xFEF2u, 0xFC44u }, /* ARABIC LIGATURE LAM WITH YEH ISOLATED FORM */
{ 0xFEECu, 0xFCCDu }, /* ARABIC LIGATURE LAM WITH HEH INITIAL FORM */
{ 0xFE82u, 0xFEF5u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM */
{ 0xFE84u, 0xFEF7u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM */
{ 0xFE88u, 0xFEF9u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM */
{ 0xFE8Eu, 0xFEFBu }, /* ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM */
{ {0xFE9Eu}, 0xFC3Fu }, /* ARABIC LIGATURE LAM WITH JEEM ISOLATED FORM */
{ {0xFEA0u}, 0xFCC9u }, /* ARABIC LIGATURE LAM WITH JEEM INITIAL FORM */
{ {0xFEA2u}, 0xFC40u }, /* ARABIC LIGATURE LAM WITH HAH ISOLATED FORM */
{ {0xFEA4u}, 0xFCCAu }, /* ARABIC LIGATURE LAM WITH HAH INITIAL FORM */
{ {0xFEA6u}, 0xFC41u }, /* ARABIC LIGATURE LAM WITH KHAH ISOLATED FORM */
{ {0xFEA8u}, 0xFCCBu }, /* ARABIC LIGATURE LAM WITH KHAH INITIAL FORM */
{ {0xFEE2u}, 0xFC42u }, /* ARABIC LIGATURE LAM WITH MEEM ISOLATED FORM */
{ {0xFEE4u}, 0xFCCCu }, /* ARABIC LIGATURE LAM WITH MEEM INITIAL FORM */
{ {0xFEF2u}, 0xFC44u }, /* ARABIC LIGATURE LAM WITH YEH ISOLATED FORM */
{ {0xFEECu}, 0xFCCDu }, /* ARABIC LIGATURE LAM WITH HEH INITIAL FORM */
{ {0xFE82u}, 0xFEF5u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM */
{ {0xFE84u}, 0xFEF7u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM */
{ {0xFE88u}, 0xFEF9u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM */
{ {0xFE8Eu}, 0xFEFBu }, /* ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM */
}},
{ 0xFEE0u, {
{ 0xFEF0u, 0xFC86u }, /* ARABIC LIGATURE LAM WITH ALEF MAKSURA FINAL FORM */
{ 0xFE82u, 0xFEF6u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM */
{ 0xFE84u, 0xFEF8u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM */
{ 0xFE88u, 0xFEFAu }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM */
{ 0xFE8Eu, 0xFEFCu }, /* ARABIC LIGATURE LAM WITH ALEF FINAL FORM */
{ {0xFEF0u}, 0xFC86u }, /* ARABIC LIGATURE LAM WITH ALEF MAKSURA FINAL FORM */
{ {0xFE82u}, 0xFEF6u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM */
{ {0xFE84u}, 0xFEF8u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM */
{ {0xFE88u}, 0xFEFAu }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM */
{ {0xFE8Eu}, 0xFEFCu }, /* ARABIC LIGATURE LAM WITH ALEF FINAL FORM */
}},
{ 0xFEE3u, {
{ 0xFEA0u, 0xFCCEu }, /* ARABIC LIGATURE MEEM WITH JEEM INITIAL FORM */
{ 0xFEA4u, 0xFCCFu }, /* ARABIC LIGATURE MEEM WITH HAH INITIAL FORM */
{ 0xFEA8u, 0xFCD0u }, /* ARABIC LIGATURE MEEM WITH KHAH INITIAL FORM */
{ 0xFEE4u, 0xFCD1u }, /* ARABIC LIGATURE MEEM WITH MEEM INITIAL FORM */
{ {0xFEA0u}, 0xFCCEu }, /* ARABIC LIGATURE MEEM WITH JEEM INITIAL FORM */
{ {0xFEA4u}, 0xFCCFu }, /* ARABIC LIGATURE MEEM WITH HAH INITIAL FORM */
{ {0xFEA8u}, 0xFCD0u }, /* ARABIC LIGATURE MEEM WITH KHAH INITIAL FORM */
{ {0xFEE4u}, 0xFCD1u }, /* ARABIC LIGATURE MEEM WITH MEEM INITIAL FORM */
}},
{ 0xFEE7u, {
{ 0xFEE2u, 0xFC4Eu }, /* ARABIC LIGATURE NOON WITH MEEM ISOLATED FORM */
{ 0xFEE4u, 0xFCD5u }, /* ARABIC LIGATURE NOON WITH MEEM INITIAL FORM */
{ 0xFEA0u, 0xFCD2u }, /* ARABIC LIGATURE NOON WITH JEEM INITIAL FORM */
{ 0xFEA4u, 0xFCD3u }, /* ARABIC LIGATURE NOON WITH HAH INITIAL FORM */
{ {0xFEE2u}, 0xFC4Eu }, /* ARABIC LIGATURE NOON WITH MEEM ISOLATED FORM */
{ {0xFEE4u}, 0xFCD5u }, /* ARABIC LIGATURE NOON WITH MEEM INITIAL FORM */
{ {0xFEA0u}, 0xFCD2u }, /* ARABIC LIGATURE NOON WITH JEEM INITIAL FORM */
{ {0xFEA4u}, 0xFCD3u }, /* ARABIC LIGATURE NOON WITH HAH INITIAL FORM */
}},
{ 0xFEE8u, {
{ 0xFEF2u, 0xFC8Fu }, /* ARABIC LIGATURE NOON WITH YEH FINAL FORM */
{ {0xFEF2u}, 0xFC8Fu }, /* ARABIC LIGATURE NOON WITH YEH FINAL FORM */
}},
{ 0xFEF3u, {
{ 0xFEA0u, 0xFCDAu }, /* ARABIC LIGATURE YEH WITH JEEM INITIAL FORM */
{ 0xFEA4u, 0xFCDBu }, /* ARABIC LIGATURE YEH WITH HAH INITIAL FORM */
{ 0xFEA8u, 0xFCDCu }, /* ARABIC LIGATURE YEH WITH KHAH INITIAL FORM */
{ 0xFEE4u, 0xFCDDu }, /* ARABIC LIGATURE YEH WITH MEEM INITIAL FORM */
{ {0xFEA0u}, 0xFCDAu }, /* ARABIC LIGATURE YEH WITH JEEM INITIAL FORM */
{ {0xFEA4u}, 0xFCDBu }, /* ARABIC LIGATURE YEH WITH HAH INITIAL FORM */
{ {0xFEA8u}, 0xFCDCu }, /* ARABIC LIGATURE YEH WITH KHAH INITIAL FORM */
{ {0xFEE4u}, 0xFCDDu }, /* ARABIC LIGATURE YEH WITH MEEM INITIAL FORM */
}},
{ 0xFEF4u, {
{ 0xFEAEu, 0xFC91u }, /* ARABIC LIGATURE YEH WITH REH FINAL FORM */
{ 0xFEE6u, 0xFC94u }, /* ARABIC LIGATURE YEH WITH NOON FINAL FORM */
{ {0xFEAEu}, 0xFC91u }, /* ARABIC LIGATURE YEH WITH REH FINAL FORM */
{ {0xFEE6u}, 0xFC94u }, /* ARABIC LIGATURE YEH WITH NOON FINAL FORM */
}},
};
@ -520,17 +520,17 @@ static const struct ligature_set_t {
static const struct ligature_mark_set_t {
uint16_t first;
struct ligature_pairs_t {
uint16_t second;
uint16_t components[1];
uint16_t ligature;
} ligatures[5];
} ligature_mark_table[] =
{
{ 0x0651u, {
{ 0x064Cu, 0xFC5Eu }, /* ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM */
{ 0x064Eu, 0xFC60u }, /* ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM */
{ 0x064Fu, 0xFC61u }, /* ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM */
{ 0x0650u, 0xFC62u }, /* ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM */
{ 0x064Bu, 0xF2EEu }, /* PUA ARABIC LIGATURE SHADDA WITH FATHATAN ISOLATED FORM */
{ {0x064Cu}, 0xFC5Eu }, /* ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM */
{ {0x064Eu}, 0xFC60u }, /* ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM */
{ {0x064Fu}, 0xFC61u }, /* ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM */
{ {0x0650u}, 0xFC62u }, /* ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM */
{ {0x064Bu}, 0xF2EEu }, /* PUA ARABIC LIGATURE SHADDA WITH FATHATAN ISOLATED FORM */
}},
};
@ -538,16 +538,15 @@ static const struct ligature_mark_set_t {
static const struct ligature_3_set_t {
uint16_t first;
struct ligature_triplets_t {
uint16_t second;
uint16_t third;
uint16_t components[2];
uint16_t ligature;
} ligatures[3];
} ligature_3_table[] =
{
{ 0xFEDFu, {
{ 0xFEE4u, 0xFEA4u, 0xFD88u}, /* ARABIC LIGATURE LAM WITH MEEM WITH HAH INITIAL FORM */
{ 0xFEE0u, 0xFEEAu, 0xF201u}, /* PUA ARABIC LIGATURE LELLAH ISOLATED FORM */
{ 0xFEE4u, 0xFEA0u, 0xF211u}, /* PUA ARABIC LIGATURE LAM WITH MEEM WITH JEEM INITIAL FORM */
{ {0xFEE4u, 0xFEA4u}, 0xFD88u}, /* ARABIC LIGATURE LAM WITH MEEM WITH HAH INITIAL FORM */
{ {0xFEE0u, 0xFEEAu}, 0xF201u}, /* PUA ARABIC LIGATURE LELLAH ISOLATED FORM */
{ {0xFEE4u, 0xFEA0u}, 0xF211u}, /* PUA ARABIC LIGATURE LAM WITH MEEM WITH JEEM INITIAL FORM */
}},
};