org.apache.pdfbox.pdmodel.graphics
public class: PDFontSetting [javadoc |
source]
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.PDFontSetting
All Implemented Interfaces:
COSObjectable
This class represents a font setting used for the graphics state. A font setting is a font and a
font size. Maybe there is a better name for this?
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.pdfbox.pdmodel.graphics.PDFontSetting Detail: |
public COSBase getCOSObject() {
return fontSetting;
}
|
public PDFont getFont() throws IOException {
PDFont retval = null;
COSBase font = fontSetting.get( 0 );
if( font instanceof COSDictionary )
{
retval = PDFontFactory.createFont( (COSDictionary)font );
}
return retval;
}
This will get the font for this font setting. |
public float getFontSize() {
COSNumber size = (COSNumber)fontSetting.get( 1 );
return size.floatValue();
}
This will get the size of the font. |
public void setFont(PDFont font) {
fontSetting.set( 0, font );
}
This will set the font for this font setting. |
public void setFontSize(float size) {
fontSetting.set( 1, new COSFloat( size ) );
}
This will set the size of the font. |