|
Platypus | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pz.platypus.plugin.pdf.PdfFont
public class PdfFont
Handles fonts for the PDF plugin
| Field Summary | |
|---|---|
private boolean |
bold
is font bold? |
private GDD |
gdd
|
private boolean |
italics
is fond italic? |
private com.lowagie.text.Font |
iTfont
the iText font |
private PdfData |
pdfData
|
private float |
size
font size |
private Source |
source
file and line number of last change |
private java.lang.String |
typeface
the font typeface in the form of a string used by iText |
| Constructor Summary | |
|---|---|
PdfFont(PdfData pdd)
|
|
PdfFont(PdfData pdd,
java.lang.String fontName,
PdfFont existingFont)
Constructor for cloning an existing PdfFont, but specifying a different typeface. |
|
| Method Summary | |
|---|---|
PdfFont |
clone()
|
(package private) int |
computeItextStyle()
iText font style captures bold, italic, strikethru, underline. |
(package private) com.lowagie.text.Font |
createFont(PdfFont f)
Creates an iText Font object based on the class fields |
(package private) java.lang.String |
createItextFontName(PdfFont f)
Get the name by which iText refers to this font. |
(package private) boolean |
findAndRegisterFont(java.lang.String typefaceName)
Get the filenames from the typefaceMap and register them in iText's FontFactory. |
boolean |
getBold()
|
(package private) com.lowagie.text.Font |
getCp1252Font(java.lang.String fontName,
float size,
int style)
Gets the font with CP1252 (aka WINANSI) encoding |
java.lang.String |
getFace()
|
(package private) com.lowagie.text.Font |
getIdentityHFont(java.lang.String fontName,
float size,
int style)
Opens a font using the IDENTITY-H encoding. |
boolean |
getItalics()
|
com.lowagie.text.Font |
getItextFont()
Get the iText font |
float |
getSize()
|
Source |
getSource()
|
(package private) boolean |
isBase14Font(java.lang.String fontName)
Determines whehter the current font is one of the Base14 Acrobat fonts, built into every PDF reader. |
private boolean |
isFileOtf(java.lang.String fontName)
Looks up a font in the fontlist and determines whether it uses the .otf font format. |
(package private) java.lang.String[] |
lookupFontFilenames(java.lang.String typefaceName)
Get the names of the actual font files that are the implementation of this typeface |
private void |
registerFont(java.lang.String fontFile,
java.lang.String typeface)
Actual font registration. |
(package private) void |
registerOneFont(java.lang.String fontFile,
java.lang.String typeface)
Unfortunately, iText does not pass along the exception if the file cannot be found. |
void |
setBold(boolean onOff,
Source newSource)
set bold on/off and re-create the iText font to record the change. |
void |
setFace(java.lang.String newFace,
Source newSource)
|
void |
setItalics(boolean onOff,
Source newSource)
set italics on/off and re-create the iText font to record the change. |
void |
setSize(float newSize,
Source newSource)
|
void |
setToDefault()
Initializes all PdfFont fields to defaults, and sets line number to 0 |
(package private) void |
ttcFileErrorMsg(GDD gdd,
java.lang.String fontFile)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private com.lowagie.text.Font iTfont
private java.lang.String typeface
private float size
private boolean bold
private boolean italics
private Source source
private GDD gdd
private PdfData pdfData
| Constructor Detail |
|---|
public PdfFont(PdfData pdd)
public PdfFont(PdfData pdd,
java.lang.String fontName,
PdfFont existingFont)
pdd - PDF datafontName - the name of the new font/typefaceexistingFont - the font to clone the other attributes from| Method Detail |
|---|
public void setToDefault()
public PdfFont clone()
clone in class java.lang.Objectcom.lowagie.text.Font createFont(PdfFont f)
f - the PdfFont containing the parameters for the font
com.lowagie.text.Font getIdentityHFont(java.lang.String fontName,
float size,
int style)
fontName - the name assigned to the font in the font listsize - the size in pointsstyle - bold, italic, etc.
private boolean isFileOtf(java.lang.String fontName)
fontName - name of font to verify
com.lowagie.text.Font getCp1252Font(java.lang.String fontName,
float size,
int style)
fontName - name of font to getsize - size in pointsstyle - bold, italic, etc.
boolean isBase14Font(java.lang.String fontName)
fontName - name of the font face
java.lang.String createItextFontName(PdfFont f)
f - PdfFont whose iText name we're getting
boolean findAndRegisterFont(java.lang.String typefaceName)
typefaceName - name of the typeface
void registerOneFont(java.lang.String fontFile,
java.lang.String typeface)
fontFile - the file location and nametypeface - the name of the typeface to register the font for
private void registerFont(java.lang.String fontFile,
java.lang.String typeface)
fontFile - the complete filename including the pathtypeface - the name by which the typeface is registered.
void ttcFileErrorMsg(GDD gdd,
java.lang.String fontFile)
java.lang.String[] lookupFontFilenames(java.lang.String typefaceName)
typefaceName - the typefaces
int computeItextStyle()
public boolean getBold()
public boolean getItalics()
public com.lowagie.text.Font getItextFont()
public java.lang.String getFace()
public float getSize()
public Source getSource()
public void setBold(boolean onOff,
Source newSource)
onOff - the new value for the italics settingnewSource - the file and line # of the token that changed italics
public void setItalics(boolean onOff,
Source newSource)
onOff - the new value for the italics settingnewSource - the file and line # of the token that changed italics
public void setSize(float newSize,
Source newSource)
public void setFace(java.lang.String newFace,
Source newSource)
|
Platypus | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||