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 by copying attributes from the another PdfPageTextObjectFont instance.

PdfPageTextObjectFont(int fontFamily, boolean isBold, boolean isItalic)

Constructs a new PdfPageTextObjectFont with the specified attributes.

Public methods

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.

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

Added in S Extensions 18
public static final int FONT_FAMILY_COURIER

Constant representing the Courier font family.

Constant Value: 0 (0x00000000)

FONT_FAMILY_HELVETICA

Added in S Extensions 18
public static final int FONT_FAMILY_HELVETICA

Constant representing the Helvetica font family.

Constant Value: 1 (0x00000001)

FONT_FAMILY_SYMBOL

Added in S Extensions 18
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

Added in S Extensions 18
public static final int FONT_FAMILY_TIMES_NEW_ROMAN

Constant representing the Times New Roman font family.

Constant Value: 3 (0x00000003)

Public constructors

PdfPageTextObjectFont

Added in S Extensions 18
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

Added in S Extensions 18
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

Added in S Extensions 18
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

Added in S Extensions 18
public boolean isBold ()

Determines if the text is bold.

Returns
boolean true if the text is bold, false otherwise.

isItalic

Added in S Extensions 18
public boolean isItalic ()

Determines if the text is italic.

Returns
boolean true if the text is italic, false otherwise.

setBold

Added in S Extensions 18
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

Added in S Extensions 18
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

Added in S Extensions 18
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.