summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/src/kernel/tqfontdatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tqtinterface/qt4/src/kernel/tqfontdatabase.cpp')
-rw-r--r--tqtinterface/qt4/src/kernel/tqfontdatabase.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/tqtinterface/qt4/src/kernel/tqfontdatabase.cpp b/tqtinterface/qt4/src/kernel/tqfontdatabase.cpp
index f79c14b..e70be03 100644
--- a/tqtinterface/qt4/src/kernel/tqfontdatabase.cpp
+++ b/tqtinterface/qt4/src/kernel/tqfontdatabase.cpp
@@ -707,6 +707,10 @@ static TQtFontStyle *bestStyle(TQtFontFoundry *foundry, const TQtFontStyle::Key
}
FM_DEBUG( " best style has distance 0x%x", dist );
+ if (!foundry->count) {
+ TQtFontStyle *temp = NULL;
+ return temp;
+ }
return foundry->styles[best];
}
@@ -980,20 +984,22 @@ TQFontDatabase::tqfindFont( TQFont::Script script, const TQFontPrivate *fp,
#ifdef TQ_WS_X11
if (script == TQFont::Han) {
- // modify script according to locale
- static TQFont::Script defaultHan = TQFont::UnknownScript;
- if (defaultHan == TQFont::UnknownScript) {
- TQCString locale = setlocale(LC_ALL, NULL);
- if (locale.tqcontains("ko"))
- defaultHan = TQFont::Han_Korean;
- else if (locale.tqcontains("zh_TW") || locale.tqcontains("zh_HK"))
- defaultHan = TQFont::Han_TraditionalChinese;
- else if (locale.tqcontains("zh"))
- defaultHan = TQFont::Han_SimplifiedChinese;
- else
- defaultHan = TQFont::Han_Japanese;
- }
- script = defaultHan;
+ // modify script according to locale
+ static TQFont::Script defaultHan;
+ TQCString locale = setlocale(LC_ALL, NULL);
+
+ if (locale.tqcontains("ko"))
+ defaultHan = TQFont::Han_Korean;
+ else if (locale.tqcontains("zh_TW") || locale.tqcontains("zh_HK"))
+ defaultHan = TQFont::Han_TraditionalChinese;
+ else if (locale.tqcontains("zh"))
+ defaultHan = TQFont::Han_SimplifiedChinese;
+ else if (locale.tqcontains("ja"))
+ defaultHan = TQFont::Han_Japanese;
+ else
+ defaultHan = TQFont::Han; // don't change
+
+ script = defaultHan;
}
#endif