public class Font
extends java.lang.Object
Font
represents a PDF font.
The Font
class represents the PDF Font. This class provides
methods for application to obtain some specifications of a font, like font
name, font style etc.
It can be constructed by the following ways.
Example:
Font font = FontManager.createStandard(int);
Font font = FontManager.create(final String, int, int, int);
Font font = FontManager.createFromFile(final FileHandler, int, int);
Modifier and Type | Method and Description |
---|---|
int |
getAscent()
Get the ascent value of the font.
|
android.graphics.Rect |
getCharBBox(char unicode)
Get the specific character bounding box of the font.
|
float |
getCharWidth(char unicode)
Get the specific character width of the font.
|
int |
getDescent()
Get the descent value of the font.
|
java.lang.String |
getFaceName()
Retrieve face name of a font.
|
long |
getHandle()
Get the font Handle.
|
boolean |
isBold()
Judge whether a font object is bold or not.
|
boolean |
isItalic()
Judge whether a
Font object is italic or not. |
public long getHandle()
public int getAscent() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public int getDescent() throws PDFException
PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public android.graphics.Rect getCharBBox(char unicode) throws PDFException
unicode
- The character unicode value.Rect
object that receives the character bounding box.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
Rect
public float getCharWidth(char unicode) throws PDFException
unicode
- The character unicode value.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean isItalic() throws PDFException
Font
object is italic or not.true
if the font is italic, false
for else.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public boolean isBold() throws PDFException
true
if the font is bold, false
for else.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public java.lang.String getFaceName() throws PDFException
String
object that indicates face name of the font.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException