Package de.rototor.pdfbox.graphics2d
Interface IPdfBoxGraphics2DFontTextDrawer
- All Known Implementing Classes:
PdfBoxGraphics2DFontTextDrawer
,PdfBoxGraphics2DFontTextDrawerDefaultFonts
,PdfBoxGraphics2DFontTextForcedDrawer
public interface IPdfBoxGraphics2DFontTextDrawer
Draw text using Fonts
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Enviroment for font based drawing of text -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDrawText
(AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) void
drawText
(AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env)
-
Method Details
-
canDrawText
boolean canDrawText(AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws IOException, FontFormatException - Parameters:
iterator
- Has the text and all its propertiesenv
- Environment- Returns:
- true when the given text can be fully drawn using fonts. return false to have the text drawn as vector shapes
- Throws:
IOException
- when a font can not be loaded or a paint can't be applied.FontFormatException
- when the font file can not be loaded
-
drawText
void drawText(AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws IOException, FontFormatException - Parameters:
iterator
- The text with all propertiesenv
- Environment- Throws:
IOException
- when a font can not be loaded or a paint can't be applied.FontFormatException
- when the font file can not be loaded
-
getFontMetrics
FontMetrics getFontMetrics(Font font, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws IOException, FontFormatException - Parameters:
font
- the Fontenv
- the Environment- Returns:
- the resulting font metrics
- Throws:
IOException
FontFormatException
-