Package com.lowagie.text.pdf
Class LayoutProcessor
- java.lang.Object
-
- com.lowagie.text.pdf.LayoutProcessor
-
public class LayoutProcessor extends Object
Provides glyph layout e.g. for accented Latin letters.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GlyphVectorcomputeGlyphVector(BaseFont baseFont, float fontSize, String text)Computes glyph positioningstatic voidenable()Enables the processorstatic voidenable(int flags)Enables the processor providing flags This method can only be called once.static intgetFlags()static booleanisEnabled()static booleanisSet(int queryFlags)static voidloadFont(BaseFont baseFont, String filename)Loads the AWT font needed for layoutstatic Point2DshowText(PdfContentByte cb, BaseFont baseFont, float fontSize, String text)Shows a text using glyph positioning (if needed)static booleansupportsFont(BaseFont baseFont)
-
-
-
Method Detail
-
enable
public static void enable()
Enables the processor
-
enable
public static void enable(int flags)
Enables the processor providing flags This method can only be called once.- Parameters:
flags- see java.awt.Font.layoutGlyphVector
-
isEnabled
public static boolean isEnabled()
-
getFlags
public static int getFlags()
-
isSet
public static boolean isSet(int queryFlags)
-
supportsFont
public static boolean supportsFont(BaseFont baseFont)
-
loadFont
public static void loadFont(BaseFont baseFont, String filename)
Loads the AWT font needed for layout- Parameters:
baseFont- OpenPdf base fontfilename- of the font file- Throws:
RuntimeException- if font can not be loaded
-
computeGlyphVector
public static GlyphVector computeGlyphVector(BaseFont baseFont, float fontSize, String text)
Computes glyph positioning- Parameters:
baseFont- OpenPdf base fonttext- input text- Returns:
- glyph vector containing reordered text, width and positioning info
-
showText
public static Point2D showText(PdfContentByte cb, BaseFont baseFont, float fontSize, String text)
Shows a text using glyph positioning (if needed)- Parameters:
cb- object containing the content of the pagebaseFont- base font to usefontSize- font size to applytext- text to show- Returns:
- layout position correction to correct the start of the next line
-
-