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 TypeMethodDescriptionvoid
drawGlyphVector
(OutputDevice outputDevice, FSGlyphVector vector, float x, float y) 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) 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) int
getWidth
(FontContext context, FSFont font, String string) void
setFontScale
(float scale) void
setSmoothingThreshold
(float fontsize) Set the smoothing threshold.void
setup
(FontContext context)
-
Field Details
-
_scale
private float _scale -
_antialiasing
private boolean _antialiasing
-
-
Constructor Details
-
SWTTextRenderer
public SWTTextRenderer()
-
-
Method Details
-
setup
- Specified by:
setup
in interfaceTextRenderer
-
drawString
- Specified by:
drawString
in interfaceTextRenderer
-
getFSFontMetrics
- Specified by:
getFSFontMetrics
in interfaceTextRenderer
-
getWidth
- Specified by:
getWidth
in interfaceTextRenderer
-
getFontScale
public float getFontScale()- Specified by:
getFontScale
in interfaceTextRenderer
-
setFontScale
public void setFontScale(float scale) - Specified by:
setFontScale
in interfaceTextRenderer
-
setSmoothingThreshold
public void setSmoothingThreshold(float fontsize) Description copied from interface:TextRenderer
Set 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:
setSmoothingThreshold
in interfaceTextRenderer
-
drawGlyphVector
- Specified by:
drawGlyphVector
in interfaceTextRenderer
-
drawString
public void drawString(OutputDevice outputDevice, String string, float x, float y, JustificationInfo info) - Specified by:
drawString
in interfaceTextRenderer
-
getGlyphBounds
public Rectangle getGlyphBounds(OutputDevice outputDevice, FSFont font, FSGlyphVector fsGlyphVector, int index, float x, float y) - Specified by:
getGlyphBounds
in interfaceTextRenderer
-
getGlyphPositions
public float[] getGlyphPositions(OutputDevice outputDevice, FSFont font, FSGlyphVector fsGlyphVector) - Specified by:
getGlyphPositions
in interfaceTextRenderer
-
getGlyphVector
- Specified by:
getGlyphVector
in interfaceTextRenderer
-