Let BCP 47 tag "mo" fall back to OT tag 'ROM '

This commit is contained in:
David Corbett 2021-10-03 20:09:33 -04:00
parent a184c5f851
commit ae9afd9772
2 changed files with 15 additions and 3 deletions

View File

@ -774,7 +774,6 @@ ot.add_language ('qxr', 'QVI')
ot.add_language ('qxt', 'QWH') ot.add_language ('qxt', 'QWH')
ot.add_language ('qxw', 'QWH') ot.add_language ('qxw', 'QWH')
bcp_47.macrolanguages['ro'].remove ('mo')
bcp_47.macrolanguages['ro-MD'].add ('mo') bcp_47.macrolanguages['ro-MD'].add ('mo')
ot.remove_language_ot ('SYRE') ot.remove_language_ot ('SYRE')
@ -1014,6 +1013,8 @@ for initial, items in sorted (complex_tags.items ()):
if initial != 'und': if initial != 'und':
continue continue
for lt, tags in items: for lt, tags in items:
if not tags:
continue
if lt.variant in bcp_47.prefixes: if lt.variant in bcp_47.prefixes:
expect (next (iter (bcp_47.prefixes[lt.variant])) == lt.language, expect (next (iter (bcp_47.prefixes[lt.variant])) == lt.language,
'%s is not a valid prefix of %s' % (lt.language, lt.variant)) '%s is not a valid prefix of %s' % (lt.language, lt.variant))
@ -1048,6 +1049,8 @@ for initial, items in sorted (complex_tags.items ()):
continue continue
print (" case '%s':" % initial) print (" case '%s':" % initial)
for lt, tags in items: for lt, tags in items:
if not tags:
continue
print (' if (', end='') print (' if (', end='')
script = lt.script script = lt.script
region = lt.region region = lt.region

View File

@ -940,6 +940,7 @@ static const LangTag ot_languages[] = {
{"mnw", HB_TAG('M','O','N','T')}, /* Mon -> Thailand Mon */ {"mnw", HB_TAG('M','O','N','T')}, /* Mon -> Thailand Mon */
{"mnx", HB_TAG_NONE }, /* Manikion != Manx */ {"mnx", HB_TAG_NONE }, /* Manikion != Manx */
{"mo", HB_TAG('M','O','L',' ')}, /* Moldavian (retired code) */ {"mo", HB_TAG('M','O','L',' ')}, /* Moldavian (retired code) */
{"mo", HB_TAG('R','O','M',' ')}, /* Moldavian (retired code) -> Romanian */
{"mod", HB_TAG('C','P','P',' ')}, /* Mobilian -> Creoles */ {"mod", HB_TAG('C','P','P',' ')}, /* Mobilian -> Creoles */
/*{"moh", HB_TAG('M','O','H',' ')},*/ /* Mohawk */ /*{"moh", HB_TAG('M','O','H',' ')},*/ /* Mohawk */
{"mok", HB_TAG_NONE }, /* Morori != Moksha */ {"mok", HB_TAG_NONE }, /* Morori != Moksha */
@ -2623,8 +2624,14 @@ hb_ot_tags_from_complex_language (const char *lang_str,
&& subtag_matches (lang_str, limit, "-md")) && subtag_matches (lang_str, limit, "-md"))
{ {
/* Romanian; Moldova */ /* Romanian; Moldova */
tags[0] = HB_TAG('M','O','L',' '); /* Moldavian */ unsigned int i;
*count = 1; hb_tag_t possible_tags[] = {
HB_TAG('M','O','L',' '), /* Moldavian */
HB_TAG('R','O','M',' '), /* Romanian */
};
for (i = 0; i < 2 && i < *count; i++)
tags[i] = possible_tags[i];
*count = i;
return true; return true;
} }
break; break;
@ -2930,6 +2937,8 @@ hb_ot_ambiguous_tag_to_language (hb_tag_t tag)
return hb_language_from_string ("qwh", -1); /* Huaylas Ancash Quechua */ return hb_language_from_string ("qwh", -1); /* Huaylas Ancash Quechua */
case HB_TAG('R','A','J',' '): /* Rajasthani */ case HB_TAG('R','A','J',' '): /* Rajasthani */
return hb_language_from_string ("raj", -1); /* Rajasthani [macrolanguage] */ return hb_language_from_string ("raj", -1); /* Rajasthani [macrolanguage] */
case HB_TAG('R','O','M',' '): /* Romanian */
return hb_language_from_string ("ro", -1); /* Romanian */
case HB_TAG('R','O','Y',' '): /* Romany */ case HB_TAG('R','O','Y',' '): /* Romany */
return hb_language_from_string ("rom", -1); /* Romany [macrolanguage] */ return hb_language_from_string ("rom", -1); /* Romany [macrolanguage] */
case HB_TAG('S','Q','I',' '): /* Albanian */ case HB_TAG('S','Q','I',' '): /* Albanian */