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 Classes Modifier and Type Interface Description static interface
IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv
Enviroment for font based drawing of text
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canDrawText(java.text.AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env)
void
drawText(java.text.AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env)
java.awt.FontMetrics
getFontMetrics(java.awt.Font font, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env)
-
-
-
Method Detail
-
canDrawText
boolean canDrawText(java.text.AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws java.io.IOException, java.awt.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:
java.io.IOException
- when a font can not be loaded or a paint can't be applied.java.awt.FontFormatException
- when the font file can not be loaded
-
drawText
void drawText(java.text.AttributedCharacterIterator iterator, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws java.io.IOException, java.awt.FontFormatException
- Parameters:
iterator
- The text with all propertiesenv
- Environment- Throws:
java.io.IOException
- when a font can not be loaded or a paint can't be applied.java.awt.FontFormatException
- when the font file can not be loaded
-
getFontMetrics
java.awt.FontMetrics getFontMetrics(java.awt.Font font, IPdfBoxGraphics2DFontTextDrawer.IFontTextDrawerEnv env) throws java.io.IOException, java.awt.FontFormatException
- Parameters:
font
- the Fontenv
- the Environment- Returns:
- the resulting font metrics
- Throws:
java.io.IOException
java.awt.FontFormatException
-
-