Class BaseFontSupport
java.lang.Object
org.pentaho.reporting.libraries.fonts.itext.BaseFontSupport
- All Implemented Interfaces:
com.lowagie.text.pdf.FontMapper
iText font support.
- Author:
- Thomas Morgner
-
Constructor Summary
ConstructorDescriptionBaseFontSupport
(ITextFontRegistry registry) Creates a new support instance.BaseFontSupport
(ITextFontRegistry registry, String defaultEncoding) -
Method Summary
Modifier and TypeMethodDescriptioncom.lowagie.text.pdf.BaseFont
Returns a BaseFont which can be used to represent the given AWT Fontvoid
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.createBaseFontRecord
(String logicalName, boolean bold, boolean italic, String encoding, boolean embedded) Creates a BaseFontRecord for an font.boolean
pdfToAwt
(com.lowagie.text.pdf.BaseFont font, int size) Returns an AWT Font which can be used to represent the given BaseFontvoid
setDefaultEncoding
(String defaultEncoding) void
setEmbedFonts
(boolean embedFonts)
-
Constructor Details
-
BaseFontSupport
Creates a new support instance. -
BaseFontSupport
-
-
Method Details
-
getDefaultEncoding
-
setDefaultEncoding
-
isEmbedFonts
public boolean isEmbedFonts() -
setEmbedFonts
public void setEmbedFonts(boolean embedFonts) -
close
public void close()Close the font support. -
createBaseFont
public com.lowagie.text.pdf.BaseFont createBaseFont(String logicalName, boolean bold, boolean italic, String encoding, boolean embedded) throws BaseFontCreateException Creates a iText-BaseFont for an font. If no basefont could be created, an BaseFontCreateException is thrown.- Parameters:
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.- Returns:
- the base font record.
- Throws:
BaseFontCreateException
- if there was a problem setting the font for the target.
-
createBaseFontRecord
public BaseFontRecord createBaseFontRecord(String logicalName, boolean bold, boolean italic, String encoding, boolean embedded) throws BaseFontCreateException Creates a BaseFontRecord for an font. If no basefont could be created, an BaseFontCreateException is thrown.- Parameters:
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.- Returns:
- the base font record.
- Throws:
BaseFontCreateException
- if there was a problem setting the font for the target.
-
awtToPdf
Returns a BaseFont which can be used to represent the given AWT Font- Specified by:
awtToPdf
in interfacecom.lowagie.text.pdf.FontMapper
- Parameters:
font
- the font to be converted- Returns:
- a BaseFont which has similar properties to the provided Font
-
pdfToAwt
Returns an AWT Font which can be used to represent the given BaseFont- Specified by:
pdfToAwt
in interfacecom.lowagie.text.pdf.FontMapper
- Parameters:
font
- the font to be convertedsize
- the desired point size of the resulting font- Returns:
- a Font which has similar properties to the provided BaseFont
-