Package org.xhtmlrenderer.swt
Class SWTTextRenderer
java.lang.Object
org.xhtmlrenderer.swt.SWTTextRenderer
- All Implemented Interfaces:
TextRenderer
Render text with SWT.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawGlyphVector(OutputDevice outputDevice, FSGlyphVector vector, float x, float y) voiddrawString(OutputDevice outputDevice, String string, float x, float y) voiddrawString(OutputDevice outputDevice, String string, float x, float y, JustificationInfo info) floatgetFSFontMetrics(FontContext context, FSFont font, String string) getGlyphBounds(OutputDevice outputDevice, FSFont font, FSGlyphVector fsGlyphVector, int index, float x, float y) float[]getGlyphPositions(OutputDevice outputDevice, FSFont font, FSGlyphVector fsGlyphVector) getGlyphVector(OutputDevice outputDevice, FSFont font, String string) intgetWidth(FontContext context, FSFont font, String string) voidsetFontScale(float scale) voidsetSmoothingThreshold(float fontsize) Set the smoothing threshold.voidsetup(FontContext context)
-
Field Details
-
_scale
private float _scale -
_antialiasing
private boolean _antialiasing
-
-
Constructor Details
-
SWTTextRenderer
public SWTTextRenderer()
-
-
Method Details
-
setup
- Specified by:
setupin interfaceTextRenderer
-
drawString
- Specified by:
drawStringin interfaceTextRenderer
-
getFSFontMetrics
@CheckReturnValue public FSFontMetrics getFSFontMetrics(FontContext context, FSFont font, String string) - Specified by:
getFSFontMetricsin interfaceTextRenderer
-
getWidth
- Specified by:
getWidthin interfaceTextRenderer
-
getFontScale
public float getFontScale()- Specified by:
getFontScalein interfaceTextRenderer
-
setFontScale
public void setFontScale(float scale) - Specified by:
setFontScalein interfaceTextRenderer
-
setSmoothingThreshold
public void setSmoothingThreshold(float fontsize) Description copied from interface:TextRendererSet the smoothing threshold. This is a font size above which all text will be anti-aliased. Text below this size will not be anti-aliased. Set to -1 for no antialiasing. Set to 0 for all antialiasing. Else, set to the threshold font size. does not take font scaling into account.- Specified by:
setSmoothingThresholdin interfaceTextRenderer
-
drawGlyphVector
- Specified by:
drawGlyphVectorin interfaceTextRenderer
-
drawString
public void drawString(OutputDevice outputDevice, String string, float x, float y, JustificationInfo info) - Specified by:
drawStringin interfaceTextRenderer
-
getGlyphBounds
public Rectangle getGlyphBounds(OutputDevice outputDevice, FSFont font, FSGlyphVector fsGlyphVector, int index, float x, float y) - Specified by:
getGlyphBoundsin interfaceTextRenderer
-
getGlyphPositions
public float[] getGlyphPositions(OutputDevice outputDevice, FSFont font, FSGlyphVector fsGlyphVector) - Specified by:
getGlyphPositionsin interfaceTextRenderer
-
getGlyphVector
- Specified by:
getGlyphVectorin interfaceTextRenderer
-