From 5d4390d0e09fa35e26ec0d36d69658dfd5ea8605 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Sat, 17 Oct 2009 13:54:48 +0000 Subject: [PATCH] Fix an issue with Chinese font in POS AWT bug reported at http://n4.nabble.com/Simplified-Chinese-characters-are-displayed-as-square-boxes-in-POS-td165505.html#a165506 More to come as this fix only the operator's part of the screen git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@826253 13f79535-47bb-0310-9956-ffa450edef68 --- pos/src/org/ofbiz/pos/component/Operator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pos/src/org/ofbiz/pos/component/Operator.java b/pos/src/org/ofbiz/pos/component/Operator.java index 0ab51d91f..30941fa5d 100644 --- a/pos/src/org/ofbiz/pos/component/Operator.java +++ b/pos/src/org/ofbiz/pos/component/Operator.java @@ -83,7 +83,12 @@ public class Operator { String fontName = titleStyle.getStyleAsString(XStyle.FONT_FACE); int fontStyle = titleStyle.getStyleAsInt(XStyle.FONT_WEIGHT); int fontSize = titleStyle.getStyleAsInt(XStyle.FONT_SIZE); - Font titleFont = new Font(fontName, fontStyle, fontSize); + Font titleFont = null; + if (defaultLocale.getLanguage().equals("zh")) { // AWT bug reported at http://n4.nabble.com/Simplified-Chinese-characters-are-displayed-as-square-boxes-in-POS-td165505.html#a165506 + titleFont = new Font(null, fontStyle, fontSize); + } else { + titleFont = new Font(fontName, fontStyle, fontSize); + } Border base = BorderFactory.createEtchedBorder(); TitledBorder border = BorderFactory.createTitledBorder(base, this.getFieldTitle(field.getName()),