< prev index next >

src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc

Print this page

        

@@ -824,20 +824,23 @@
 /*{"??",        HB_TAG('Y','I','C',' ')},*/     /* Yi Classic */
 /*{"zh-Latn-pinyin",    HB_TAG('Z','H','P',' ')},*/     /* Chinese Phonetic */
 };
 
 typedef struct {
-  char language[8];
+  char language[11];
   hb_tag_t tag;
 } LangTagLong;
 static const LangTagLong ot_languages_zh[] = {
+  /* Store longest-first, if one is a prefix of another. */
   {"zh-cn",     HB_TAG('Z','H','S',' ')},       /* Chinese (China) */
   {"zh-hk",     HB_TAG('Z','H','H',' ')},       /* Chinese (Hong Kong) */
-  {"zh-mo",     HB_TAG('Z','H','T',' ')},       /* Chinese (Macao) */
+  {"zh-mo",     HB_TAG('Z','H','H',' ')},       /* Chinese (Macao) */
   {"zh-sg",     HB_TAG('Z','H','S',' ')},       /* Chinese (Singapore) */
   {"zh-tw",     HB_TAG('Z','H','T',' ')},       /* Chinese (Taiwan) */
   {"zh-hans",   HB_TAG('Z','H','S',' ')},       /* Chinese (Simplified) */
+  {"zh-hant-hk",HB_TAG('Z','H','H',' ')},       /* Chinese (Hong Kong) */
+  {"zh-hant-mo",HB_TAG('Z','H','H',' ')},       /* Chinese (Macao) */
   {"zh-hant",   HB_TAG('Z','H','T',' ')},       /* Chinese (Traditional) */
 };
 
 static int
 lang_compare_first_component (const char *a,

@@ -887,17 +890,25 @@
       return HB_TAG_CHAR4 (tag);
     }
   }
 
   /*
-   * The International Phonetic Alphabet is a variant tag in BCP-47,
-   * which can be applied to any language.
+   * "fonipa" is a variant tag in BCP-47, meaning the International Phonetic Alphabet.
+   * It can be applied to any language.
    */
   if (strstr (lang_str, "-fonipa")) {
     return HB_TAG('I','P','P','H');  /* Phonetic transcription—IPA conventions */
   }
 
+  /*
+   * "fonnapa" is a variant tag in BCP-47, meaning the North American Phonetic Alphabet
+   * also known as Americanist Phonetic Notation.  It can be applied to any language.
+   */
+  if (strstr (lang_str, "-fonnapa")) {
+    return HB_TAG('A','P','P','H');  /* Phonetic transcription—Americanist conventions */
+  }
+
   /* Find a language matching in the first component */
   {
     const LangTag *lang_tag;
     lang_tag = (LangTag *) bsearch (lang_str, ot_languages,
                                     ARRAY_LENGTH (ot_languages), sizeof (LangTag),

@@ -965,10 +976,12 @@
     }
   }
 
   /* struct LangTag has only room for 3-letter language tags. */
   switch (tag) {
+  case HB_TAG('A','P','P','H'):  /* Phonetic transcription—Americanist conventions */
+    return hb_language_from_string ("und-fonnapa", -1);
   case HB_TAG('I','P','P','H'):  /* Phonetic transcription—IPA conventions */
     return hb_language_from_string ("und-fonipa", -1);
   }
 
   /* Else return a custom language in the form of "x-hbotABCD" */
< prev index next >