Browse Source

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

* commit '5cffef155eb88c265c41cab80be621ec6c72f05f':
  无JIRA任务 日文设计器字体不用明朝字体了,仍旧用回以前的宋体
master
superman 8 years ago
parent
commit
01a4aaeb16
  1. 14
      designer_base/src/com/fr/design/utils/DesignUtils.java

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

@ -230,15 +230,12 @@ public class DesignUtils {
private static FRFont getCurrentLocaleFont(){ private static FRFont getCurrentLocaleFont(){
FRFont guiFRFont; FRFont guiFRFont;
Locale defaultLocale = FRContext.getLocale(); Locale defaultLocale = Locale.getDefault();
if (isDisplaySimSun(defaultLocale)) { if (isDisplaySimSun(defaultLocale)) {
guiFRFont = getNamedFont("SimSun"); guiFRFont = getNamedFont("SimSun");
} else if(isDisplayDialog(defaultLocale)) { } else if(isDisplayDialog(defaultLocale)) {
guiFRFont = getNamedFont("Dialog"); guiFRFont = getNamedFont("Dialog");
} else if(isDisplayJapaneseFont(defaultLocale)){
//日文设计器默认用MS Mincho字体渲染
guiFRFont = getNamedFont("MS Mincho");
} else { } else {
guiFRFont = getNamedFont("Tahoma"); guiFRFont = getNamedFont("Tahoma");
} }
@ -270,14 +267,11 @@ public class DesignUtils {
private static boolean isDisplaySimSun(Locale defaultLocale){ private static boolean isDisplaySimSun(Locale defaultLocale){
return ComparatorUtils.equals(defaultLocale, Locale.SIMPLIFIED_CHINESE); 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){ private static boolean isDisplayDialog(Locale defaultLocale){
return ComparatorUtils.equals(defaultLocale, Locale.TRADITIONAL_CHINESE) 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.KOREAN)
|| ComparatorUtils.equals(defaultLocale, Locale.KOREA); || ComparatorUtils.equals(defaultLocale, Locale.KOREA);
} }

Loading…
Cancel
Save