public class BaseFontSupport extends Object implements com.lowagie.text.pdf.FontMapper
Constructor and Description |
---|
BaseFontSupport(ITextFontRegistry registry)
Creates a new support instance.
|
BaseFontSupport(ITextFontRegistry registry,
String defaultEncoding) |
Modifier and Type | Method and Description |
---|---|
com.lowagie.text.pdf.BaseFont |
awtToPdf(Font font)
Returns a BaseFont which can be used to represent the given AWT Font
|
void |
close()
Close the font support.
|
com.lowagie.text.pdf.BaseFont |
createBaseFont(String logicalName,
boolean bold,
boolean italic,
String encoding,
boolean embedded)
Creates a iText-BaseFont for an font.
|
BaseFontRecord |
createBaseFontRecord(String logicalName,
boolean bold,
boolean italic,
String encoding,
boolean embedded)
Creates a BaseFontRecord for an font.
|
String |
getDefaultEncoding() |
boolean |
isEmbedFonts() |
Font |
pdfToAwt(com.lowagie.text.pdf.BaseFont font,
int size)
Returns an AWT Font which can be used to represent the given BaseFont
|
void |
setDefaultEncoding(String defaultEncoding) |
void |
setEmbedFonts(boolean embedFonts) |
public BaseFontSupport(ITextFontRegistry registry)
public BaseFontSupport(ITextFontRegistry registry, String defaultEncoding)
public String getDefaultEncoding()
public void setDefaultEncoding(String defaultEncoding)
public boolean isEmbedFonts()
public void setEmbedFonts(boolean embedFonts)
public void close()
public com.lowagie.text.pdf.BaseFont createBaseFont(String logicalName, boolean bold, boolean italic, String encoding, boolean embedded) throws BaseFontCreateException
logicalName
- the name of the font (null not permitted).bold
- a flag indicating whether the font is rendered as bold font.italic
- a flag indicating whether the font is rendered as italic or cursive font.encoding
- the encoding.embedded
- a flag indicating whether to embed the font glyphs in the generated documents.BaseFontCreateException
- if there was a problem setting the font for the target.public BaseFontRecord createBaseFontRecord(String logicalName, boolean bold, boolean italic, String encoding, boolean embedded) throws BaseFontCreateException
logicalName
- the name of the font (null not permitted).bold
- a flag indicating whether the font is rendered as bold font.italic
- a flag indicating whether the font is rendered as italic or cursive font.encoding
- the encoding.embedded
- a flag indicating whether to embed the font glyphs in the generated documents.BaseFontCreateException
- if there was a problem setting the font for the target.public com.lowagie.text.pdf.BaseFont awtToPdf(Font font)
awtToPdf
in interface com.lowagie.text.pdf.FontMapper
font
- the font to be convertedpublic Font pdfToAwt(com.lowagie.text.pdf.BaseFont font, int size)
pdfToAwt
in interface com.lowagie.text.pdf.FontMapper
font
- the font to be convertedsize
- the desired point size of the resulting fontCopyright © 2019 Hitachi Vantara. All rights reserved.