Package com.openhtmltopdf.extend
Interface TextRenderer
-
- All Known Implementing Classes:
Java2DTextRenderer
,PdfBoxTextRenderer
public interface TextRenderer
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description 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)
static java.lang.String
getEffectivePrintableString(java.lang.String input)
Returns a string containing printable characters only.float
getFontScale()
FSFontMetrics
getFSFontMetrics(FontContext context, FSFont font, java.lang.String string)
int
getSmoothingLevel()
int
getWidth(FontContext context, FSFont font, java.lang.String string)
Rarely need to use this method directly.void
setFontScale(float scale)
void
setSmoothingLevel(int level)
Deprecated.no-op, will be removed in a future release.void
setSmoothingThreshold(float fontsize)
Set the smoothing threashold.void
setup(FontContext context)
-
-
-
Method Detail
-
getEffectivePrintableString
static java.lang.String getEffectivePrintableString(java.lang.String input)
Returns a string containing printable characters only.- Parameters:
input
- The string can be null- Returns:
- The cleaned string or
null
if the input is null - See Also:
OpenUtil.isSafeFontCodePointToPrint(int)
-
setup
void setup(FontContext context)
-
drawString
void drawString(OutputDevice outputDevice, java.lang.String string, float x, float y)
-
drawString
void drawString(OutputDevice outputDevice, java.lang.String string, float x, float y, JustificationInfo info)
-
getFSFontMetrics
FSFontMetrics getFSFontMetrics(FontContext context, FSFont font, java.lang.String string)
-
getWidth
int getWidth(FontContext context, FSFont font, java.lang.String string)
Rarely need to use this method directly. Instead favorBreaker
static method instead.
-
setFontScale
void setFontScale(float scale)
-
getFontScale
float getFontScale()
-
setSmoothingThreshold
void setSmoothingThreshold(float fontsize)
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.
-
getSmoothingLevel
int getSmoothingLevel()
-
setSmoothingLevel
void setSmoothingLevel(int level)
Deprecated.no-op, will be removed in a future release. Anti-aliasing is now controlled via the smoothing threshhold.- Parameters:
level
- no-op
-
-