PdfPageTextObjectFont
open class PdfPageTextObjectFont
kotlin.Any | |
↳ | 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 | |
---|---|
static Int |
Constant representing the Courier font family. |
static Int |
Constant representing the Helvetica font family. |
static Int |
Constant representing the Symbol font family. |
static Int |
Constant representing the Times New Roman font family. |
Public constructors | |
---|---|
Creates a new |
|
PdfPageTextObjectFont(fontFamily: Int, isBold: Boolean, isItalic: Boolean) Constructs a new |
Public methods | |
---|---|
open Int |
Returns the font-family which is of type android. |
open Boolean |
isBold() Determines if the text is bold. |
open Boolean |
isItalic() Determines if the text is italic. |
open Unit |
Sets whether the text should be bold or not. |
open Unit |
setFontFamily(fontFamily: Int) Set the font family of the object. |
open Unit |
Set whether the text should be italic or not. |
Constants
FONT_FAMILY_COURIER
static val FONT_FAMILY_COURIER: Int
Constant representing the Courier font family.
Value: 0
FONT_FAMILY_HELVETICA
static val FONT_FAMILY_HELVETICA: Int
Constant representing the Helvetica font family.
Value: 1
FONT_FAMILY_SYMBOL
static val FONT_FAMILY_SYMBOL: Int
Constant representing the Symbol font family. Note: This font family only renders symbols and does not support bold or italic.
Value: 2
FONT_FAMILY_TIMES_NEW_ROMAN
static val FONT_FAMILY_TIMES_NEW_ROMAN: Int
Constant representing the Times New Roman font family.
Value: 3
Public constructors
PdfPageTextObjectFont
PdfPageTextObjectFont(font: PdfPageTextObjectFont)
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
PdfPageTextObjectFont(
fontFamily: Int,
isBold: Boolean,
isItalic: Boolean)
Constructs a new PdfPageTextObjectFont
with the specified attributes.
Parameters | |
---|---|
fontFamily |
Int: The font family, as defined by android.graphics.pdf.component.PdfPageTextObjectFont.FontFamily Value is android.graphics.pdf.component.PdfPageTextObjectFont#FONT_FAMILY_COURIER , android.graphics.pdf.component.PdfPageTextObjectFont#FONT_FAMILY_HELVETICA , android.graphics.pdf.component.PdfPageTextObjectFont#FONT_FAMILY_SYMBOL , or android.graphics.pdf.component.PdfPageTextObjectFont#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
open fun getFontFamily(): Int
Returns the font-family which is of type android.graphics.pdf.component.PdfPageTextObjectFont.FontFamily, previously set using PdfPageTextObjectFont.setFontFamily(int)
or the constructor.
isBold
open fun isBold(): Boolean
Determines if the text is bold.
Return | |
---|---|
Boolean |
true if the text is bold, false otherwise. |
isItalic
open fun isItalic(): Boolean
Determines if the text is italic.
Return | |
---|---|
Boolean |
true if the text is italic, false otherwise. |
setBold
open fun setBold(bold: Boolean): Unit
Sets whether the text should be bold or not.
Parameters | |
---|---|
bold |
Boolean: true if the text should be bold, false otherwise. |
setFontFamily
open fun setFontFamily(fontFamily: Int): Unit
Set the font family of the object.
setItalic
open fun setItalic(italic: Boolean): Unit
Set whether the text should be italic or not.
Parameters | |
---|---|
italic |
Boolean: true if the text should be italic, false otherwise. |