FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix:load fallback font for CJK. · 2php/processing@6e27a7d · GitHub

Repository navigation

Commit 6e27a7d

Browse files
committed
fix:load fallback font for CJK.
1 parent 2ecdc36 commit 6e27a7d

2 files changed

Lines changed: 40 additions & 18 deletions

File tree

‎app/src/processing/app/ui/Toolkit.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import java.util.Comparator;
5555
import java.util.HashSet;
5656
import java.util.List;
57+
import java.util.Locale;
5758
import java.util.regex.Pattern;
5859

5960
import javax.swing.Action;
@@ -892,6 +893,16 @@ static public Font getMonoFont(int size, int style) {
892893
monoBoldFont = createFont("AnonymousPro-Bold.ttf", size);
893894
}
894895
}
896+
// issue2886
897+
// follback for Chinese, Korean, Japanese.
898+
String lang = Language.getLanguage();
899+
if (Locale.CHINESE.getLanguage().equals(lang) ||
900+
Locale.JAPANESE.getLanguage().equals(lang) ||
901+
Locale.KOREAN.getLanguage().equals(lang)) {
902+
sansFont = new Font("Monospaced", Font.PLAIN, size);
903+
sansBoldFont = new Font("Monospaced", Font.BOLD, size);
904+
Messages.log("load Monospaced font for CJK.");
905+
}
895906
} catch (Exception e) {
896907
Messages.loge("Could not load mono font", e);
897908
monoFont = new Font("Monospaced", Font.PLAIN, size);
@@ -928,6 +939,17 @@ static public Font getSansFont(int size, int style) {
928939
sansBoldFont = createFont("Carlito-Bold.ttf", size);
929940
}
930941
}
942+
943+
// issue2886
944+
// follback for Chinese, Korean, Japanese.
945+
String lang = Language.getLanguage();
946+
if (Locale.CHINESE.getLanguage().equals(lang) ||
947+
Locale.JAPANESE.getLanguage().equals(lang) ||
948+
Locale.KOREAN.getLanguage().equals(lang)) {
949+
sansFont = new Font("SansSerif", Font.PLAIN, size);
950+
sansBoldFont = new Font("SansSerif", Font.BOLD, size);
951+
Messages.log("load sans font for CJK.");
952+
}
931953
} catch (Exception e) {
932954
Messages.loge("Could not load sans font", e);
933955
sansFont = new Font("SansSerif", Font.PLAIN, size);

‎build/shared/lib/languages/PDE_ja.properties‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,15 @@ debugger.type = 型
283283
# [Run/Present] [Stop] [New] [Open] [Save]
284284
# FIXME: スケッチのメニュー部分は日本語が表示できないため、英語のままにする
285285
# https://github.com/processing/processing/issues/2886
286-
#toolbar.run = 実行
287-
#toolbar.present = プレゼンテーション
288-
#toolbar.stop = 停止
289-
#toolbar.debug = デバッグ
286+
toolbar.run = 実行
287+
toolbar.present = プレゼンテーション
288+
toolbar.stop = 停止
289+
toolbar.debug = デバッグ
290290
# ---
291-
#toolbar.new = 新規
292-
#toolbar.open = 開く
293-
#toolbar.save = 保存
294-
# toolbar.export_application = Export Application
291+
toolbar.new = 新規
292+
toolbar.open = 開く
293+
toolbar.save = 保存
294+
toolbar.export_application = Export Application
295295
toolbar.add_mode = モードの追加...
296296

297297
# [Debug] [Continue] [Step] [Stop] [Toggle Breakpoints] [Variable Inspector]
@@ -333,8 +333,8 @@ editor.sketch.rename.description = スケッチの新しい名前
333333
#editor.status.drag_and_drop.files_added.0 = No files were added to the sketch.
334334
#editor.status.drag_and_drop.files_added.1 = One file added to the sketch.
335335
#editor.status.drag_and_drop.files_added.n = %d files added to the sketch.
336-
#editor.status.saving = 保存しています...
337-
#editor.status.saving.done = 保存が完了しました。
336+
editor.status.saving = 保存しています...
337+
editor.status.saving.done = 保存が完了しました。
338338
#editor.status.saving.canceled = 保存がキャンセルされました。
339339
#editor.status.printing = 印刷しています...
340340
#editor.status.printing.done = 印刷が完了しました。
@@ -349,9 +349,9 @@ editor.sketch.rename.description = スケッチの新しい名前
349349
# Errors
350350
# FIXME: この部分は文字化けするため、英語のままにする
351351
# https://github.com/processing/processing/issues/2886
352-
#editor.status.warning = 警告
353-
#editor.status.error = エラー
354-
#editor.status.error_on = "%s" でエラー
352+
editor.status.warning = 警告
353+
editor.status.error = エラー
354+
editor.status.error_on = "%s" でエラー
355355
#editor.status.missing.default = "%c" がありません
356356
#editor.status.missing.semicolon = セミコロン ";" がありません
357357
#editor.status.missing.left_sq_bracket = Missing left square bracket "["
@@ -378,11 +378,11 @@ editor.sketch.rename.description = スケッチの新しい名前
378378
# Footer buttons
379379
# FIXME: この部分は文字化けするため、英語のままにする
380380
# https://github.com/processing/processing/issues/2886
381-
#editor.footer.errors = エラー
382-
#editor.footer.errors.problem = 問題
383-
#editor.footer.errors.tab = タブ
384-
#editor.footer.errors.line = 行
385-
#editor.footer.console = コンソール
381+
editor.footer.errors = エラー
382+
editor.footer.errors.problem = 問題
383+
editor.footer.errors.tab = タブ
384+
editor.footer.errors.line = 行
385+
editor.footer.console = コンソール
386386

387387
# New handler
388388
new.messages.is_read_only = スケッチが読込み専用です

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL