Add Tibetan to font selection UI. Bug 441110, r=emk
authorSimon Montagu <smontagu@smontagu.org>
Thu, 04 Mar 2010 10:55:53 +0200
changeset 38930 580c63190d26
parent 38929 9ee18dec071b
child 38931 48d939fb59c3
push id11941
push usersmontagu@mozilla.com
push dateThu, 04 Mar 2010 08:57:33 +0000
treeherdermozilla-central@580c63190d26 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs441110
milestone1.9.3a3pre
Add Tibetan to font selection UI. Bug 441110, r=emk
browser/components/preferences/fonts.xul
browser/locales/en-US/chrome/browser/preferences/fonts.dtd
gfx/thebes/public/gfxPlatform.h
gfx/thebes/src/gfxAtomList.h
gfx/thebes/src/gfxFontconfigUtils.cpp
gfx/thebes/src/gfxPlatform.cpp
gfx/thebes/src/gfxWindowsFonts.cpp
gfx/thebes/src/nsUnicodeRange.cpp
gfx/thebes/src/nsUnicodeRange.h
intl/locale/src/langGroups.properties
intl/locale/src/language.properties
modules/libpref/src/init/all.js
--- a/browser/components/preferences/fonts.xul
+++ b/browser/components/preferences/fonts.xul
@@ -110,16 +110,17 @@
             <menuitem value="x-khmr"          label="&font.langGroup.khmer;"/>
             <menuitem value="ko"              label="&font.langGroup.korean;"/>
             <menuitem value="x-mlym"          label="&font.langGroup.malayalam;"/>
             <menuitem value="x-orya"          label="&font.langGroup.oriya;"/>
             <menuitem value="x-sinh"          label="&font.langGroup.sinhala;"/>
             <menuitem value="x-tamil"         label="&font.langGroup.tamil;"/>
             <menuitem value="x-telu"          label="&font.langGroup.telugu;"/>
             <menuitem value="th"              label="&font.langGroup.thai;"/>
+            <menuitem value="x-tibt"          label="&font.langGroup.tibetan;"/>
             <menuitem value="tr"              label="&font.langGroup.turkish;"/>
             <menuitem value="x-cans"          label="&font.langGroup.canadian;"/>
             <menuitem value="x-western"       label="&font.langGroup.latin1;"/>
             <menuitem value="x-unicode"       label="&font.langGroup.unicode;"/>
             <menuitem value="x-user-def"      label="&font.langGroup.user-def;"/>
           </menupopup>
         </menulist>
       </caption>
--- a/browser/locales/en-US/chrome/browser/preferences/fonts.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/fonts.dtd
@@ -46,16 +46,17 @@
 <!ENTITY  font.langGroup.gujarati                 "Gujarati">
 <!ENTITY  font.langGroup.gurmukhi                 "Gurmukhi">
 <!ENTITY  font.langGroup.khmer                    "Khmer">
 <!ENTITY  font.langGroup.malayalam                "Malayalam">
 <!ENTITY  font.langGroup.oriya                    "Oriya">
 <!ENTITY  font.langGroup.telugu                   "Telugu">
 <!ENTITY  font.langGroup.kannada                  "Kannada">
 <!ENTITY  font.langGroup.sinhala                  "Sinhala">
+<!ENTITY  font.langGroup.tibetan                  "Tibetan">
 <!-- Minimum font size -->
 <!ENTITY minSize.label                            "Minimum font size:">
 <!ENTITY minSize.accesskey                        "o">
 <!ENTITY minSize.none                             "None">
 
 <!-- default font type -->
 <!ENTITY  useDefaultFontSerif.label               "Serif">
 <!ENTITY  useDefaultFontSansSerif.label           "Sans Serif">
