/** * Set current font. Default to Plain Courier 11 if null. * * @param font new font. */ public void setFont(Font font) { if (font != null) { m_localGraphicsState.setFont(font); if (font.getName().equals(m_psGraphicsState.getFont().getName()) && (m_psGraphicsState.getFont().getStyle() == font.getStyle()) && (m_psGraphicsState.getFont().getSize() == yScale(font.getSize()))) return; m_psGraphicsState.setFont( new Font(font.getName(), font.getStyle(), yScale(getFont().getSize()))); } else { m_localGraphicsState.setFont(new Font("Courier", Font.PLAIN, 11)); m_psGraphicsState.setFont(getFont()); } m_printstream.println("/(" + replacePSFont(getFont().getPSName()) + ")" + " findfont"); m_printstream.println(yScale(getFont().getSize()) + " scalefont setfont"); }
/** * Get current font. * * @return current font. */ public Font getFont() { return (m_localGraphicsState.getFont()); }