PdfPageTextObjectFont
public
class
PdfPageTextObjectFont
extends Object
java.lang.Object | |
↳ | android.graphics.pdf.component.PdfPageTextObjectFont |
Represents the font attributes of a PdfPageTextObject
.
This class encapsulates the attributes font family, boldness and italic styling.
Summary
Constants | |
---|---|
int |
FONT_FAMILY_COURIER
Constant representing the Courier font family. |
int |
FONT_FAMILY_HELVETICA
Constant representing the Helvetica font family. |
int |
FONT_FAMILY_SYMBOL
Constant representing the Symbol font family. |
int |
FONT_FAMILY_TIMES_NEW_ROMAN
Constant representing the Times New Roman font family. |
Public constructors | |
---|---|
PdfPageTextObjectFont(PdfPageTextObjectFont font)
Creates a new |
|
PdfPageTextObjectFont(int fontFamily, boolean isBold, boolean isItalic)
Constructs a new |
Public methods | |
---|---|
int
|
getFontFamily()
Returns the font-family which is of type |
boolean
|
isBold()
Determines if the text is bold. |
boolean
|
isItalic()
Determines if the text is italic. |
void
|
setBold(boolean bold)
Sets whether the text should be bold or not. |
void
|
setFontFamily(int fontFamily)
Set the font family of the object. |
void
|
setItalic(boolean italic)
Set whether the text should be italic or not. |
Inherited methods | |
---|---|
Constants
FONT_FAMILY_COURIER
public static final int FONT_FAMILY_COURIER
Constant representing the Courier font family.
Constant Value: 0 (0x00000000)
FONT_FAMILY_HELVETICA
public static final int FONT_FAMILY_HELVETICA
Constant representing the Helvetica font family.
Constant Value: 1 (0x00000001)
FONT_FAMILY_SYMBOL
public static final int FONT_FAMILY_SYMBOL
Constant representing the Symbol font family. Note: This font family only renders symbols and does not support bold or italic.
Constant Value: 2 (0x00000002)
FONT_FAMILY_TIMES_NEW_ROMAN
public static final int FONT_FAMILY_TIMES_NEW_ROMAN
Constant representing the Times New Roman font family.
Constant Value: 3 (0x00000003)
Public constructors
PdfPageTextObjectFont
public PdfPageTextObjectFont (PdfPageTextObjectFont font)
Creates a new PdfPageTextObjectFont
by copying attributes from the another
PdfPageTextObjectFont
instance.
Parameters | |
---|---|
font |
PdfPageTextObjectFont : The PdfPageTextObjectFont instance to copy attributes from.
This value cannot be null . |
PdfPageTextObjectFont
public PdfPageTextObjectFont (int fontFamily, boolean isBold, boolean isItalic)
Constructs a new PdfPageTextObjectFont
with the specified attributes.
Parameters | |
---|---|
fontFamily |
int : The font family, as defined by ERROR(FontFamily/android.graphics.pdf.component.PdfPageTextObjectFont.FontFamily FontFamily)
Value is FONT_FAMILY_COURIER , FONT_FAMILY_HELVETICA , FONT_FAMILY_SYMBOL , or FONT_FAMILY_TIMES_NEW_ROMAN |
isBold |
boolean : true if the text should be bold, false otherwise |
isItalic |
boolean : true if the text should be italic, false otherwise |
Public methods
getFontFamily
public int getFontFamily ()
Returns the font-family which is of type ERROR(FontFamily/android.graphics.pdf.component.PdfPageTextObjectFont.FontFamily FontFamily)
, previously set using
PdfPageTextObjectFont.setFontFamily(int)
or the constructor.
Returns | |
---|---|
int |
The font-family.
Value is FONT_FAMILY_COURIER , FONT_FAMILY_HELVETICA , FONT_FAMILY_SYMBOL , or FONT_FAMILY_TIMES_NEW_ROMAN |
isBold
public boolean isBold ()
Determines if the text is bold.
Returns | |
---|---|
boolean |
true if the text is bold, false otherwise. |
isItalic
public boolean isItalic ()
Determines if the text is italic.
Returns | |
---|---|
boolean |
true if the text is italic, false otherwise. |
setBold
public void setBold (boolean bold)
Sets whether the text should be bold or not.
Parameters | |
---|---|
bold |
boolean : true if the text should be bold, false otherwise. |
setFontFamily
public void setFontFamily (int fontFamily)
Set the font family of the object.
Parameters | |
---|---|
fontFamily |
int : The font family to be set.
Value is FONT_FAMILY_COURIER , FONT_FAMILY_HELVETICA , FONT_FAMILY_SYMBOL , or FONT_FAMILY_TIMES_NEW_ROMAN |
setItalic
public void setItalic (boolean italic)
Set whether the text should be italic or not.
Parameters | |
---|---|
italic |
boolean : true if the text should be italic, false otherwise. |