--- a/gfx/thebes/public/gfxPlatform.h
+++ b/gfx/thebes/public/gfxPlatform.h
@@ -93,24 +93,25 @@ enum eFontPrefLang {
     eFontPrefLang_Gujarati    = 21,
     eFontPrefLang_Gurmukhi    = 22,
     eFontPrefLang_Khmer       = 23,
     eFontPrefLang_Malayalam   = 24,
     eFontPrefLang_Oriya       = 25,
     eFontPrefLang_Telugu      = 26,
     eFontPrefLang_Kannada     = 27,
     eFontPrefLang_Sinhala     = 28,
+    eFontPrefLang_Tibetan     = 29,
 
-    eFontPrefLang_LangCount   = 29, // except Others and UserDefined.
+    eFontPrefLang_LangCount   = 30, // except Others and UserDefined.
 
-    eFontPrefLang_Others      = 29, // x-unicode
-    eFontPrefLang_UserDefined = 30,
+    eFontPrefLang_Others      = 30, // x-unicode
+    eFontPrefLang_UserDefined = 31,
 
-    eFontPrefLang_CJKSet      = 31, // special code for CJK set
-    eFontPrefLang_AllCount    = 32
+    eFontPrefLang_CJKSet      = 32, // special code for CJK set
+    eFontPrefLang_AllCount    = 33
 };
 
 enum eCMSMode {
     eCMSMode_Off          = 0,     // No color management
     eCMSMode_All          = 1,     // Color manage everything
     eCMSMode_TaggedOnly   = 2,     // Color manage tagged Images Only
     eCMSMode_AllCount     = 3
 };
--- a/gfx/thebes/src/gfxAtomList.h
+++ b/gfx/thebes/src/gfxAtomList.h
@@ -81,13 +81,14 @@ GFX_ATOM(x_geor, "x-geor")
 GFX_ATOM(x_gujr, "x-gujr")
 GFX_ATOM(x_guru, "x-guru")
 GFX_ATOM(x_khmr, "x-khmr")
 GFX_ATOM(x_mlym, "x-mlym")
 GFX_ATOM(x_orya, "x-orya")
 GFX_ATOM(x_telu, "x-telu")
 GFX_ATOM(x_knda, "x-knda")
 GFX_ATOM(x_sinh, "x-sinh")
+GFX_ATOM(x_tibt, "x-tibt")
 
 // used in gfxGDIFontList.h
 GFX_ATOM(ko_xxx, "ko-xxx")
 GFX_ATOM(x_central_euro, "x-central-euro")
 GFX_ATOM(x_symbol, "x-symbol")
--- a/gfx/thebes/src/gfxFontconfigUtils.cpp
+++ b/gfx/thebes/src/gfxFontconfigUtils.cpp
@@ -347,16 +347,17 @@ const MozLangGroupData MozLangGroups[] =
     { "x-gujr",         "gu" },
     { "x-guru",         "pa" },
     { "x-khmr",         "km" },
     { "x-knda",         "kn" },
     { "x-mlym",         "ml" },
     { "x-orya",         "or" },
     { "x-sinh",         "si" },
     { "x-telu",         "te" },
+    { "x-tibt",         "bo" },
     { "x-unicode",      0    },
     { "x-user-def",     0    }
 };
 
 static PRBool
 TryLangForGroup(const nsACString& aOSLang, nsIAtom *aLangGroup,
                 nsACString *aFcLang)
 {
--- a/gfx/thebes/src/gfxPlatform.cpp
+++ b/gfx/thebes/src/gfxPlatform.cpp
@@ -155,16 +155,17 @@ static const char *gPrefLangNames[] = {
     "x-gujr",
     "x-guru",
     "x-khmr",
     "x-mlym",
     "x-orya",
     "x-telu",
     "x-knda",
     "x-sinh",
+    "x-tibt",
     "x-unicode",
     "x-user-def"
 };
 
 
 gfxPlatform*
 gfxPlatform::GetPlatform()
 {
--- a/gfx/thebes/src/gfxWindowsFonts.cpp
+++ b/gfx/thebes/src/gfxWindowsFonts.cpp
@@ -1010,17 +1010,17 @@ static const struct ScriptPropertyEntry 
     { "LANG_TAMIL",      "x-tamil" }, // tam
     { "LANG_TELUGU",     "x-telu" },  //tel
     { "LANG_KANNADA",    "x-knda" },  // kan
     { "LANG_MALAYALAM",  "x-mlym" }, // mal
     { "LANG_ASSAMESE",   "x-beng" },    // asm
     { "LANG_MARATHI",    "x-devanagari" }, // mar
     { "LANG_SANSKRIT",   "x-devanagari" }, // san
     { "LANG_MONGOLIAN",  "mon" },
-    { "TIBETAN",         "tib" }, // tib/bod
+    { "TIBETAN",         "x-tibt" }, // tib/bod
     { nsnull, nsnull },
     { "KHMER",           "x-khmr" }, // khm
     { "LAO",             "lao" },
     { "MYANMAR",         "bur" }, // bur/mya
     { "LANG_GALICIAN",   "glg" },
     { "LANG_KONKANI",    "kok" },
     { "LANG_MANIPURI",   "mni" },
     { "LANG_SINDHI",     "snd" },
--- a/gfx/thebes/src/nsUnicodeRange.cpp
+++ b/gfx/thebes/src/nsUnicodeRange.cpp
@@ -64,17 +64,18 @@ static nsIAtom **gUnicodeRangeToLangGrou
   &gfxAtoms::x_geor,
   &gfxAtoms::x_gujr,
   &gfxAtoms::x_guru,
   &gfxAtoms::x_khmr,
   &gfxAtoms::x_mlym,
   &gfxAtoms::x_orya,
   &gfxAtoms::x_telu,
   &gfxAtoms::x_knda,
-  &gfxAtoms::x_sinh
+  &gfxAtoms::x_sinh,
+  &gfxAtoms::x_tibt
 };
 
 /**********************************************************************
  * Unicode subranges as defined in unicode 3.0
  * x-western, x-central-euro, tr, x-baltic  -> latin 
  *  0000 - 036f 
  *  1e00 - 1eff
  *  2000 - 206f  (general punctuation)
--- a/gfx/thebes/src/nsUnicodeRange.h
+++ b/gfx/thebes/src/nsUnicodeRange.h
@@ -67,35 +67,35 @@ const PRUint8   kRangeGeorgian =   17;
 const PRUint8   kRangeGujarati =   18;
 const PRUint8   kRangeGurmukhi =   19;
 const PRUint8   kRangeKhmer    =   20;
 const PRUint8   kRangeMalayalam =  21;
 const PRUint8   kRangeOriya     =  22;
 const PRUint8   kRangeTelugu    =  23;
 const PRUint8   kRangeKannada   =  24;
 const PRUint8   kRangeSinhala   =  25;
+const PRUint8   kRangeTibetan   =  26;
 
-const PRUint8   kRangeSpecificItemNum = 26;
-
-//range/rangeSet grow to this place 26-29
+const PRUint8   kRangeSpecificItemNum = 27;
 
-const PRUint8   kRangeSetStart  =  30;    // range set definition starts from here
-const PRUint8   kRangeSetLatin  =  30;
-const PRUint8   kRangeSetCJK    =  31;
-const PRUint8   kRangeSetEnd    =  31;   // range set definition ends here
+//range/rangeSet grow to this place 27-30
+
+const PRUint8   kRangeSetStart  =  31;    // range set definition starts from here
+const PRUint8   kRangeSetLatin  =  31;
+const PRUint8   kRangeSetCJK    =  32;
+const PRUint8   kRangeSetEnd    =  32;   // range set definition ends here
 
 // less frequently used range definition
-const PRUint8   kRangeSurrogate            = 32;
-const PRUint8   kRangePrivate              = 33;
-const PRUint8   kRangeMisc                 = 34;
-const PRUint8   kRangeUnassigned           = 35;
-const PRUint8   kRangeSyriac               = 36;
-const PRUint8   kRangeThaana               = 37;
-const PRUint8   kRangeLao                  = 38;
-const PRUint8   kRangeTibetan              = 39;
+const PRUint8   kRangeSurrogate            = 33;
+const PRUint8   kRangePrivate              = 34;
+const PRUint8   kRangeMisc                 = 35;
+const PRUint8   kRangeUnassigned           = 36;
+const PRUint8   kRangeSyriac               = 37;
+const PRUint8   kRangeThaana               = 38;
+const PRUint8   kRangeLao                  = 39;
 const PRUint8   kRangeMyanmar              = 40;
 const PRUint8   kRangeCherokee             = 41;
 const PRUint8   kRangeOghamRunic           = 42;
 const PRUint8   kRangeMongolian            = 43;
 const PRUint8   kRangeMathOperators        = 44;
 const PRUint8   kRangeMiscTechnical        = 45;
 const PRUint8   kRangeControlOpticalEnclose = 46;
 const PRUint8   kRangeBoxBlockGeometrics   = 47;
--- a/intl/locale/src/langGroups.properties
+++ b/intl/locale/src/langGroups.properties
@@ -57,32 +57,33 @@ af=x-western
 alg=x-cans
 am=x-ethi
 ar=ar
 as=x-beng
 ay=x-western
 be=x-cyrillic
 bg=x-cyrillic
 bn=x-beng
+bo=x-tibt
 br=x-western
 bs=x-central-euro
 ca=x-western
 ce=x-central-euro
 ch=x-western
 co=x-western
 cr=x-cans
 cs=x-central-euro
 #cu=x-cyrillic
 cv=x-cyrillic
 # XXX Latin Ext. A is also used for cy. 
 cy=x-western
 da=x-western
 de=x-western
 #dv=Thaanna
-#dz=Tibetan
+dz=x-tibt
 #ee=x-western(?) (Ewe uses characters outside Latin-1 as well)
 el=el
 en=x-western
 # Esperanto: Latin-3
 eo=x-western 
 es=x-western
 et=x-baltic
 eu=x-western
--- a/intl/locale/src/language.properties
+++ b/intl/locale/src/language.properties
@@ -29,17 +29,17 @@ ay.accept =     true
 az.accept = 	true
 ba.accept = 	false				
 be.accept = 	true				
 bg.accept = 	true				
 bh.accept = 	false				
 bi.accept = 	false				
 bm.accept = 	false				
 bn.accept = 	true
-bo.accept = 	false				
+bo.accept = 	true				
 br.accept = 	true
 bs.accept = 	true				
 ca.accept = 	true				
 ce.accept = 	true				
 ch.accept =	true
 co.accept = 	true
 cr.accept =	true
 cs.accept = 	true				
@@ -49,17 +49,17 @@ cy.accept = 	true
 da.accept = 	true				
 de.accept = 	true				
 de-at.accept = true				
 de-ch.accept = true				
 de-de.accept = true				
 de-li.accept = true				
 de-lu.accept = true				
 dv.accept =	false
-dz.accept =	false
+dz.accept =	true
 ee.accept =	false
 el.accept = 	true				
 en.accept = 	true				
 en-au.accept = true				
 en-bz.accept = true				
 en-ca.accept = true				
 en-gb.accept = true				
 en-ie.accept = true				
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -1253,16 +1253,17 @@ pref("font.minimum-size.ja", 0);
 pref("font.minimum-size.x-knda", 0);
 pref("font.minimum-size.x-khmr", 0);
 pref("font.minimum-size.ko", 0);
 pref("font.minimum-size.x-mlym", 0);
 pref("font.minimum-size.x-orya", 0);
 pref("font.minimum-size.x-sinh", 0);
 pref("font.minimum-size.x-tamil", 0);
 pref("font.minimum-size.x-telu", 0);
+pref("font.minimum-size.x-tibt", 0);
 pref("font.minimum-size.th", 0);
 pref("font.minimum-size.tr", 0);
 pref("font.minimum-size.x-cans", 0);
 pref("font.minimum-size.x-western", 0);
 pref("font.minimum-size.x-unicode", 0);
 pref("font.minimum-size.x-user-def", 0);
 
 #ifdef XP_WIN
@@ -1456,16 +1457,23 @@ pref("font.name-list.monospace.x-knda", 
 
 pref("font.name.serif.x-sinh", "Iskoola Pota");
 pref("font.name.sans-serif.x-sinh", "Iskoola Pota");
 pref("font.name.monospace.x-sinh", "Iskoola Pota");
 pref("font.name-list.serif.x-sinh", "Iskoola Pota, AksharUnicode");
 pref("font.name-list.sans-serif.x-sinh", "Iskoola Pota, AksharUnicode");
 pref("font.name-list.monospace.x-sinh", "Iskoola Pota, AksharUnicode");
 
+pref("font.name.serif.x-tibt", "Tibetan Machine Uni");
+pref("font.name.sans-serif.x-tibt", "Tibetan Machine Uni");
+pref("font.name.monospace.x-tibt", "Tibetan Machine Uni");
+pref("font.name-list.serif.x-tibt", "Tibetan Machine Uni, Jomolhari, Microsoft Himalaya");
+pref("font.name-list.sans-serif.x-tibt", "Tibetan Machine Uni, Jomolhari, Microsoft Himalaya");
+pref("font.name-list.monospace.x-tibt", "Tibetan Machine Uni, Jomolhari, Microsoft Himalaya");
+
 pref("font.default.ar", "sans-serif");
 pref("font.size.variable.ar", 16);
 pref("font.size.fixed.ar", 13);
 
 pref("font.default.el", "serif");
 pref("font.size.variable.el", 16);
 pref("font.size.fixed.el", 13);
 
@@ -1557,16 +1565,20 @@ pref("font.size.fixed.x-telu", 13);
 pref("font.default.x-knda", "serif");
 pref("font.size.variable.x-knda", 16);
 pref("font.size.fixed.x-knda", 13);
 
 pref("font.default.x-sinh", "serif");
 pref("font.size.variable.x-sinh", 16);
 pref("font.size.fixed.x-sinh", 13);
 
+pref("font.default.x-tibt", "serif");
+pref("font.size.variable.x-tibt", 16);
+pref("font.size.fixed.x-tibt", 13);
+
 pref("font.default.x-unicode", "serif");
 pref("font.size.variable.x-unicode", 16);
 pref("font.size.fixed.x-unicode", 13);
 
 pref("font.default.x-western", "serif");
 pref("font.size.variable.x-western", 16);
 pref("font.size.fixed.x-western", 13);
 
@@ -1875,16 +1887,24 @@ pref("font.name-list.monospace.x-knda", 
 
 pref("font.name.serif.x-tamil", "InaiMathi");
 pref("font.name.sans-serif.x-tamil", "InaiMathi");
 pref("font.name.monospace.x-tamil", "InaiMathi");
 pref("font.name-list.serif.x-tamil", "InaiMathi");
 pref("font.name-list.sans-serif.x-tamil", "InaiMathi");
 pref("font.name-list.monospace.x-tamil", "InaiMathi");
 
+// Kailasa ships with mac os x >= 10.5
+pref("font.name.serif.x-tibt", "Kailasa");
+pref("font.name.sans-serif.x-tibt", "Kailasa");
+pref("font.name.monospace.x-tibt", "Kailasa");
+pref("font.name-list.serif.x-tibt", "Kailasa");
+pref("font.name-list.sans-serif.x-tibt", "Kailasa");
+pref("font.name-list.monospace.x-tibt", "Kailasa");
+
 pref("font.name.serif.x-unicode", "Times");
 pref("font.name.sans-serif.x-unicode", "Helvetica");
 pref("font.name.monospace.x-unicode", "Courier");
 pref("font.name.cursive.x-unicode", "Apple Chancery");
 pref("font.name.fantasy.x-unicode", "Papyrus");
 pref("font.name-list.serif.x-unicode", "Times");
 pref("font.name-list.sans-serif.x-unicode", "Helvetica");
 pref("font.name-list.monospace.x-unicode", "Courier");
@@ -2019,16 +2039,20 @@ pref("font.size.fixed.x-telu", 13);
 pref("font.default.x-knda", "serif");
 pref("font.size.variable.x-knda", 16);
 pref("font.size.fixed.x-knda", 13);
 
 pref("font.default.x-sinh", "serif");
 pref("font.size.variable.x-sinh", 16);
 pref("font.size.fixed.x-sinh", 13);
 
+pref("font.default.x-tibt", "serif");
+pref("font.size.variable.x-tibt", 16);
+pref("font.size.fixed.x-tibt", 13);
+
 pref("font.default.x-unicode", "serif");
 pref("font.size.variable.x-unicode", 16);
 pref("font.size.fixed.x-unicode", 13);
 
 pref("font.default.x-western", "serif");
 pref("font.size.variable.x-western", 16);
 pref("font.size.fixed.x-western", 13);
 
@@ -2631,16 +2655,20 @@ pref("font.size.fixed.x-telu", 13);
 pref("font.default.x-knda", "serif");
 pref("font.size.variable.x-knda", 16);
 pref("font.size.fixed.x-knda", 13);
 
 pref("font.default.x-sinh", "serif");
 pref("font.size.variable.x-sinh", 16);
 pref("font.size.fixed.x-sinh", 13);
 
+pref("font.default.x-tibt", "serif");
+pref("font.size.variable.x-tibt", 16);
+pref("font.size.fixed.x-tibt", 13);
+
 /* PostScript print module prefs */
 // pref("print.postscript.enabled",      true);
 pref("print.postscript.paper_size",    "letter");
 pref("print.postscript.orientation",   "portrait");
 pref("print.postscript.print_command", "lpr ${MOZ_PRINTER_NAME:+-P\"$MOZ_PRINTER_NAME\"}");
 
 // On GTK2 platform, we should use topmost window level for the default window
 // level of <panel> element of XUL. GTK2 has only two window types. One is