Top Methods
com.openhtmltopdf.extend

public Interface TextRenderer

Imports
com.openhtmltopdf.layout.Breaker, com.openhtmltopdf.render.FSFont, .FSFontMetrics, .JustificationInfo, com.openhtmltopdf.util.OpenUtil

Method Summary

Modifier and TypeMethod and Description
public void
drawString(OutputDevice outputDevice, String string, float x, float y)

public void
drawString(OutputDevice outputDevice, String string, float x, float y, JustificationInfo info)

public static String

Returns:

The cleaned string or null if the input is null
getEffectivePrintableString
(String
The string can be null
input
)

Returns a string containing printable characters only.

public float
public FSFontMetrics
getFSFontMetrics(FontContext context, FSFont font, String string)

public int
public int
getWidth(FontContext context, FSFont font, String string)

Rarely need to use this method directly.

public void
setFontScale(float scale)

public void
setSmoothingLevel(int
no-op
level
)
Deprecated no-op, will be removed in a future release. Anti-aliasing is now controlled via the smoothing threshhold.

public void
setSmoothingThreshold(float fontsize)

Set the smoothing threashold.

public void
setup(FontContext context)

Method Detail

drawStringback to summary
public void drawString(OutputDevice outputDevice, String string, float x, float y)
drawStringback to summary
public void drawString(OutputDevice outputDevice, String string, float x, float y, JustificationInfo info)
getEffectivePrintableStringback to summary
public static String getEffectivePrintableString(String input)

Returns a string containing printable characters only.

Parameters
input:String

The string can be null

Returns:String

The cleaned string or null if the input is null

See Also
com.openhtmltopdf.util.OpenUtil#isSafeFontCodePointToPrint(int)
getFontScaleback to summary
public float getFontScale()
getFSFontMetricsback to summary
public FSFontMetrics getFSFontMetrics(FontContext context, FSFont font, String string)
getSmoothingLevelback to summary
public int getSmoothingLevel()
getWidthback to summary
public int getWidth(FontContext context, FSFont font, String string)

Rarely need to use this method directly. Instead favor Breaker static method instead.

setFontScaleback to summary
public void setFontScale(float scale)
setSmoothingLevelback to summary
public 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:int

no-op

setSmoothingThresholdback to summary
public 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.

setupback to summary
public void setup(FontContext context)