java.lang.Object
java.awt.FontMetrics
org.jfree.fx.FXFontMetrics
- All Implemented Interfaces:
Serializable
public class FXFontMetrics extends FontMetrics
A font metrics implementation for JavaFX. This uses the JavaFX APIs to
get font measurements, which is more exact than relying on the equivalent
Java2D APIs.
- Since:
- 1.5
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FXFontMetrics(Font font, Graphics2D g2)Creates a new instance. -
Method Summary
Modifier and Type Method Description Rectangle2DgetStringBounds(char[] chars, int beginIndex, int limit, Graphics context)Rectangle2DgetStringBounds(String str, int beginIndex, int limit, Graphics context)Rectangle2DgetStringBounds(String str, Graphics context)Rectangle2DgetStringBounds(CharacterIterator ci, int beginIndex, int limit, Graphics context)intstringWidth(String str)Methods inherited from class java.awt.FontMetrics
bytesWidth, charsWidth, charWidth, charWidth, getAscent, getDescent, getFont, getFontRenderContext, getHeight, getLeading, getLineMetrics, getLineMetrics, getLineMetrics, getLineMetrics, getMaxAdvance, getMaxAscent, getMaxCharBounds, getMaxDecent, getMaxDescent, getWidths, hasUniformLineMetrics, toString
-
Constructor Details
-
FXFontMetrics
Creates a new instance.- Parameters:
font- the font (nullnot permitted).g2- the graphics target (nullnot permitted).
-
-
Method Details
-
getStringBounds
public Rectangle2D getStringBounds(CharacterIterator ci, int beginIndex, int limit, Graphics context)- Overrides:
getStringBoundsin classFontMetrics
-
getStringBounds
- Overrides:
getStringBoundsin classFontMetrics
-
getStringBounds
- Overrides:
getStringBoundsin classFontMetrics
-
getStringBounds
- Overrides:
getStringBoundsin classFontMetrics
-
stringWidth
- Overrides:
stringWidthin classFontMetrics
-