+ FontMetrics fm = getGraphics().getFontMetrics(newFont);
+ double mw=fm.getStringBounds("M", getGraphics())
+ .getWidth(),iw=fm.getStringBounds("I", getGraphics())
+ .getWidth();
+ if (mw<1 || iw < 1) {
+ fontName.setSelectedItem(lastSelected.getName());
+ fontStyle.setSelectedIndex(lastSelStyle);
+ fontSize.setSelectedItem(""+lastSelSize);
+ monospaced.setSelected(lastSelMono);
+ JOptionPane.showInternalMessageDialog(this, "Font doesn't have letters defined\nso cannot be used\nwith alignment data.", "Invalid Font", JOptionPane.WARNING_MESSAGE);
+ return;
+ }