/** * Sets a <tt>JRFont</tt> object containing all font properties for this text element * * @deprecated */ public void setFont(JRFont font) { setReportFont(font.getReportFont()); setFontName(font.getOwnFontName()); setBold(font.isOwnBold()); setItalic(font.isOwnItalic()); setUnderline(font.isOwnUnderline()); setStrikeThrough(font.isOwnStrikeThrough()); setFontSize(font.getOwnSize()); setPdfFontName(font.getOwnPdfFontName()); setPdfEncoding(font.getOwnPdfEncoding()); setPdfEmbedded(font.isOwnPdfEmbedded()); }
protected void exportFont(JRFont font) throws IOException { if (font != null) { xmlWriter.startElement(JRXmlConstants.ELEMENT_font); xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_fontName, font.getOwnFontName()); xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_size, font.getOwnFontSize()); xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_isBold, font.isOwnBold()); xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_isItalic, font.isOwnItalic()); xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_isUnderline, font.isOwnUnderline()); xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_isStrikeThrough, font.isOwnStrikeThrough()); xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfFontName, font.getOwnPdfFontName()); xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_pdfEncoding, font.getOwnPdfEncoding()); xmlWriter.addAttribute(JRXmlConstants.ATTRIBUTE_isPdfEmbedded, font.isOwnPdfEmbedded()); xmlWriter.closeElement(true); } }
public void setValue(Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (val == null || val instanceof String) { if ((val + "").trim().length() == 0) val = null; String oldValue = font.getOwnPdfEncoding(); String newValue = (String) val; font.setPdfEncoding(newValue); ObjectPropertyUndoableEdit urob = new ObjectPropertyUndoableEdit(font, "PdfEncoding", String.class, oldValue, newValue); // Find the undoRedo manager... IReportManager.getInstance().addUndoableEdit(urob); } }
@Override public boolean isDefaultValue() { return font.getOwnPdfEncoding() == null; }