List of usage examples for com.itextpdf.text.pdf BaseField setFont
public void setFont(BaseFont font)
From source file:com.vectorprint.report.itext.style.stylers.FieldFont.java
License:Open Source License
@Override public <E> E style(E element, Object data) throws VectorPrintException { element = super.style(element, data); BaseField bf = getFromCell(element); if (bf != null) { com.itextpdf.text.Font f = FontFactory.getFont(getValue(FAMILY_PARAM, String.class), getValue(SIZE_PARAM, Float.class), getValue(STYLE_PARAM, Font.STYLE.class).getStyle()); if (f.getBaseFont() == null) { throw new VectorPrintRuntimeException( "font " + f.getFamilyname() + " does not have a basefont, check your fontloading"); }/*from w w w. jav a2 s . c o m*/ bf.setFont(f.getBaseFont()); bf.setFontSize(getValue(SIZE_PARAM, Float.class)); bf.setTextColor(itextHelper.fromColor(getValue(COLOR_PARAM, Color.class))); } return element; }