Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.graphics

public Class PDFontSetting

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSFloat, .COSNumber, org.apache.pdfbox.pdmodel.common.COSObjectable, org.apache.pdfbox.pdmodel.font.PDFont, .PDFontFactory, java.io.IOException

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?
Author
Ben Litchfield

Field Summary

Modifier and TypeField and Description
private COSArray

Constructor Summary

AccessConstructor and Description
public
PDFontSetting()

Creates a blank font setting, font will be null, size will be 1.

public
PDFontSetting(COSArray
The new font setting value.
fs
)

Constructs a font setting from an existing array.

Method Summary

Modifier and TypeMethod and Description
public COSBase
getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

public PDFont

Returns:

The font for this setting of null if one was not found.
getFont
()

This will get the font for this font setting.

public float

Returns:

The size of the font.
getFontSize
()

This will get the size of the font.

public void
setFont(PDFont
The new font.
font
)

This will set the font for this font setting.

public void
setFontSize(float
The new size of the font.
size
)

This will set the size of the font.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fontSettingback to summary
private COSArray fontSetting

Constructor Detail

PDFontSettingback to summary
public PDFontSetting()

Creates a blank font setting, font will be null, size will be 1.

PDFontSettingback to summary
public PDFontSetting(COSArray fs)

Constructs a font setting from an existing array.

Parameters
fs:COSArray

The new font setting value.

Method Detail

getCOSObjectback to summary
public COSBase getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Doc from org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS object.

Returns:COSBase

The cos object that matches this Java object.

Annotations
@Override
getFontback to summary
public PDFont getFont() throws IOException

This will get the font for this font setting.

Returns:PDFont

The font for this setting of null if one was not found.

Exceptions
IOException:
If there is an error getting the font.
getFontSizeback to summary
public float getFontSize()

This will get the size of the font.

Returns:float

The size of the font.

setFontback to summary
public void setFont(PDFont font)

This will set the font for this font setting.

Parameters
font:PDFont

The new font.

setFontSizeback to summary
public void setFontSize(float size)

This will set the size of the font.

Parameters
size:float

The new size of the font.