// 少なくともメニューが表示できるようなフォントを選択する
Properties strings = LocalizedResourcePropertyLoader.getCachedInstance()
.getLocalizedProperties("menu/menu");
- HashSet<Character> useChars = new HashSet<Character>();
+ HashSet<Integer> useCodePoints = new HashSet<Integer>();
Enumeration<?> enmStrings = strings.propertyNames();
while (enmStrings.hasMoreElements()) {
String propertyName = (String) enmStrings.nextElement();
String propertyValue = strings.getProperty(propertyName);
- for (char ch : propertyValue.toCharArray()) {
- useChars.add(ch);
+ int len = propertyValue.length();
+ for (int idx = 0; idx < len;) {
+ int codepoint = propertyValue.codePointAt(idx);
+ useCodePoints.add(codepoint);
+ idx += Character.charCount(codepoint);
}
}
Font font = Font.decode(availableFontFamily);
logger.log(Level.INFO, "実在するフォントの確認:" + availableFontFamily);
boolean canDisplay = false;
- for (char ch : useChars) {
- canDisplay = font.canDisplay(ch);
+ for (Integer codepoint : useCodePoints) {
+ canDisplay = font.canDisplay(codepoint);
if (!canDisplay) {
- logger.log(Level.INFO,
- "このフォントはメニュー表示に使用できません: "
- + selectedFontFamily + "/ch=" + ch);
+ logger.log(Level.INFO, "このフォントはメニュー表示に使用できません: "
+ + selectedFontFamily + "/codepoint=0x" + Integer.toHexString(codepoint));
break;
}
}