Package com.openhtmltopdf.pdfboxout
Class PdfBoxTextRenderer
java.lang.Object
com.openhtmltopdf.pdfboxout.PdfBoxTextRenderer
- All Implemented Interfaces:
TextRenderer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private boolean
private BidiReorderer
private static float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<PdfBoxSlowOutputDevice.FontRun> divideIntoFontRuns
(FSFont font, String str, BidiReorderer reorderer) void
drawString
(OutputDevice outputDevice, String string, float x, float y) void
drawString
(OutputDevice outputDevice, String string, float x, float y, JustificationInfo info) float
getFSFontMetrics
(FontContext context, FSFont font, String string) private static PdfBoxTextRenderer.ReplacementChar
getReplacementChar
(FSFont font) int
private float
getStringWidthSlow
(FSFont bf, String str) int
getWidth
(FontContext context, FSFont font, String string) Rarely need to use this method directly.static boolean
isJustificationSpace
(int c) void
setFontScale
(float scale) void
setSmoothingLevel
(int level) Deprecated.void
setSmoothingThreshold
(float fontsize) Set the smoothing threashold.void
setup
(FontContext context) void
setup
(FontContext context, BidiReorderer reorderer)
-
Field Details
-
TEXT_MEASURING_DELTA
private static float TEXT_MEASURING_DELTA -
_reorderer
-
_loggedMissingFont
private boolean _loggedMissingFont -
_loggedMissingMetrics
private boolean _loggedMissingMetrics
-
-
Constructor Details
-
PdfBoxTextRenderer
public PdfBoxTextRenderer()
-
-
Method Details
-
setup
-
drawString
- Specified by:
drawString
in interfaceTextRenderer
-
drawString
public void drawString(OutputDevice outputDevice, String string, float x, float y, JustificationInfo info) - Specified by:
drawString
in interfaceTextRenderer
-
getFSFontMetrics
- Specified by:
getFSFontMetrics
in interfaceTextRenderer
-
isJustificationSpace
public static boolean isJustificationSpace(int c) -
getReplacementChar
-
divideIntoFontRuns
public static List<PdfBoxSlowOutputDevice.FontRun> divideIntoFontRuns(FSFont font, String str, BidiReorderer reorderer) -
getStringWidthSlow
-
getWidth
Description copied from interface:TextRenderer
Rarely need to use this method directly. Instead favorBreaker
static method instead.- Specified by:
getWidth
in interfaceTextRenderer
-
setFontScale
public void setFontScale(float scale) - Specified by:
setFontScale
in interfaceTextRenderer
-
getFontScale
public float getFontScale()- Specified by:
getFontScale
in interfaceTextRenderer
-
setSmoothingThreshold
public void setSmoothingThreshold(float fontsize) Description copied from interface:TextRenderer
Set 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:
setSmoothingThreshold
in interfaceTextRenderer
-
getSmoothingLevel
public int getSmoothingLevel()- Specified by:
getSmoothingLevel
in interfaceTextRenderer
-
setSmoothingLevel
Deprecated.- Specified by:
setSmoothingLevel
in interfaceTextRenderer
- Parameters:
level
- no-op
-
setup
- Specified by:
setup
in interfaceTextRenderer
-