Browse Source

Merge pull request #266 in BA/design from ~ZHOUPING/design:dev to dev

* commit '586304609b98436fc34ed0f1f456d4ddd08c061f':
  日文设计器默认用MS Mincho字体渲染(之前没有改到设计器本身的字体,补上)
master
superman 8 years ago
parent
commit
b31b1e2424
  1. 12
      designer_base/src/com/fr/design/utils/DesignUtils.java

12
designer_base/src/com/fr/design/utils/DesignUtils.java

@ -230,12 +230,15 @@ public class DesignUtils {
private static FRFont getCurrentLocaleFont(){
FRFont guiFRFont;
Locale defaultLocale = Locale.getDefault();
Locale defaultLocale = FRContext.getLocale();
if (isDisplaySimSun(defaultLocale)) {
guiFRFont = getNamedFont("SimSun");
} else if(isDisplayDialog(defaultLocale)) {
guiFRFont = getNamedFont("Dialog");
} else if(isDisplayJapaneseFont(defaultLocale)){
//日文设计器默认用MS Mincho字体渲染
guiFRFont = getNamedFont("MS Mincho");
} else {
guiFRFont = getNamedFont("Tahoma");
}
@ -268,10 +271,13 @@ public class DesignUtils {
return ComparatorUtils.equals(defaultLocale, Locale.SIMPLIFIED_CHINESE);
}
private static boolean isDisplayJapaneseFont(Locale defaultLocale){
return ComparatorUtils.equals(defaultLocale, Locale.JAPANESE)
|| ComparatorUtils.equals(defaultLocale, Locale.JAPAN);
}
private static boolean isDisplayDialog(Locale defaultLocale){
return ComparatorUtils.equals(defaultLocale, Locale.TRADITIONAL_CHINESE)
|| ComparatorUtils.equals(defaultLocale, Locale.JAPANESE)
|| ComparatorUtils.equals(defaultLocale, Locale.JAPAN)
|| ComparatorUtils.equals(defaultLocale, Locale.KOREAN)
|| ComparatorUtils.equals(defaultLocale, Locale.KOREA);
}

Loading…
Cancel
Save