java.lang.Object
com.lowagie.text.pdf.LayoutProcessor
Provides glyph layout e.g. for accented Latin letters.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic GlyphVectorcomputeGlyphVector(BaseFont baseFont, float fontSize, String text) Computes glyph positioningstatic voiddisable()static voidenable()Enables the processor.static voidenable(int flags) Enables the processor with the provided flags.static voidEnables the processor.static voidenableKernLiga(int flags) Enables the processor with the provided flags.static intgetFlags()static LayoutProcessor.VersionReturns the currennt versionstatic booleanstatic booleanisSet(int queryFlags) static voidLoads the AWT font needed for layoutstatic voidSet kerningstatic voidsetKerning(Font font) Set kerning for one fontstatic voidAdd ligaturesstatic voidsetLigatures(Font font) Set ligatures for one fontstatic voidsetRunDirectionLtr(Font font) Set run direction for one font to LTRstatic voidsetRunDirectionRtl(Font font) Set run direction for one font to RTLstatic voidsetVersion(LayoutProcessor.Version version) Deprecated.To be used *only*, if version two produces incorrect PDF - please file an issue if this occursstatic voidInclude ACTUALTEXT in PDFstatic Point2DshowText(PdfContentByte cb, BaseFont baseFont, float fontSize, String text) Shows a text using glyph positioning (if needed)static booleansupportsFont(BaseFont baseFont)
-
Method Details
-
enable
public static void enable()Enables the processor.Kerning and ligatures are switched off. This method can only be called once.
-
enable
public static void enable(int flags) Enables the processor with the provided flags.Kerning and ligatures are switched off. This method can only be called once.
- Parameters:
flags- see java.awt.Font.layoutGlyphVector
-
enableKernLiga
public static void enableKernLiga()Enables the processor.Kerning and ligatures are switched on. This method can only be called once.
-
enableKernLiga
public static void enableKernLiga(int flags) Enables the processor with the provided flags.Kerning and ligatures are switched on. This method can only be called once.
- Parameters:
flags- see java.awt.Font.layoutGlyphVector
-
isEnabled
public static boolean isEnabled() -
setVersion
Deprecated.To be used *only*, if version two produces incorrect PDF - please file an issue if this occursSet version- Parameters:
version- to set
-
setKerning
public static void setKerning()Set kerning- See Also:
-
setKerning
Set kerning for one font- Parameters:
font- The font for which kerning is to be turned on- See Also:
-
setLigatures
public static void setLigatures()Add ligatures -
setLigatures
Set ligatures for one font- Parameters:
font- The font for which ligatures are to be turned on
-
setRunDirectionRtl
Set run direction for one font to RTL- Parameters:
font- The font for which the run direction is set
-
setRunDirectionLtr
Set run direction for one font to LTR- Parameters:
font- The font for which the run direction is set
-
setWriteActualText
public static void setWriteActualText()Include ACTUALTEXT in PDF -
getFlags
public static int getFlags() -
getVersion
Returns the currennt version- Returns:
- current version
-
isSet
public static boolean isSet(int queryFlags) -
supportsFont
-
loadFont
Loads the AWT font needed for layoutIf baseFont is not instanceof TrueTypeFontUnicode *no* font is loaded.
- Parameters:
baseFont- OpenPdf base fontfilename- of the font file- Throws:
RuntimeException- if font can not be loaded
-
computeGlyphVector
Computes glyph positioning- Parameters:
baseFont- OpenPdf base fonttext- input text- Returns:
- glyph vector containing reordered text, width and positioning info
-
showText
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
-
disable
public static void disable()
-