boolean validCharWidth;
/**
- * DOCUMENT ME!
- *
- * @param f
- * DOCUMENT ME!
+ * update view settings with the given font. You may need to call
+ * alignPanel.fontChanged to update the layout geometry
*/
public void setFont(Font f)
{
java.awt.FontMetrics fm = c.getFontMetrics(font);
int w = viewStyle.getCharWidth(), ww = fm.charWidth('M'), h = viewStyle
.getCharHeight();
- // only update width/height if the new font won't fit
- if (h < fm.getHeight())
- {
- setCharHeight(fm.getHeight());
- }
- if (w < ww)
- {
- setCharWidth(ww);
- }
+ setCharHeight(fm.getHeight());
+ setCharWidth(ww);
viewStyle.setFontName(font.getName());
viewStyle.setFontStyle(font.getStyle());
viewStyle.setFontSize(font.getSize());