Package com.openhtmltopdf.pdfboxout
Class PdfBoxTextRenderer
- java.lang.Object
-
- com.openhtmltopdf.pdfboxout.PdfBoxTextRenderer
-
- All Implemented Interfaces:
TextRenderer
public class PdfBoxTextRenderer extends java.lang.Object implements TextRenderer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPdfBoxTextRenderer.ReplacementChar
-
Field Summary
Fields Modifier and Type Field Description private boolean_loggedMissingFontprivate boolean_loggedMissingMetricsprivate BidiReorderer_reordererprivate static floatTEXT_MEASURING_DELTA
-
Constructor Summary
Constructors Constructor Description PdfBoxTextRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.List<PdfBoxSlowOutputDevice.FontRun>divideIntoFontRuns(FSFont font, java.lang.String str, BidiReorderer reorderer)voiddrawString(OutputDevice outputDevice, java.lang.String string, float x, float y)voiddrawString(OutputDevice outputDevice, java.lang.String string, float x, float y, JustificationInfo info)floatgetFontScale()FSFontMetricsgetFSFontMetrics(FontContext context, FSFont font, java.lang.String string)private static PdfBoxTextRenderer.ReplacementChargetReplacementChar(FSFont font)intgetSmoothingLevel()private floatgetStringWidthSlow(FSFont bf, java.lang.String str)intgetWidth(FontContext context, FSFont font, java.lang.String string)Rarely need to use this method directly.static booleanisJustificationSpace(int c)voidsetFontScale(float scale)voidsetSmoothingLevel(int level)Deprecated.voidsetSmoothingThreshold(float fontsize)Set the smoothing threashold.voidsetup(FontContext context)voidsetup(FontContext context, BidiReorderer reorderer)
-
-
-
Field Detail
-
TEXT_MEASURING_DELTA
private static float TEXT_MEASURING_DELTA
-
_reorderer
private BidiReorderer _reorderer
-
_loggedMissingFont
private boolean _loggedMissingFont
-
_loggedMissingMetrics
private boolean _loggedMissingMetrics
-
-
Method Detail
-
setup
public void setup(FontContext context, BidiReorderer reorderer)
-
drawString
public void drawString(OutputDevice outputDevice, java.lang.String string, float x, float y)
- Specified by:
drawStringin interfaceTextRenderer
-
drawString
public void drawString(OutputDevice outputDevice, java.lang.String string, float x, float y, JustificationInfo info)
- Specified by:
drawStringin interfaceTextRenderer
-
getFSFontMetrics
public FSFontMetrics getFSFontMetrics(FontContext context, FSFont font, java.lang.String string)
- Specified by:
getFSFontMetricsin interfaceTextRenderer
-
isJustificationSpace
public static boolean isJustificationSpace(int c)
-
getReplacementChar
private static PdfBoxTextRenderer.ReplacementChar getReplacementChar(FSFont font)
-
divideIntoFontRuns
public static java.util.List<PdfBoxSlowOutputDevice.FontRun> divideIntoFontRuns(FSFont font, java.lang.String str, BidiReorderer reorderer)
-
getStringWidthSlow
private float getStringWidthSlow(FSFont bf, java.lang.String str)
-
getWidth
public int getWidth(FontContext context, FSFont font, java.lang.String string)
Description copied from interface:TextRendererRarely need to use this method directly. Instead favorBreakerstatic method instead.- Specified by:
getWidthin interfaceTextRenderer
-
setFontScale
public void setFontScale(float scale)
- Specified by:
setFontScalein interfaceTextRenderer
-
getFontScale
public float getFontScale()
- Specified by:
getFontScalein interfaceTextRenderer
-
setSmoothingThreshold
public void setSmoothingThreshold(float fontsize)
Description copied from interface:TextRendererSet the smoothing threashold. This is a font size above which all text will be anti-aliased. Text below this size will not be antialiased. Set to -1 for no antialiasing. Set to 0 for all antialising. Else, set to the threshold font size. does not take font scaling into account.- Specified by:
setSmoothingThresholdin interfaceTextRenderer
-
getSmoothingLevel
public int getSmoothingLevel()
- Specified by:
getSmoothingLevelin interfaceTextRenderer
-
setSmoothingLevel
@Deprecated public void setSmoothingLevel(int level)
Deprecated.- Specified by:
setSmoothingLevelin interfaceTextRenderer- Parameters:
level- no-op
-
setup
public void setup(FontContext context)
- Specified by:
setupin interfaceTextRenderer
-
-