- Timestamp:
- 2015-04-27T18:46:32+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r8175 r8282 381 381 FontsManager.initialize(); 382 382 383 handleSpecialLanguages();383 I18n.setupLanguageFonts(); 384 384 385 385 final JFrame mainFrame = new JFrame(tr("Java OpenStreetMap Editor")); … … 502 502 info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console"); 503 503 RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager()); 504 }505 }506 507 private static void handleSpecialLanguages() {508 // Use special font for Khmer script, as the default Java font do not display these characters509 if ("km".equals(Main.pref.get("language"))) {510 Collection<String> fonts = Arrays.asList(511 GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames());512 for (String f : new String[]{"Khmer UI", "DaunPenh", "MoolBoran"}) {513 if (fonts.contains(f)) {514 GuiHelper.setUIFont(f);515 break;516 }517 }518 504 } 519 505 } -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r7896 r8282 48 48 import org.openstreetmap.josm.tools.GBC; 49 49 import org.openstreetmap.josm.tools.ImageProvider; 50 import org.openstreetmap.josm.tools.LanguageInfo; 50 51 51 52 /** … … 309 310 public static Font getMonospacedFont(JComponent component) { 310 311 // Special font for Khmer script 311 if ("km".equals( Main.pref.get("language"))) {312 if ("km".equals(LanguageInfo.getJOSMLocaleCode())) { 312 313 return component.getFont(); 313 314 } else { … … 329 330 List<String> fonts = Arrays.asList(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); 330 331 // Special font for Khmer script 331 if ("km".equals( Main.pref.get("language"))) {332 if ("km".equals(LanguageInfo.getJOSMLocaleCode())) { 332 333 return UIManager.getFont("Label.font").deriveFont(20.0f); 333 334 } -
trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java
r8005 r8282 18 18 import org.openstreetmap.josm.Main; 19 19 import org.openstreetmap.josm.gui.util.GuiHelper; 20 import org.openstreetmap.josm.tools.LanguageInfo; 20 21 import org.openstreetmap.josm.tools.Utils; 21 22 … … 104 105 ss.addRule("ol {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: decimal}"); 105 106 ss.addRule("ul {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: disc}"); 106 if ("km".equals( Main.pref.get("language"))) {107 if ("km".equals(LanguageInfo.getJOSMLocaleCode())) { 107 108 // Fix rendering problem for Khmer script 108 109 ss.addRule("p {" + getFontRule(UIManager.getFont("Label.font")) + "}"); -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r8241 r8282 2 2 package org.openstreetmap.josm.tools; 3 3 4 import java.awt.GraphicsEnvironment; 4 5 import java.io.BufferedInputStream; 5 6 import java.io.File; … … 26 27 import org.openstreetmap.gui.jmapviewer.FeatureAdapter.TranslationAdapter; 27 28 import org.openstreetmap.josm.Main; 29 import org.openstreetmap.josm.gui.util.GuiHelper; 28 30 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser; 29 31 … … 734 736 }; 735 737 } 738 739 /** 740 * Setup special font for Khmer script, as the default Java font do not display these characters. 741 * 742 * @since 8281 743 */ 744 public static void setupLanguageFonts() { 745 // Use special font for Khmer script, as the default Java font do not display these characters 746 if ("km".equals(LanguageInfo.getJOSMLocaleCode())) { 747 Collection<String> fonts = Arrays.asList( 748 GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); 749 for (String f : new String[]{"Khmer UI", "DaunPenh", "MoolBoran"}) { 750 if (fonts.contains(f)) { 751 GuiHelper.setUIFont(f); 752 break; 753 } 754 } 755 } 756 } 736 757 }
Note:
See TracChangeset
for help on using the changeset viewer.