bug 152264 : add zh-HK langGroup so that fonts can be specified separately for zh-HK and zh-TW langGroups (r=katakai, sr=blizzard). L10N changes included.
git-svn-id: svn://10.0.0.236/trunk@146748 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -182,6 +182,9 @@ static nsFontNodeArray* gGlobalList = nsnull;
|
||||
|
||||
static nsIAtom* gUnicode = nsnull;
|
||||
static nsIAtom* gUserDefined = nsnull;
|
||||
static nsIAtom* gZHTW = nsnull;
|
||||
static nsIAtom* gZHHK = nsnull;
|
||||
static nsIAtom* gZHTWHK = nsnull; // for fonts common to zh-TW and zh-HK
|
||||
static nsIAtom* gUsersLocale = nsnull;
|
||||
static nsIAtom* gWesternLocale = nsnull;
|
||||
|
||||
@@ -303,6 +306,11 @@ static nsFontCharSetInfo ISO885911 =
|
||||
static nsFontCharSetInfo Big5 =
|
||||
{ "x-x-big5", DoubleByteConvert, 1,
|
||||
TT_OS2_CPR1_CHINESE_TRAD, 0 };
|
||||
// a kludge to distinguish zh-TW only fonts in Big5 (such as hpbig5-)
|
||||
// from zh-TW/zh-HK common fonts in Big5 (such as big5-1)
|
||||
static nsFontCharSetInfo Big5TWHK =
|
||||
{ "x-x-big5", DoubleByteConvert, 1,
|
||||
TT_OS2_CPR1_CHINESE_TRAD, 0 };
|
||||
static nsFontCharSetInfo CNS116431 =
|
||||
{ "x-cns-11643-1", DoubleByteConvert, 1,
|
||||
TT_OS2_CPR1_CHINESE_TRAD, 0 };
|
||||
@@ -409,6 +417,8 @@ static nsFontLangGroup FLG_ARABIC = { "ar", nsnull };
|
||||
static nsFontLangGroup FLG_THAI = { "th", nsnull };
|
||||
static nsFontLangGroup FLG_ZHCN = { "zh-CN", nsnull };
|
||||
static nsFontLangGroup FLG_ZHTW = { "zh-TW", nsnull };
|
||||
static nsFontLangGroup FLG_ZHHK = { "zh-HK", nsnull };
|
||||
static nsFontLangGroup FLG_ZHTWHK = { "x-zh-TWHK", nsnull }; // TW + HK
|
||||
static nsFontLangGroup FLG_JA = { "ja", nsnull };
|
||||
static nsFontLangGroup FLG_KO = { "ko", nsnull };
|
||||
#ifdef SUNCTL
|
||||
@@ -449,8 +459,15 @@ static nsFontCharSetMap gCharSetMap[] =
|
||||
{ "-ibm pc", &FLG_NONE, &Unknown },
|
||||
{ "adobe-fontspecific", &FLG_NONE, &Special },
|
||||
{ "ansi-1251", &FLG_RUSSIAN, &CP1251 },
|
||||
{ "big5-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5-1", &FLG_ZHTW, &Big5 },
|
||||
// On Solaris, big5-0 is used for ASCII-only fonts while in XFree86,
|
||||
// it's for Big5 fonts without US-ASCII. When a non-Solaris binary
|
||||
// is displayed on a Solaris X server, this would break.
|
||||
#ifndef SOLARIS
|
||||
{ "big5-0", &FLG_ZHTWHK, &Big5TWHK }, // for both TW and HK
|
||||
#else
|
||||
{ "big5-0", &FLG_ZHTW, &USASCII },
|
||||
#endif
|
||||
{ "big5-1", &FLG_ZHTWHK, &Big5TWHK }, // ditto
|
||||
{ "big5.et-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.et.ext-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.etext-0", &FLG_ZHTW, &Big5 },
|
||||
@@ -458,7 +475,7 @@ static nsFontCharSetMap gCharSetMap[] =
|
||||
{ "big5.hku-1", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.pc-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.shift-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5hkscs-0", &FLG_ZHTW, &HKSCS },
|
||||
{ "big5hkscs-0", &FLG_ZHHK, &HKSCS },
|
||||
{ "cns11643.1986-1", &FLG_ZHTW, &CNS116431 },
|
||||
{ "cns11643.1986-2", &FLG_ZHTW, &CNS116432 },
|
||||
{ "cns11643.1992-1", &FLG_ZHTW, &CNS116431 },
|
||||
@@ -494,7 +511,7 @@ static nsFontCharSetMap gCharSetMap[] =
|
||||
{ "gb18030.2000-1", &FLG_ZHCN, &GB18030_1 },
|
||||
{ "gbk-0", &FLG_ZHCN, &GBK },
|
||||
{ "gbk1988.1989-0", &FLG_ZHCN, &USASCII },
|
||||
{ "hkscs-1", &FLG_ZHTW, &HKSCS },
|
||||
{ "hkscs-1", &FLG_ZHHK, &HKSCS },
|
||||
{ "hp-japanese15", &FLG_NONE, &Unknown },
|
||||
{ "hp-japaneseeuc", &FLG_NONE, &Unknown },
|
||||
{ "hp-roman8", &FLG_NONE, &Unknown },
|
||||
@@ -503,6 +520,7 @@ static nsFontCharSetMap gCharSetMap[] =
|
||||
{ "hp-tchinesebig5", &FLG_ZHTW, &Big5 },
|
||||
{ "hp-wa", &FLG_NONE, &Unknown },
|
||||
{ "hpbig5-", &FLG_ZHTW, &Big5 },
|
||||
{ "hphkbig5-", &FLG_ZHHK, &HKSCS },
|
||||
{ "hproc16-", &FLG_NONE, &Unknown },
|
||||
{ "ibm-1252", &FLG_NONE, &Unknown },
|
||||
{ "ibm-850", &FLG_NONE, &Unknown },
|
||||
@@ -844,6 +862,9 @@ FreeGlobals(void)
|
||||
}
|
||||
NS_IF_RELEASE(gUnicode);
|
||||
NS_IF_RELEASE(gUserDefined);
|
||||
NS_IF_RELEASE(gZHTW);
|
||||
NS_IF_RELEASE(gZHHK);
|
||||
NS_IF_RELEASE(gZHTWHK);
|
||||
NS_IF_RELEASE(gUserDefinedConverter);
|
||||
NS_IF_RELEASE(gUsersLocale);
|
||||
NS_IF_RELEASE(gWesternLocale);
|
||||
@@ -1091,6 +1112,21 @@ InitGlobals(nsIDeviceContext *aDevice)
|
||||
FreeGlobals();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
gZHTW = NS_NewAtom("zh-TW");
|
||||
if (!gZHTW) {
|
||||
FreeGlobals();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
gZHHK = NS_NewAtom("zh-HK");
|
||||
if (!gZHHK) {
|
||||
FreeGlobals();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
gZHTWHK = NS_NewAtom("x-zh-TWHK");
|
||||
if (!gZHTWHK) {
|
||||
FreeGlobals();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// the user's locale
|
||||
nsCOMPtr<nsILanguageAtomService> langService;
|
||||
@@ -4881,7 +4917,17 @@ SetFontLangGroupInfo(nsFontCharSetMap* aCharSetMap)
|
||||
if (!langGroup)
|
||||
langGroup = "";
|
||||
if (!fontLangGroup->mFontLangGroupAtom) {
|
||||
fontLangGroup->mFontLangGroupAtom = NS_NewAtom(langGroup);
|
||||
fontLangGroup->mFontLangGroupAtom = NS_NewAtom(langGroup);
|
||||
}
|
||||
|
||||
// hack : map 'x-zh-TWHK' to 'zh-TW' when retrieving font scaling-control
|
||||
// preferences via |Get*Pref|.
|
||||
// XXX : This would make the font scaling controls for
|
||||
// zh-HK NOT work if a font common to zh-TW and zh-HK (e.g. big5-0)
|
||||
// were chosen for zh-HK. An alternative would be to make it
|
||||
// locale-dependent. Even with that, it'd work only under zh-HK locale.
|
||||
if (fontLangGroup->mFontLangGroupAtom == gZHTWHK) {
|
||||
langGroup = "zh-TW";
|
||||
}
|
||||
|
||||
// get the font scaling controls
|
||||
@@ -6192,9 +6238,9 @@ nsFontMetricsGTK::FindLangGroupFont(nsIAtom* aLangGroup, PRUint32 aChar, nsCStri
|
||||
// scan gCharSetMap for encodings with matching lang groups
|
||||
nsFontCharSetMap* charSetMap;
|
||||
for (charSetMap=gCharSetMap; charSetMap->mName; charSetMap++) {
|
||||
nsFontLangGroup* mFontLangGroup = charSetMap->mFontLangGroup;
|
||||
nsFontLangGroup* fontLangGroup = charSetMap->mFontLangGroup;
|
||||
|
||||
if ((!mFontLangGroup) || (!mFontLangGroup->mFontLangGroupName)) {
|
||||
if ((!fontLangGroup) || (!fontLangGroup->mFontLangGroupName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -6202,12 +6248,17 @@ nsFontMetricsGTK::FindLangGroupFont(nsIAtom* aLangGroup, PRUint32 aChar, nsCStri
|
||||
SetCharsetLangGroup(charSetMap->mInfo);
|
||||
}
|
||||
|
||||
if (!mFontLangGroup->mFontLangGroupAtom) {
|
||||
if (!fontLangGroup->mFontLangGroupAtom) {
|
||||
SetFontLangGroupInfo(charSetMap);
|
||||
}
|
||||
|
||||
if ((aLangGroup != mFontLangGroup->mFontLangGroupAtom)
|
||||
&& (aLangGroup != charSetMap->mInfo->mLangGroup)) {
|
||||
// if font's langGroup is different from requested langGroup, continue.
|
||||
// An exception is that font's langGroup ZHTWHK is regarded as matching
|
||||
// both ZHTW and ZHHK (Freetype2 and Solaris).
|
||||
if ((aLangGroup != fontLangGroup->mFontLangGroupAtom) &&
|
||||
(aLangGroup != charSetMap->mInfo->mLangGroup) &&
|
||||
(fontLangGroup->mFontLangGroupAtom != gZHTWHK ||
|
||||
(aLangGroup != gZHHK && aLangGroup != gZHTW))) {
|
||||
continue;
|
||||
}
|
||||
// look for a font with this charset (registry-encoding) & char
|
||||
@@ -6329,7 +6380,12 @@ EnumerateNode(void* aElement, void* aData)
|
||||
return PR_TRUE; // continue
|
||||
}
|
||||
else if (info->mLangGroup != gUnicode) {
|
||||
if (node->mCharSetInfo->mLangGroup != info->mLangGroup) {
|
||||
// if font's langGroup is different from requested langGroup, continue.
|
||||
// An exception is that font's langGroup ZHTWHK is regarded as matching
|
||||
// both ZHTW and ZHHK (Freetype2 and Solaris).
|
||||
if (node->mCharSetInfo->mLangGroup != info->mLangGroup &&
|
||||
(node->mCharSetInfo->mLangGroup != gZHTWHK ||
|
||||
(info->mLangGroup != gZHHK && info->mLangGroup != gZHTW))) {
|
||||
return PR_TRUE; // continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ void nsUnicodeFontMappingMac::InitByLangGroup(const nsString& aLangGroup)
|
||||
} else if(gUtil->ScriptEnabled(smKorean) && aLangGroup.EqualsIgnoreCase("ko"))
|
||||
{
|
||||
FillVarBlockToScript(smKorean, mPrivBlockToScript);
|
||||
} else if(gUtil->ScriptEnabled(smTradChinese) && aLangGroup.EqualsIgnoreCase("zh-TW"))
|
||||
} else if((gUtil->ScriptEnabled(smTradChinese)) && ((aLangGroup.EqualsIgnoreCase("zh-TW")) || (aLangGroup.EqualsIgnoreCase("zh-HK"))))
|
||||
{
|
||||
FillVarBlockToScript(smTradChinese, mPrivBlockToScript);
|
||||
} else if(gUtil->ScriptEnabled(smJapanese) && aLangGroup.EqualsIgnoreCase("ja"))
|
||||
|
||||
@@ -275,6 +275,10 @@ ScriptCode nsUnicodeMappingUtil::MapLangGroupToScriptCode(const char* aLangGroup
|
||||
if(0==nsCRT::strcmp(aLangGroup, "zh-TW")) {
|
||||
return smTradChinese;
|
||||
} else
|
||||
// No separate script code for zh-HK. Use smTradChinese.
|
||||
if(0==nsCRT::strcmp(aLangGroup, "zh-HK")) {
|
||||
return smTradChinese;
|
||||
} else
|
||||
if(0==nsCRT::strcmp(aLangGroup, "x-unicode")) {
|
||||
return (smPseudoUnicode);
|
||||
} else
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
* Contributor(s):
|
||||
* Roger B. Sidje <rbs@maths.uq.edu.au>
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
* Jungshik Shin <jshin@mailaps.org>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
@@ -154,6 +155,7 @@ static nsIAtom* gJA = nsnull;
|
||||
static nsIAtom* gKO = nsnull;
|
||||
static nsIAtom* gZHTW = nsnull;
|
||||
static nsIAtom* gZHCN = nsnull;
|
||||
static nsIAtom* gZHHK = nsnull;
|
||||
|
||||
static int gInitialized = 0;
|
||||
static PRBool gDoingLineheightFixup = PR_FALSE;
|
||||
@@ -197,6 +199,7 @@ FreeGlobals(void)
|
||||
NS_IF_RELEASE(gKO);
|
||||
NS_IF_RELEASE(gZHTW);
|
||||
NS_IF_RELEASE(gZHCN);
|
||||
NS_IF_RELEASE(gZHHK);
|
||||
|
||||
// free CMap
|
||||
if (nsFontMetricsWin::gFontMaps) {
|
||||
@@ -336,6 +339,11 @@ InitGlobals(void)
|
||||
FreeGlobals();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
gZHHK = NS_NewAtom("zh-HK");
|
||||
if (!gZHHK) {
|
||||
FreeGlobals();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
//register an observer to take care of cleanup
|
||||
gFontCleanupObserver = new nsFontCleanupObserver();
|
||||
@@ -443,6 +451,7 @@ nsFontMetricsWin::Init(const nsFont& aFont, nsIAtom* aLangGroup,
|
||||
CheckFontLangGroup(mLangGroup, gKO, "ko");
|
||||
CheckFontLangGroup(mLangGroup, gZHTW, "zh-TW");
|
||||
CheckFontLangGroup(mLangGroup, gZHCN, "zh-CN");
|
||||
CheckFontLangGroup(mLangGroup, gZHHK, "zh-HK");
|
||||
}
|
||||
|
||||
//don't addref this to avoid circular refs
|
||||
@@ -3348,7 +3357,8 @@ nsFontMetricsWin::FindGenericFont(HDC aDC, PRUint32 aChar)
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
#define IsCJKLangGroupAtom(a) ((a)==gJA || (a)==gKO || (a)==gZHCN || (a)==gZHTW)
|
||||
#define IsCJKLangGroupAtom(a) ((a)==gJA || (a)==gKO || (a)==gZHCN || \
|
||||
(a)==gZHTW || (a) == gZHHK)
|
||||
|
||||
nsFontWin*
|
||||
nsFontMetricsWin::FindPrefFont(HDC aDC, PRUint32 aChar)
|
||||
@@ -3412,6 +3422,9 @@ nsFontMetricsWin::FindPrefFont(HDC aDC, PRUint32 aChar)
|
||||
if (mLangGroup != gZHTW && gUsersLocale != gZHTW && gSystemLocale != gZHTW)
|
||||
AppendGenericFontFromPref(font.name, "zh-TW",
|
||||
NS_ConvertUCS2toUTF8(mGeneric).get());
|
||||
if (mLangGroup != gZHHK && gUsersLocale != gZHHK && gSystemLocale != gZHHK)
|
||||
AppendGenericFontFromPref(font.name, "zh-HK",
|
||||
NS_ConvertUCS2toUTF8(mGeneric).get());
|
||||
if (mLangGroup != gKO && gUsersLocale != gKO && gSystemLocale != gKO)
|
||||
AppendGenericFontFromPref(font.name, "ko",
|
||||
NS_ConvertUCS2toUTF8(mGeneric).get());
|
||||
@@ -5321,6 +5334,10 @@ SignatureMatchesLangGroup(FONTSIGNATURE* aSignature,
|
||||
{
|
||||
int dword;
|
||||
|
||||
// hack : FONTSIGNATURE in Win32 doesn't have a separate signature field
|
||||
// for zh-HK. We have to treat it as zh-TW.
|
||||
const char *langGroup = strcmp(aLangGroup, "zh-HK") ? aLangGroup : "zh-TW";
|
||||
|
||||
// For scripts that have been supported by 'ANSI' codepage in Win9x/ME,
|
||||
// we can rely on fsCsb.
|
||||
DWORD* array = aSignature->fsCsb;
|
||||
@@ -5329,7 +5346,7 @@ SignatureMatchesLangGroup(FONTSIGNATURE* aSignature,
|
||||
for (int bit = 0; bit < sizeof(DWORD) * 8; ++bit) {
|
||||
if ((array[dword] >> bit) & 1) {
|
||||
if (!strcmp(gCharsetInfo[gCharsetToIndex[gBitToCharset[i]]].mLangGroup,
|
||||
aLangGroup)) {
|
||||
langGroup)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -5345,7 +5362,7 @@ SignatureMatchesLangGroup(FONTSIGNATURE* aSignature,
|
||||
// x-western .. zh-TW. (exclude JOHAB)
|
||||
for (i = eCharset_ANSI; i <= eCharset_CHINESEBIG5; ++i)
|
||||
{
|
||||
if (!strcmp(gCharsetInfo[i].mLangGroup, aLangGroup))
|
||||
if (!strcmp(gCharsetInfo[i].mLangGroup, langGroup))
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5359,7 +5376,7 @@ SignatureMatchesLangGroup(FONTSIGNATURE* aSignature,
|
||||
if ((array[dword] >> bit) & 1) {
|
||||
PRUint8 range = gBitToUnicodeRange[i];
|
||||
if (kRangeSpecificItemNum > range &&
|
||||
!strcmp(gUnicodeRangeToLangGroupTable[range], aLangGroup)) {
|
||||
!strcmp(gUnicodeRangeToLangGroupTable[range], langGroup)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,6 +177,9 @@ public:
|
||||
|
||||
nsCOMPtr<nsIAtom> mUnicode;
|
||||
nsCOMPtr<nsIAtom> mUserDefined;
|
||||
nsCOMPtr<nsIAtom> mZHTW;
|
||||
nsCOMPtr<nsIAtom> mZHHK;
|
||||
nsCOMPtr<nsIAtom> mZHTWHK; // common to TW and HK
|
||||
nsCOMPtr<nsIAtom> mUsersLocale;
|
||||
nsCOMPtr<nsIAtom> mWesternLocale;
|
||||
|
||||
@@ -368,6 +371,11 @@ static nsFontCharSetInfoXlib ISO885911 =
|
||||
static nsFontCharSetInfoXlib Big5 =
|
||||
{ "x-x-big5", DoubleByteConvert, 1,
|
||||
TT_OS2_CPR1_CHINESE_TRAD, 0 };
|
||||
// a kludge to distinguish zh-TW only fonts in Big5 (such as hpbig5-)
|
||||
// from zh-TW/zh-HK common fonts in Big5 (such as big5-0, big5-1)
|
||||
static nsFontCharSetInfoXlib Big5TWHK =
|
||||
{ "x-x-big5", DoubleByteConvert, 1,
|
||||
TT_OS2_CPR1_CHINESE_TRAD, 0 };
|
||||
static nsFontCharSetInfoXlib CNS116431 =
|
||||
{ "x-cns-11643-1", DoubleByteConvert, 1,
|
||||
TT_OS2_CPR1_CHINESE_TRAD, 0 };
|
||||
@@ -474,6 +482,8 @@ static nsFontLangGroupXlib FLG_ARABIC = { "ar", nsnull };
|
||||
static nsFontLangGroupXlib FLG_THAI = { "th", nsnull };
|
||||
static nsFontLangGroupXlib FLG_ZHCN = { "zh-CN", nsnull };
|
||||
static nsFontLangGroupXlib FLG_ZHTW = { "zh-TW", nsnull };
|
||||
static nsFontLangGroupXlib FLG_ZHHK = { "zh-HK", nsnull };
|
||||
static nsFontLangGroupXlib FLG_ZHTWHK = { "x-zh-TWHK", nsnull };
|
||||
static nsFontLangGroupXlib FLG_JA = { "ja", nsnull };
|
||||
static nsFontLangGroupXlib FLG_KO = { "ko", nsnull };
|
||||
#ifdef SUNCTL
|
||||
@@ -514,8 +524,15 @@ static const nsFontCharSetMapXlib gConstCharSetMap[] =
|
||||
{ "-ibm pc", &FLG_NONE, &Unknown },
|
||||
{ "adobe-fontspecific", &FLG_NONE, &Special },
|
||||
{ "ansi-1251", &FLG_RUSSIAN, &CP1251 },
|
||||
{ "big5-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5-1", &FLG_ZHTW, &Big5 },
|
||||
// On Solaris, big5-0 is used for ASCII-only fonts while in XFree86,
|
||||
// it's for Big5 fonts without US-ASCII. When a non-Solaris binary
|
||||
// is displayed on a Solaris X server, this would break.
|
||||
#ifndef SOLARIS
|
||||
{ "big5-0", &FLG_ZHTWHK, &Big5TWHK }, // common to TW/HK
|
||||
#else
|
||||
{ "big5-0", &FLG_ZHTW, &USASCII },
|
||||
#endif
|
||||
{ "big5-1", &FLG_ZHTWHK, &Big5TWHK }, // ditto
|
||||
{ "big5.et-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.et.ext-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.etext-0", &FLG_ZHTW, &Big5 },
|
||||
@@ -523,7 +540,7 @@ static const nsFontCharSetMapXlib gConstCharSetMap[] =
|
||||
{ "big5.hku-1", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.pc-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5.shift-0", &FLG_ZHTW, &Big5 },
|
||||
{ "big5hkscs-0", &FLG_ZHTW, &HKSCS },
|
||||
{ "big5hkscs-0", &FLG_ZHHK, &HKSCS },
|
||||
{ "cns11643.1986-1", &FLG_ZHTW, &CNS116431 },
|
||||
{ "cns11643.1986-2", &FLG_ZHTW, &CNS116432 },
|
||||
{ "cns11643.1992-1", &FLG_ZHTW, &CNS116431 },
|
||||
@@ -559,7 +576,7 @@ static const nsFontCharSetMapXlib gConstCharSetMap[] =
|
||||
{ "gb18030.2000-1", &FLG_ZHCN, &GB18030_1 },
|
||||
{ "gbk-0", &FLG_ZHCN, &GBK },
|
||||
{ "gbk1988.1989-0", &FLG_ZHCN, &USASCII },
|
||||
{ "hkscs-1", &FLG_ZHTW, &HKSCS },
|
||||
{ "hkscs-1", &FLG_ZHHK, &HKSCS },
|
||||
{ "hp-japanese15", &FLG_NONE, &Unknown },
|
||||
{ "hp-japaneseeuc", &FLG_NONE, &Unknown },
|
||||
{ "hp-roman8", &FLG_NONE, &Unknown },
|
||||
@@ -568,6 +585,7 @@ static const nsFontCharSetMapXlib gConstCharSetMap[] =
|
||||
{ "hp-tchinesebig5", &FLG_ZHTW, &Big5 },
|
||||
{ "hp-wa", &FLG_NONE, &Unknown },
|
||||
{ "hpbig5-", &FLG_ZHTW, &Big5 },
|
||||
{ "hphkbig5-", &FLG_ZHHK, &HKSCS },
|
||||
{ "hproc16-", &FLG_NONE, &Unknown },
|
||||
{ "ibm-1252", &FLG_NONE, &Unknown },
|
||||
{ "ibm-850", &FLG_NONE, &Unknown },
|
||||
@@ -1442,6 +1460,18 @@ nsFontMetricsXlibContext::Init(nsIDeviceContext *aDevice, PRBool aPrintermode)
|
||||
if (!mUserDefined) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mZHTW = NS_NewAtom("zh-TW");
|
||||
if (!mZHTW) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mZHHK = NS_NewAtom("zh-HK");
|
||||
if (!mZHHK) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
mZHTWHK = NS_NewAtom("x-zh-TWHK");
|
||||
if (!mZHTWHK) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// the user's locale
|
||||
nsCOMPtr<nsILanguageAtomService> langService;
|
||||
@@ -4169,6 +4199,11 @@ SetFontLangGroupInfo(nsFontMetricsXlibContext *aFmctx, const nsFontCharSetMapXli
|
||||
fontLangGroup->mFontLangGroupAtom = NS_NewAtom(langGroup);
|
||||
}
|
||||
|
||||
// hack : map 'x-zh-TWHK' to 'zh-TW'. See nsFontMetricsGTK.cpp for details.
|
||||
if (fontLangGroup->mFontLangGroupAtom == aFmctx->mZHTWHK) {
|
||||
langGroup = "zh-TW";
|
||||
}
|
||||
|
||||
// get the font scaling controls
|
||||
nsFontCharSetInfoXlib *charSetInfo = aCharSetMap->mInfo;
|
||||
if (!charSetInfo->mInitedSizeInfo) {
|
||||
@@ -5527,9 +5562,9 @@ nsFontMetricsXlib::FindLangGroupFont(nsIAtom* aLangGroup, PRUnichar aChar, nsCSt
|
||||
// scan mCharSetMap for encodings with matching lang groups
|
||||
const nsFontCharSetMapXlib* charSetMap;
|
||||
for (charSetMap=mFontMetricsContext->mCharSetMap; charSetMap->mName; charSetMap++) {
|
||||
nsFontLangGroupXlib* mFontLangGroup = charSetMap->mFontLangGroup;
|
||||
nsFontLangGroupXlib* fontLangGroup = charSetMap->mFontLangGroup;
|
||||
|
||||
if ((!mFontLangGroup) || (!mFontLangGroup->mFontLangGroupName)) {
|
||||
if ((!fontLangGroup) || (!fontLangGroup->mFontLangGroupName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -5537,12 +5572,17 @@ nsFontMetricsXlib::FindLangGroupFont(nsIAtom* aLangGroup, PRUnichar aChar, nsCSt
|
||||
SetCharsetLangGroup(mFontMetricsContext, charSetMap->mInfo);
|
||||
}
|
||||
|
||||
if (!mFontLangGroup->mFontLangGroupAtom) {
|
||||
if (!fontLangGroup->mFontLangGroupAtom) {
|
||||
SetFontLangGroupInfo(mFontMetricsContext, charSetMap);
|
||||
}
|
||||
|
||||
if ((aLangGroup != mFontLangGroup->mFontLangGroupAtom)
|
||||
&& (aLangGroup != charSetMap->mInfo->mLangGroup)) {
|
||||
// if font's langGroup is different from requested langGroup, continue.
|
||||
// An exception is that font's langGroup ZHTWHK is regarded as matching
|
||||
// both ZHTW and ZHHK (Freetype2 and Solaris).
|
||||
if ((aLangGroup != fontLangGroup->mFontLangGroupAtom) &&
|
||||
(aLangGroup != charSetMap->mInfo->mLangGroup) &&
|
||||
(fontLangGroup->mFontLangGroupAtom != mFontMetricsContext->mZHTWHK ||
|
||||
(aLangGroup != mFontMetricsContext->mZHHK && aLangGroup != mFontMetricsContext->mZHTW))) {
|
||||
continue;
|
||||
}
|
||||
// look for a font with this charset (registry-encoding) & char
|
||||
@@ -5666,7 +5706,13 @@ EnumerateNode(void* aElement, void* aData)
|
||||
return PR_TRUE; // continue
|
||||
}
|
||||
else if (info->mLangGroup != aFmctx->mUnicode) {
|
||||
if (node->mCharSetInfo->mLangGroup != info->mLangGroup) {
|
||||
// if font's langGroup is different from requested langGroup, continue.
|
||||
// An exception is that font's langGroup ZHTWHK(big5-1, big5-0) matches
|
||||
// both ZHTW and ZHHK (Freetype2 and Solaris).
|
||||
if (node->mCharSetInfo->mLangGroup != info->mLangGroup &&
|
||||
(node->mCharSetInfo->mLangGroup != aFmctx->mZHTWHK ||
|
||||
(info->mLangGroup != aFmctx->mZHHK &&
|
||||
info->mLangGroup != aFmctx->mZHTW))) {
|
||||
return PR_TRUE; // continue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,15 +56,12 @@ sq=x-western
|
||||
sr=x-cyrillic
|
||||
sv=x-western
|
||||
ta=x-tamil
|
||||
# to be remapped to x-tamil when bug 204586 is resolved and fontconfig
|
||||
# with the revised ta.orth file is widely deployed (fontconfig bug #84)
|
||||
#ta=x-unicode
|
||||
th=th
|
||||
tr=tr
|
||||
uk=x-cyrillic
|
||||
zh-cn=zh-CN
|
||||
zh-tw=zh-TW
|
||||
zh-hk=zh-TW
|
||||
zh-hk=zh-HK
|
||||
zh=zh-CN
|
||||
#
|
||||
#==============================
|
||||
|
||||
@@ -78,14 +78,14 @@ x-johab.notForOutgoing = true
|
||||
|
||||
adobe-symbol-encoding.LangGroup = el
|
||||
big5.LangGroup = zh-TW
|
||||
big5-hkscs.LangGroup = zh-TW
|
||||
big5-hkscs.LangGroup = zh-HK
|
||||
euc-jp.LangGroup = ja
|
||||
euc-kr.LangGroup = ko
|
||||
gb2312.LangGroup = zh-CN
|
||||
gb18030.LangGroup = zh-CN
|
||||
gb18030.2000-0.LangGroup = zh-CN
|
||||
gb18030.2000-1.LangGroup = zh-CN
|
||||
hkscs-1.LangGroup = zh-TW
|
||||
hkscs-1.LangGroup = zh-HK
|
||||
hz-gb-2312.LangGroup = zh-CN
|
||||
ibm850.LangGroup = x-western
|
||||
ibm852.LangGroup = x-central-euro
|
||||
|
||||
@@ -82,3 +82,6 @@ pref("font.size.fixed.zh-CN", 16);
|
||||
pref("font.size.variable.zh-TW", 16);
|
||||
pref("font.size.fixed.zh-TW", 16);
|
||||
|
||||
pref("font.size.variable.zh-HK", 16);
|
||||
pref("font.size.fixed.zh-HK", 16);
|
||||
|
||||
|
||||
@@ -134,6 +134,16 @@ pref("font.name.monospace.zh-TW", "Apple LiGothic Medium");
|
||||
pref("font.name.cursive.zh-TW", "XXX.cursive");
|
||||
pref("font.name.fantasy.zh-TW", "XXX.fantasy");
|
||||
|
||||
// ming_uni.ttf (HKSCS-2001)
|
||||
// http://www.info.gov.hk/digital21/eng/hkscs/download/uime.exe
|
||||
// use Stuffit Expander to unzip it and install ming_uni.ttf
|
||||
pref("font.name.serif.zh-HK", "Ming(for ISO10646)");
|
||||
pref("font.name.sans-serif.zh-HK", "Apple LiGothic Medium");
|
||||
pref("font.name.monospace.zh-HK", "Apple LiGothic Medium");
|
||||
pref("font.name.cursive.zh-HK", "XXX.cursive");
|
||||
pref("font.name.fantasy.zh-HK", "XXX.fantasy");
|
||||
|
||||
pref("font.default", "serif");
|
||||
pref("font.default", "serif");
|
||||
pref("font.size.variable.ar", 16);
|
||||
pref("font.size.fixed.ar", 13);
|
||||
@@ -177,6 +187,9 @@ pref("font.size.fixed.zh-CN", 16);
|
||||
pref("font.size.variable.zh-TW", 15);
|
||||
pref("font.size.fixed.zh-TW", 16);
|
||||
|
||||
pref("font.size.variable.zh-HK", 15);
|
||||
pref("font.size.fixed.zh-HK", 16);
|
||||
|
||||
pref("browser.urlbar.clickAtEndSelects", false);
|
||||
|
||||
// Tab focus model bit field:
|
||||
|
||||
@@ -109,6 +109,12 @@ pref("font.name-list.serif.zh-TW", "Times New Roman WT TC, Times New Roman MT 30
|
||||
pref("font.name.sans-serif.zh-TW", "Helv");
|
||||
pref("font.name.monospace.zh-TW", "Courier");
|
||||
|
||||
// XXX : just copied values for zh-TW. TO CHANGE if necessary
|
||||
pref("font.name.serif.zh-HK", "Times New Roman WT TC");
|
||||
pref("font.name-list.serif.zh-HK", "Times New Roman WT TC, Times New Roman MT 30, Tms Rmn");
|
||||
pref("font.name.sans-serif.zh-HK", "Helv");
|
||||
pref("font.name.monospace.zh-HK", "Courier");
|
||||
|
||||
pref("font.default", "serif");
|
||||
pref("font.size.variable.ar", 16);
|
||||
pref("font.size.fixed.ar", 13);
|
||||
@@ -152,6 +158,9 @@ pref("font.size.fixed.zh-CN", 16);
|
||||
pref("font.size.variable.zh-TW", 16);
|
||||
pref("font.size.fixed.zh-TW", 16);
|
||||
|
||||
pref("font.size.variable.zh-HK", 16);
|
||||
pref("font.size.fixed.zh-HK", 16);
|
||||
|
||||
pref("font.size.nav4rounding", false);
|
||||
|
||||
pref("netinst.profile.show_profile_wizard", true);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*
|
||||
* Contributor(s):
|
||||
* Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
|
||||
* Jungshik Shin <jshin@mailaps.org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@@ -184,6 +185,12 @@ pref("font.name.serif.zh-CN", "isas-song ti-gb2312.1980-0");
|
||||
pref("font.name.sans-serif.zh-CN", "isas-song ti-gb2312.1980-0");
|
||||
pref("font.name.monospace.zh-CN", "isas-song ti-gb2312.1980-0");
|
||||
|
||||
// ming_uni.ttf (HKSCS-2001)
|
||||
// http://www.info.gov.hk/digital21/eng/hkscs/download/uime.exe
|
||||
pref("font.name.serif.zh-HK", "-arphic-Ming for ISO10646-big5hkscs-0");
|
||||
pref("font.name.sans-serif.zh-HK", "-arphic-Ming for ISO10646-big5hkscs-0");
|
||||
pref("font.name.monospace.zh-HK", "-arphic-Ming for ISO10646-big5hkscs-0");
|
||||
|
||||
// zh-TW
|
||||
|
||||
pref("font.default", "serif");
|
||||
@@ -229,6 +236,9 @@ pref("font.size.fixed.zh-CN", 16);
|
||||
pref("font.size.variable.zh-TW", 16);
|
||||
pref("font.size.fixed.zh-TW", 16);
|
||||
|
||||
pref("font.size.variable.zh-HK", 16);
|
||||
pref("font.size.fixed.zh-HK", 16);
|
||||
|
||||
// below a certian pixel size outline scaled fonts produce poor results
|
||||
pref("font.scale.outline.min", 6);
|
||||
|
||||
@@ -248,6 +258,16 @@ pref("font.scale.tt_bitmap.dark_text.gain", "0.8");
|
||||
//pref("font.directory.truetype.1", "/u/sam/tt_font1");
|
||||
//pref("font.directory.truetype.2", "/u/sam/tt_font2");
|
||||
//pref("font.directory.truetype.3", "/u/sam/tt_font3");
|
||||
pref("font.directory.truetype.1", "/home/jungshik/.fonts.ft2");
|
||||
pref("font.directory.truetype.2", "/usr/local/share/fonts/ttf");
|
||||
pref("font.directory.truetype.3", "/home/jungshik/.fonts.ft2/math/MathTTF");
|
||||
pref("font.directory.truetype.4", "/home/jungshik/.fonts.ft2/math");
|
||||
pref("font.directory.truetype.5", "/home/jungshik/.fonts.ft2/math/texcm-ttf");
|
||||
pref("font.directory.truetype.6", "/home/jungshik/.fonts.ft2/tamil");
|
||||
pref("font.directory.truetype.7", "/usr/share/fonts/TIS-620/TrueType");
|
||||
pref("font.directory.truetype.8", "/home/jungshik/.fonts.ft2/Indic");
|
||||
pref("font.directory.truetype.9", "/home/jungshik/.fonts.ft2/symbol");
|
||||
pref("font.directory.truetype.10", "/home/jungshik/.fonts.ft2/zh");
|
||||
pref("font.FreeType2.printing", true);
|
||||
|
||||
// below a certian pixel size anti-aliased bitmat scaled fonts
|
||||
@@ -294,6 +314,13 @@ pref("font.scale.bitmap.min.zh-TW", 16);
|
||||
pref("font.scale.bitmap.undersize.zh-TW", 80);
|
||||
pref("font.scale.bitmap.oversize.zh-TW", 120);
|
||||
|
||||
pref("font.scale.outline.min.zh-HK", 10);
|
||||
pref("font.scale.aa_bitmap.min.zh-HK", 12);
|
||||
pref("font.scale.aa_bitmap.always.zh-HK", false);
|
||||
pref("font.scale.bitmap.min.zh-HK", 16);
|
||||
pref("font.scale.bitmap.undersize.zh-HK", 80);
|
||||
pref("font.scale.bitmap.oversize.zh-HK", 120);
|
||||
|
||||
// minimum font sizes
|
||||
|
||||
pref("font.min-size.variable.ja", 10);
|
||||
@@ -308,6 +335,9 @@ pref("font.min-size.fixed.zh-CN", 10);
|
||||
pref("font.min-size.variable.zh-TW", 10);
|
||||
pref("font.min-size.fixed.zh-TW", 10);
|
||||
|
||||
pref("font.min-size.variable.zh-HK", 10);
|
||||
pref("font.min-size.fixed.zh-HK", 10);
|
||||
|
||||
// X11 specific
|
||||
/* X11 font accept/reject patterns:
|
||||
* Patterns have to match against strings like this:
|
||||
@@ -372,6 +402,7 @@ pref("print.postscript.nativefont.x-user-def", "");
|
||||
pref("print.postscript.nativefont.x-western", "");
|
||||
pref("print.postscript.nativefont.zh-CN", "");
|
||||
pref("print.postscript.nativefont.zh-TW", "");
|
||||
pref("print.postscript.nativefont.zh-HK", "");
|
||||
|
||||
// For the download dialog
|
||||
pref("browser.download.progressDnldDialog.enable_launch_reveal_buttons", false);
|
||||
|
||||
@@ -118,6 +118,14 @@ pref("font.name-list.serif.zh-TW", "MingLiU");
|
||||
pref("font.name-list.sans-serif.zh-TW", "MingLiU");
|
||||
pref("font.name-list.monospace.zh-TW", "MingLiU");
|
||||
|
||||
// hkscsm3u.ttf (HKSCS-2001) : http://www.microsoft.com/hk/hkscs
|
||||
pref("font.name.serif.zh-HK", "細明體_HKSCS");
|
||||
pref("font.name.sans-serif.zh-HK", "細明體_HKSCS");
|
||||
pref("font.name.monospace.zh-HK", "細明體_HKSCS");
|
||||
pref("font.name-list.serif.zh-HK", "MingLiu_HKSCS, Ming(for ISO10646), MingLiU");
|
||||
pref("font.name-list.sans-serif.zh-HK", "MingLiU_HKSCS, Ming(for ISO10646), MingLiU");
|
||||
pref("font.name-list.monospace.zh-HK", "MingLiU_HKSCS, Ming(for ISO10646), MingLiU");
|
||||
|
||||
pref("font.name.serif.x-devanagari", "Mangal");
|
||||
pref("font.name.sans-serif.x-devanagari", "Raghindi");
|
||||
pref("font.name.monospace.x-devanagari", "Mangal");
|
||||
@@ -179,6 +187,9 @@ pref("font.size.fixed.zh-CN", 16);
|
||||
pref("font.size.variable.zh-TW", 16);
|
||||
pref("font.size.fixed.zh-TW", 16);
|
||||
|
||||
pref("font.size.variable.zh-HK", 16);
|
||||
pref("font.size.fixed.zh-HK", 16);
|
||||
|
||||
pref("font.size.nav4rounding", false);
|
||||
|
||||
pref("system.windows.lock_ui.default_mail_client", false);
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
<menuitem value="ja" label="&font.langGroup.japanese;"/>
|
||||
<menuitem value="zh-TW" label="&font.langGroup.trad-chinese;"/>
|
||||
<menuitem value="zh-CN" label="&font.langGroup.simpl-chinese;"/>
|
||||
<menuitem value="zh-HK" label="&font.langGroup.trad-chinese-hk;"/>
|
||||
<menuitem value="ko" label="&font.langGroup.korean;"/>
|
||||
<menuitem value="x-cyrillic" label="&font.langGroup.cyrillic;"/>
|
||||
<menuitem value="x-baltic" label="&font.langGroup.baltic;"/>
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
<!ENTITY font.langGroup.latin1 "Western">
|
||||
<!ENTITY font.langGroup.latin2 "Central European">
|
||||
<!ENTITY font.langGroup.japanese "Japanese">
|
||||
<!ENTITY font.langGroup.trad-chinese "Traditional Chinese">
|
||||
<!ENTITY font.langGroup.trad-chinese "Traditional Chinese(Taiwan)">
|
||||
<!ENTITY font.langGroup.simpl-chinese "Simplified Chinese">
|
||||
<!ENTITY font.langGroup.trad-chinese-hk "Traditional Chinese(Hong Kong)">
|
||||
<!ENTITY font.langGroup.korean "Korean">
|
||||
<!ENTITY font.langGroup.cyrillic "Cyrillic">
|
||||
<!ENTITY font.langGroup.baltic "Baltic">
|
||||
|
||||
Reference in New Issue
Block a user