Show "Selected font doenst contain character..." message in log.

This commit is contained in:
2014-11-30 20:50:07 +01:00
parent a36e90d5f1
commit 35f76a1157
2 changed files with 6 additions and 2 deletions
@@ -127,7 +127,9 @@ public class FontPanel extends javax.swing.JPanel {
if (oldchars.indexOf((int) c) == -1) { if (oldchars.indexOf((int) c) == -1) {
font = font.deriveFont(f.getFontStyle(), 1024); font = font.deriveFont(f.getFontStyle(), 1024);
if (!font.canDisplay(c)) { if (!font.canDisplay(c)) {
View.showMessageDialog(null, translate("error.font.nocharacter").replace("%char%", "" + c), translate("error"), JOptionPane.ERROR_MESSAGE); String msg = translate("error.font.nocharacter").replace("%char%", "" + c);
Logger.getLogger(FontPanel.class.getName()).log(Level.SEVERE, msg);
View.showMessageDialog(null, msg, translate("error"), JOptionPane.ERROR_MESSAGE);
return; return;
} }
} }
@@ -1730,7 +1730,9 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
} }
Font f = FontTag.installedFontsByName.get(fontName); Font f = FontTag.installedFontsByName.get(fontName);
if (f == null || !f.canDisplay(character)) { if (f == null || !f.canDisplay(character)) {
View.showMessageDialog(null, translate("error.font.nocharacter").replace("%char%", "" + character), translate("error"), JOptionPane.ERROR_MESSAGE); String msg = translate("error.font.nocharacter").replace("%char%", "" + character);
logger.log(Level.SEVERE, msg);
View.showMessageDialog(null, msg, translate("error"), JOptionPane.ERROR_MESSAGE);
return false; return false;
} }
font.addCharacter(character, f); font.addCharacter(character, f);