|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itextpdf.awt.DefaultFontMapper
public class DefaultFontMapper
Default class to map awt fonts to BaseFont.
| Nested Class Summary | |
|---|---|
static class |
DefaultFontMapper.BaseFontParameters
A representation of BaseFont parameters. |
| Constructor Summary | |
|---|---|
DefaultFontMapper()
|
|
| Method Summary | |
|---|---|
BaseFont |
awtToPdf(java.awt.Font font)
Returns a BaseFont which can be used to represent the given AWT Font |
java.util.HashMap<java.lang.String,java.lang.String> |
getAliases()
|
DefaultFontMapper.BaseFontParameters |
getBaseFontParameters(java.lang.String name)
Looks for a BaseFont parameter associated with a name. |
java.util.HashMap<java.lang.String,DefaultFontMapper.BaseFontParameters> |
getMapper()
|
int |
insertDirectory(java.lang.String dir)
Inserts all the fonts recognized by iText in the directory into the map. |
int |
insertFile(java.io.File file)
Inserts one font file into the map. |
void |
insertNames(java.lang.Object[] allNames,
java.lang.String path)
Inserts the names in this map. |
java.awt.Font |
pdfToAwt(BaseFont font,
int size)
Returns an AWT Font which can be used to represent the given BaseFont |
void |
putAlias(java.lang.String alias,
java.lang.String awtName)
Maps an alias to a name. |
void |
putName(java.lang.String awtName,
DefaultFontMapper.BaseFontParameters parameters)
Maps a name to a BaseFont parameter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultFontMapper()
| Method Detail |
|---|
public BaseFont awtToPdf(java.awt.Font font)
awtToPdf in interface FontMapperfont - the font to be converted
public java.awt.Font pdfToAwt(BaseFont font,
int size)
pdfToAwt in interface FontMapperfont - the font to be convertedsize - the desired point size of the resulting font
public void putName(java.lang.String awtName,
DefaultFontMapper.BaseFontParameters parameters)
awtName - the nameparameters - the BaseFont parameter
public void putAlias(java.lang.String alias,
java.lang.String awtName)
alias - the aliasawtName - the namepublic DefaultFontMapper.BaseFontParameters getBaseFontParameters(java.lang.String name)
name - the name
null if not found.
public void insertNames(java.lang.Object[] allNames,
java.lang.String path)
allNames - the returned value of calling BaseFont.getAllFontNames(String, String, byte[])path - the full path to the fontpublic int insertFile(java.io.File file)
BaseFont.CP1252 but can be
changed later.
file - the file to insert
public int insertDirectory(java.lang.String dir)
directory into the map. The encoding
will be BaseFont.CP1252 but can be
changed later.
dir - the directory to scan
public java.util.HashMap<java.lang.String,DefaultFontMapper.BaseFontParameters> getMapper()
public java.util.HashMap<java.lang.String,java.lang.String> getAliases()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||