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 class
PdfBoxTextRenderer.ReplacementChar
-
Field Summary
Fields Modifier and Type Field Description private boolean
_loggedMissingFont
private boolean
_loggedMissingMetrics
private BidiReorderer
_reorderer
private static float
TEXT_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)
void
drawString(OutputDevice outputDevice, java.lang.String string, float x, float y)
void
drawString(OutputDevice outputDevice, java.lang.String string, float x, float y, JustificationInfo info)
float
getFontScale()
FSFontMetrics
getFSFontMetrics(FontContext context, FSFont font, java.lang.String string)
private static PdfBoxTextRenderer.ReplacementChar
getReplacementChar(FSFont font)
int
getSmoothingLevel()
private float
getStringWidthSlow(FSFont bf, java.lang.String str)
int
getWidth(FontContext context, FSFont font, java.lang.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 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:
drawString
in interfaceTextRenderer
-
drawString
public void drawString(OutputDevice outputDevice, java.lang.String string, float x, float y, JustificationInfo info)
- Specified by:
drawString
in interfaceTextRenderer
-
getFSFontMetrics
public FSFontMetrics getFSFontMetrics(FontContext context, FSFont font, java.lang.String string)
- Specified by:
getFSFontMetrics
in 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: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 public void setSmoothingLevel(int level)
Deprecated.- Specified by:
setSmoothingLevel
in interfaceTextRenderer
- Parameters:
level
- no-op
-
setup
public void setup(FontContext context)
- Specified by:
setup
in interfaceTextRenderer
-
-