diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | pango/pango-script-lang-table.h | 389 | ||||
-rw-r--r-- | tools/Makefile.am | 2 | ||||
-rw-r--r-- | tools/gen-script-for-lang-new.c | 122 |
4 files changed, 309 insertions, 212 deletions
@@ -1,3 +1,11 @@ +2007-10-28 Behdad Esfahbod <behdad@gnome.org> + + * pango/pango-script-lang-table.h: + * tools/gen-script-for-lang-new.c: + Sort scripts based on frequency. + + * tools/Makefile.am: Don't build anything by default. + 2007-10-26 Murray Cumming <murrayc@murrayc.com> * docs/pango_markup.sgml: Adds a link to diff --git a/pango/pango-script-lang-table.h b/pango/pango-script-lang-table.h index 580ee89b..cbe19b9e 100644 --- a/pango/pango-script-lang-table.h +++ b/pango/pango-script-lang-table.h @@ -1,203 +1,204 @@ -/* pango-script-lang-table.h: Generated by gen-script-for-lang.c - * - * Date: 26 Oct 2007 +/* pango-script-lang-table.h: + * + * Generated by gen-script-for-lang-new.c + * Date: 2007-10-26 * Source: fontconfig-2.4.91 - * + * * Do not edit. */ -typedef struct { +typedef struct _PangoScriptForLang { const char lang[6]; PangoScript scripts[3]; } PangoScriptForLang; static const PangoScriptForLang pango_script_for_lang[] = { - { "aa", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ab", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "af", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "am", { PANGO_SCRIPT_ETHIOPIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ar", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "as", { PANGO_SCRIPT_BENGALI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ast", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ava", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ay", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "az", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE } }, - { "az-ir", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ba", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bam", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "be", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bg", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bh", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bho", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bi", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bin", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bn", { PANGO_SCRIPT_BENGALI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bo", { PANGO_SCRIPT_TIBETAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "br", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bs", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "bua", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ca", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ce", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ch", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "chm", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "chr", { PANGO_SCRIPT_CHEROKEE, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "co", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "cs", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "cu", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "cv", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE } }, - { "cy", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "da", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "de", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "dz", { PANGO_SCRIPT_TIBETAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "el", { PANGO_SCRIPT_GREEK, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "en", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "eo", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "es", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "et", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "eu", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "fa", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "fi", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "fj", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "fo", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "fr", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ful", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "fur", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "fy", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ga", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "gd", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "gez", { PANGO_SCRIPT_ETHIOPIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "gl", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "gn", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "gu", { PANGO_SCRIPT_GUJARATI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "gv", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ha", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "haw", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "he", { PANGO_SCRIPT_HEBREW, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "hi", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ho", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "hr", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "hu", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "hy", { PANGO_SCRIPT_ARMENIAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ia", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ibo", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "id", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ie", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ik", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "io", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "is", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "it", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "iu", { PANGO_SCRIPT_CANADIAN_ABORIGINAL, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ja", { PANGO_SCRIPT_HAN, PANGO_SCRIPT_HIRAGANA, PANGO_SCRIPT_KATAKANA } }, - { "ka", { PANGO_SCRIPT_GEORGIAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kaa", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ki", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kk", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kl", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "km", { PANGO_SCRIPT_KHMER, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kn", { PANGO_SCRIPT_KANNADA, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ko", { PANGO_SCRIPT_HANGUL, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kok", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ks", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ku", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE } }, - { "ku-ir", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kum", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kv", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "kw", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ky", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "la", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "lb", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "lez", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ln", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "lo", { PANGO_SCRIPT_LAO, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "lt", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "lv", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "mg", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "mh", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "mi", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "mk", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ml", { PANGO_SCRIPT_MALAYALAM, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "mn", { PANGO_SCRIPT_MONGOLIAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "mo", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE } }, - { "mr", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "mt", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "my", { PANGO_SCRIPT_MYANMAR, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "nb", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "nds", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ne", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "nl", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "nn", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "no", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "nr", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "nso", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ny", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "oc", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "om", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "or", { PANGO_SCRIPT_ORIYA, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "os", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "pa", { PANGO_SCRIPT_GURMUKHI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "pl", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ps-af", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ps-pk", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "pt", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "rm", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ro", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ru", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sa", { PANGO_SCRIPT_DEVANAGARI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sah", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sco", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "se", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sel", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sh", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "si", { PANGO_SCRIPT_SINHALA, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sk", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sl", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sm", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sma", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "smj", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "smn", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sms", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "so", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sq", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sr", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ss", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "st", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sv", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "sw", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "syr", { PANGO_SCRIPT_SYRIAC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ta", { PANGO_SCRIPT_TAMIL, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "te", { PANGO_SCRIPT_TELUGU, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tg", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "th", { PANGO_SCRIPT_THAI, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ti-er", { PANGO_SCRIPT_ETHIOPIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ti-et", { PANGO_SCRIPT_ETHIOPIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tig", { PANGO_SCRIPT_ETHIOPIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tk", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tl", { PANGO_SCRIPT_TAGALOG, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tn", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "to", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tr", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ts", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tt", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tw", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "tyv", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ug", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "uk", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ur", { PANGO_SCRIPT_ARABIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "uz", { PANGO_SCRIPT_CYRILLIC, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "ven", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "vi", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "vo", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "vot", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "wa", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "wen", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "wo", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "xh", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "yap", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "yi", { PANGO_SCRIPT_HEBREW, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "yo", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "zh-cn", { PANGO_SCRIPT_HAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "zh-hk", { PANGO_SCRIPT_HAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "zh-mo", { PANGO_SCRIPT_HAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "zh-sg", { PANGO_SCRIPT_HAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "zh-tw", { PANGO_SCRIPT_HAN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, - { "zu", { PANGO_SCRIPT_LATIN, PANGO_SCRIPT_INVALID_CODE, PANGO_SCRIPT_INVALID_CODE } }, + { "aa", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "ab", { PANGO_SCRIPT_CYRILLIC/*90*/ } }, + { "af", { PANGO_SCRIPT_LATIN/*69*/ } }, + { "am", { PANGO_SCRIPT_ETHIOPIC/*218*/ } }, + { "ar", { PANGO_SCRIPT_ARABIC/*125*/ } }, + { "as", { PANGO_SCRIPT_BENGALI/*89*/ } }, + { "ast", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "ava", { PANGO_SCRIPT_CYRILLIC/*67*/ } }, + { "ay", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "az", { PANGO_SCRIPT_CYRILLIC/*80*/, PANGO_SCRIPT_LATIN/*68*/ } }, + { "az-ir", { PANGO_SCRIPT_ARABIC/*129*/ } }, + { "ba", { PANGO_SCRIPT_CYRILLIC/*82*/ } }, + { "bam", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "be", { PANGO_SCRIPT_CYRILLIC/*68*/ } }, + { "bg", { PANGO_SCRIPT_CYRILLIC/*60*/ } }, + { "bh", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "bho", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "bi", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "bin", { PANGO_SCRIPT_LATIN/*76*/ } }, + { "bn", { PANGO_SCRIPT_BENGALI/*89*/ } }, + { "bo", { PANGO_SCRIPT_TIBETAN/*95*/ } }, + { "br", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "bs", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "bua", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "ca", { PANGO_SCRIPT_LATIN/*74*/ } }, + { "ce", { PANGO_SCRIPT_CYRILLIC/*67*/ } }, + { "ch", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "chm", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "chr", { PANGO_SCRIPT_CHEROKEE/*85*/ } }, + { "co", { PANGO_SCRIPT_LATIN/*84*/ } }, + { "cs", { PANGO_SCRIPT_LATIN/*82*/ } }, + { "cu", { PANGO_SCRIPT_CYRILLIC/*103*/ } }, + { "cv", { PANGO_SCRIPT_CYRILLIC/*72*/, PANGO_SCRIPT_LATIN/*2*/ } }, + { "cy", { PANGO_SCRIPT_LATIN/*78*/ } }, + { "da", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "de", { PANGO_SCRIPT_LATIN/*59*/ } }, + { "dz", { PANGO_SCRIPT_TIBETAN/*95*/ } }, + { "el", { PANGO_SCRIPT_GREEK/*69*/ } }, + { "en", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "eo", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "es", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "et", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "eu", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "fa", { PANGO_SCRIPT_ARABIC/*129*/ } }, + { "fi", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "fj", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "fo", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "fr", { PANGO_SCRIPT_LATIN/*84*/ } }, + { "ful", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "fur", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "fy", { PANGO_SCRIPT_LATIN/*75*/ } }, + { "ga", { PANGO_SCRIPT_LATIN/*80*/ } }, + { "gd", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "gez", { PANGO_SCRIPT_ETHIOPIC/*218*/ } }, + { "gl", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "gn", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "gu", { PANGO_SCRIPT_GUJARATI/*78*/ } }, + { "gv", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "ha", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "haw", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "he", { PANGO_SCRIPT_HEBREW/*27*/ } }, + { "hi", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "ho", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "hr", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "hu", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "hy", { PANGO_SCRIPT_ARMENIAN/*77*/ } }, + { "ia", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "ibo", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "id", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "ie", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "ik", { PANGO_SCRIPT_CYRILLIC/*68*/ } }, + { "io", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "is", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "it", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "iu", { PANGO_SCRIPT_CANADIAN_ABORIGINAL/*161*/ } }, + { "ja", { PANGO_SCRIPT_HAN/*6356*/, PANGO_SCRIPT_KATAKANA/*88*/, PANGO_SCRIPT_HIRAGANA/*85*/ } }, + { "ka", { PANGO_SCRIPT_GEORGIAN/*33*/ } }, + { "kaa", { PANGO_SCRIPT_CYRILLIC/*78*/ } }, + { "ki", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "kk", { PANGO_SCRIPT_CYRILLIC/*77*/ } }, + { "kl", { PANGO_SCRIPT_LATIN/*81*/ } }, + { "km", { PANGO_SCRIPT_KHMER/*70*/ } }, + { "kn", { PANGO_SCRIPT_KANNADA/*80*/ } }, + { "ko", { PANGO_SCRIPT_HANGUL/*2443*/ } }, + { "kok", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "ks", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "ku", { PANGO_SCRIPT_CYRILLIC/*60*/, PANGO_SCRIPT_LATIN/*4*/ } }, + { "ku-ir", { PANGO_SCRIPT_ARABIC/*32*/ } }, + { "kum", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "kv", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "kw", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "ky", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "la", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "lb", { PANGO_SCRIPT_LATIN/*75*/ } }, + { "lez", { PANGO_SCRIPT_CYRILLIC/*67*/ } }, + { "ln", { PANGO_SCRIPT_LATIN/*78*/ } }, + { "lo", { PANGO_SCRIPT_LAO/*65*/ } }, + { "lt", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "lv", { PANGO_SCRIPT_LATIN/*78*/ } }, + { "mg", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "mh", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "mi", { PANGO_SCRIPT_LATIN/*64*/ } }, + { "mk", { PANGO_SCRIPT_CYRILLIC/*42*/ } }, + { "ml", { PANGO_SCRIPT_MALAYALAM/*78*/ } }, + { "mn", { PANGO_SCRIPT_MONGOLIAN/*130*/ } }, + { "mo", { PANGO_SCRIPT_CYRILLIC/*66*/, PANGO_SCRIPT_LATIN/*62*/ } }, + { "mr", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "mt", { PANGO_SCRIPT_LATIN/*72*/ } }, + { "my", { PANGO_SCRIPT_MYANMAR/*48*/ } }, + { "nb", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "nds", { PANGO_SCRIPT_LATIN/*59*/ } }, + { "ne", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "nl", { PANGO_SCRIPT_LATIN/*82*/ } }, + { "nn", { PANGO_SCRIPT_LATIN/*76*/ } }, + { "no", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "nr", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "nso", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "ny", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "oc", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "om", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "or", { PANGO_SCRIPT_ORIYA/*79*/ } }, + { "os", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "pa", { PANGO_SCRIPT_GURMUKHI/*63*/ } }, + { "pl", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ps-af", { PANGO_SCRIPT_ARABIC/*49*/ } }, + { "ps-pk", { PANGO_SCRIPT_ARABIC/*49*/ } }, + { "pt", { PANGO_SCRIPT_LATIN/*82*/ } }, + { "rm", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "ro", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "ru", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "sa", { PANGO_SCRIPT_DEVANAGARI/*68*/ } }, + { "sah", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "sco", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "se", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "sel", { PANGO_SCRIPT_CYRILLIC/*66*/ } }, + { "sh", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "si", { PANGO_SCRIPT_SINHALA/*77*/ } }, + { "sk", { PANGO_SCRIPT_LATIN/*86*/ } }, + { "sl", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "sm", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "sma", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "smj", { PANGO_SCRIPT_LATIN/*60*/ } }, + { "smn", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "sms", { PANGO_SCRIPT_LATIN/*80*/ } }, + { "so", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "sq", { PANGO_SCRIPT_LATIN/*56*/ } }, + { "sr", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "ss", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "st", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "sv", { PANGO_SCRIPT_LATIN/*68*/ } }, + { "sw", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "syr", { PANGO_SCRIPT_SYRIAC/*45*/ } }, + { "ta", { PANGO_SCRIPT_TAMIL/*48*/ } }, + { "te", { PANGO_SCRIPT_TELUGU/*80*/ } }, + { "tg", { PANGO_SCRIPT_CYRILLIC/*78*/ } }, + { "th", { PANGO_SCRIPT_THAI/*86*/ } }, + { "ti-er", { PANGO_SCRIPT_ETHIOPIC/*255*/ } }, + { "ti-et", { PANGO_SCRIPT_ETHIOPIC/*255*/ } }, + { "tig", { PANGO_SCRIPT_ETHIOPIC/*221*/ } }, + { "tk", { PANGO_SCRIPT_CYRILLIC/*74*/ } }, + { "tl", { PANGO_SCRIPT_TAGALOG/*19*/ } }, + { "tn", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "to", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "tr", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "ts", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "tt", { PANGO_SCRIPT_CYRILLIC/*76*/ } }, + { "tw", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "tyv", { PANGO_SCRIPT_CYRILLIC/*70*/ } }, + { "ug", { PANGO_SCRIPT_ARABIC/*125*/ } }, + { "uk", { PANGO_SCRIPT_CYRILLIC/*72*/ } }, + { "ur", { PANGO_SCRIPT_ARABIC/*145*/ } }, + { "uz", { PANGO_SCRIPT_CYRILLIC/*68*/ } }, + { "ven", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "vi", { PANGO_SCRIPT_LATIN/*186*/ } }, + { "vo", { PANGO_SCRIPT_LATIN/*54*/ } }, + { "vot", { PANGO_SCRIPT_LATIN/*62*/ } }, + { "wa", { PANGO_SCRIPT_LATIN/*70*/ } }, + { "wen", { PANGO_SCRIPT_LATIN/*76*/ } }, + { "wo", { PANGO_SCRIPT_LATIN/*66*/ } }, + { "xh", { PANGO_SCRIPT_LATIN/*52*/ } }, + { "yap", { PANGO_SCRIPT_LATIN/*58*/ } }, + { "yi", { PANGO_SCRIPT_HEBREW/*27*/ } }, + { "yo", { PANGO_SCRIPT_LATIN/*114*/ } }, + { "zh-cn", { PANGO_SCRIPT_HAN/*6763*/ } }, + { "zh-hk", { PANGO_SCRIPT_HAN/*2213*/ } }, + { "zh-mo", { PANGO_SCRIPT_HAN/*2213*/ } }, + { "zh-sg", { PANGO_SCRIPT_HAN/*6763*/ } }, + { "zh-tw", { PANGO_SCRIPT_HAN/*13063*/ } }, + { "zu", { PANGO_SCRIPT_LATIN/*52*/ } } }; diff --git a/tools/Makefile.am b/tools/Makefile.am index 8702a62e..fdc746e9 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -7,7 +7,7 @@ INCLUDES = \ -DPANGO_DISABLE_DEPRECATED \ $(PANGO_DEBUG_FLAGS) -noinst_PROGRAMS = \ +EXTRA_PROGRAMS = \ gen-script-for-lang \ gen-script-for-lang-new diff --git a/tools/gen-script-for-lang-new.c b/tools/gen-script-for-lang-new.c index fb5eebc8..2ef49859 100644 --- a/tools/gen-script-for-lang-new.c +++ b/tools/gen-script-for-lang-new.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <pango/pango-enum-types.h> #include <pango/pango-script.h> @@ -34,8 +35,13 @@ #define MAX_SCRIPTS 3 typedef struct { + PangoScript script; + int freq; +} ScriptInfo; + +typedef struct { PangoLanguage *lang; - PangoScript scripts[MAX_SCRIPTS]; + ScriptInfo scripts[MAX_SCRIPTS]; } LangInfo; static const char *get_script_name (PangoScript script) @@ -81,17 +87,19 @@ script_for_char (gunichar ch, for (j = 0; j < MAX_SCRIPTS; j++) { - if (info->scripts[j] == script) + if (info->scripts[j].script == script) break; - if (info->scripts[j] == PANGO_SCRIPT_INVALID_CODE) + if (info->scripts[j].script == PANGO_SCRIPT_COMMON) { - info->scripts[j] = script; + info->scripts[j].script = script; break; } } if (j == MAX_SCRIPTS) - fail ("More than %d scripts found for %s\n", MAX_SCRIPTS, pango_language_to_string (info->lang)); + fail ("More than %d scripts found for %s. Increase MAX_SCRIPTS.\n", MAX_SCRIPTS, pango_language_to_string (info->lang)); + + info->scripts[j].freq++; } } @@ -140,7 +148,10 @@ do_lang (GArray *script_array, info.lang = pango_language_from_string ((const char *)lang); for (j = 0; j < MAX_SCRIPTS; j++) - info.scripts[j] = PANGO_SCRIPT_INVALID_CODE; + { + info.scripts[j].script = PANGO_SCRIPT_COMMON; + info.scripts[j].freq = 0; + } scripts_for_lang (&info); @@ -148,6 +159,36 @@ do_lang (GArray *script_array, } static int +compare_script (gconstpointer a, + gconstpointer b, + gpointer data) +{ + const ScriptInfo *info_a = a; + const ScriptInfo *info_b = b; + G_GNUC_UNUSED LangInfo *lang_info = data; + + /* first compare frequencies, higher first */ + if (info_a->freq > info_b->freq) + return -1; + if (info_a->freq < info_b->freq) + return +1; + + /* next compare script indices, higher first (it's more specific) */ + if (info_a->script > info_b->script) + return -1; + if (info_a->script < info_b->script) + return +1; + + /* for stability, next compare pointers themselves, smaller first */ + if (info_a < info_b) + return -1; + if (info_a > info_b) + return +1; + + return 0; +} + +static int compare_lang (gconstpointer a, gconstpointer b) { @@ -161,12 +202,21 @@ compare_lang (gconstpointer a, int main (void) { GArray *script_array; + unsigned int i; int j; int max_lang_len = 0; + int max_script_len = 0; + FcStrList *langs; FcChar8* lang; + char date_buf[200]; + const char *date_str = "unknown"; + time_t t; + struct tm *tmp; + int fc_version; + g_type_init (); script_array = g_array_new (FALSE, FALSE, sizeof (LangInfo)); @@ -185,36 +235,74 @@ int main (void) for (i = 0; i < script_array->len; i++) { LangInfo *info = &g_array_index (script_array, LangInfo, i); - + max_lang_len = MAX (max_lang_len, - 1 + (int)strlen (pango_language_to_string (info->lang))); - } + (int)strlen (pango_language_to_string (info->lang))); + + g_qsort_with_data (info->scripts, + G_N_ELEMENTS (info->scripts), + sizeof (info->scripts[0]), + compare_script, + info); + + for (j = 0; j < MAX_SCRIPTS; j++) + if (!info->scripts[j].freq) + break; - g_print ("typedef struct {\n" + max_script_len = MAX (max_script_len, j); + } + + if ((t = time(NULL), tmp = localtime (&t)) && strftime(date_buf, sizeof(date_buf), "%F", tmp)) + date_str = date_buf; + + fc_version = FcGetVersion (); + + g_print ("/* pango-script-lang-table.h:\n" + " * \n" + " * Generated by %s\n" + " * Date: %s\n" + " * Source: fontconfig-%d.%d.%d\n" + " * \n" + " * Do not edit.\n" + " */\n", + __FILE__, + date_str, + fc_version / 10000, (fc_version / 100) % 100, fc_version % 100); + + g_print ("typedef struct _PangoScriptForLang {\n" " const char lang[%d];\n" " PangoScript scripts[%d];\n" "} PangoScriptForLang;\n" "\n" "static const PangoScriptForLang pango_script_for_lang[] = {\n", - max_lang_len, - MAX_SCRIPTS); + max_lang_len + 1, + max_script_len); for (i = 0; i < script_array->len; i++) { LangInfo *info = &g_array_index (script_array, LangInfo, i); - g_print (" { \"%s\", { ", pango_language_to_string (info->lang)); + g_print (" { \"%s\", %*s{ ", + pango_language_to_string (info->lang), + max_lang_len - strlen (pango_language_to_string (info->lang)), ""); for (j = 0; j < MAX_SCRIPTS; j++) { + if (!info->scripts[j].freq) + break; + if (j != 0) g_print (", "); - g_print ("%s", get_script_name (info->scripts[j])); + g_print ("%s/*%d*/", + get_script_name (info->scripts[j].script), + info->scripts[j].freq); } - g_print (" } },\n"); + g_print (" } }"); + if (i + 1 != script_array->len) + g_print (","); + g_print ("\n"); } g_print ("};\n"); - - + return 0; } |