From 4f37c0db9bf4e3d536a50126d17b36009b12f9cb Mon Sep 17 00:00:00 2001 From: David Corbett Date: Tue, 11 Jun 2019 17:55:31 -0400 Subject: [PATCH] Remove 'mym3' --- src/hb-ot-tag.cc | 4 +++- test/api/test-ot-tag.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc index ad3635bda..61b609d5e 100644 --- a/src/hb-ot-tag.cc +++ b/src/hb-ot-tag.cc @@ -145,7 +145,9 @@ hb_ot_all_tags_from_script (hb_script_t script, hb_tag_t new_tag = hb_ot_new_tag_from_script (script); if (unlikely (new_tag != HB_OT_TAG_DEFAULT_SCRIPT)) { - tags[i++] = new_tag | '3'; + /* HB_SCRIPT_MYANMAR maps to 'mym2', but there is no 'mym3'. */ + if (new_tag != HB_TAG('m','y','m','2')) + tags[i++] = new_tag | '3'; if (*count > i) tags[i++] = new_tag; } diff --git a/test/api/test-ot-tag.c b/test/api/test-ot-tag.c index 66c69caf7..d0334cd06 100644 --- a/test/api/test-ot-tag.c +++ b/test/api/test-ot-tag.c @@ -190,7 +190,6 @@ test_ot_tag_script_indic (void) test_indic_tags ("ory3", "ory2", "orya", HB_SCRIPT_ORIYA); test_indic_tags ("tml3", "tml2", "taml", HB_SCRIPT_TAMIL); test_indic_tags ("tel3", "tel2", "telu", HB_SCRIPT_TELUGU); - test_indic_tags ("mym3", "mym2", "mymr", HB_SCRIPT_MYANMAR); } @@ -506,6 +505,7 @@ test_ot_tag_full (void) test_tags (HB_SCRIPT_INVALID, "x-hbsc5678-hbot1234", HB_OT_MAX_TAGS_PER_SCRIPT, HB_OT_MAX_TAGS_PER_LANGUAGE, 1, 1, "5678", "1234"); test_tags (HB_SCRIPT_MALAYALAM, "ml", HB_OT_MAX_TAGS_PER_SCRIPT, HB_OT_MAX_TAGS_PER_LANGUAGE, 3, 2, "mlm3", "mlm2", "mlym", "MAL", "MLR"); test_tags (HB_SCRIPT_MALAYALAM, "ml", 1, 1, 1, 1, "mlm3", "MAL"); + test_tags (HB_SCRIPT_MYANMAR, "und", HB_OT_MAX_TAGS_PER_SCRIPT, 0, 2, 0, "mym2", "mymr"); test_tags (HB_SCRIPT_INVALID, "xyz", HB_OT_MAX_TAGS_PER_SCRIPT, HB_OT_MAX_TAGS_PER_LANGUAGE, 0, 1, "XYZ"); test_tags (HB_SCRIPT_INVALID, "xy", HB_OT_MAX_TAGS_PER_SCRIPT, HB_OT_MAX_TAGS_PER_LANGUAGE, 0, 0); }