stringWidth
stringWidth: (FontMetrics, string) -> numberThe advance of str, in pixels.
JComponent.new():getFontMetrics(…)| Method | Returns | Description |
|---|---|---|
stringWidth(string) | number | The advance of str, in pixels. |
getHeight() | number | Ascent plus descent plus leading. |
getAscent() | number | The ascent. |
getDescent() | number | The descent. |
getLeading() | number | The leading. |
getMaxAscent() | number | The largest ascent. |
getMaxDescent() | number | The largest descent. |
getMaxAdvance() | number | The largest advance. |
getFont() | Font | The font measured. |
getStringBounds(string, any) | Rectangle2D | The logical bounds of str from its baseline origin. Pass the Graphics2D; the metrics already carry its context. |
| Method | Returns | Description |
|---|---|---|
Graphics.getFontMetrics | FontMetrics | (Graphics) -> FontMetrics: The metrics of the current font, under the current text antialiasing. |
JComponent.getFontMetrics | FontMetrics | The metrics font measures with in a component: the look's text rendering (the fonts antialiased as their gasp table says), so a width c… |
stringWidthstringWidth: (FontMetrics, string) -> numberThe advance of str, in pixels.
getHeightgetHeight: (FontMetrics) -> numberAscent plus descent plus leading.
getAscentgetAscent: (FontMetrics) -> numberThe ascent.
getDescentgetDescent: (FontMetrics) -> numberThe descent.
getLeadinggetLeading: (FontMetrics) -> numberThe leading.
getMaxAscentgetMaxAscent: (FontMetrics) -> numberThe largest ascent.
getMaxDescentgetMaxDescent: (FontMetrics) -> numberThe largest descent.
getMaxAdvancegetMaxAdvance: (FontMetrics) -> numberThe largest advance.
getFontgetFont: (FontMetrics) -> FontThe font measured.
getStringBoundsgetStringBounds: (FontMetrics, string, any) -> Rectangle2DThe logical bounds of str from its baseline origin. Pass the Graphics2D; the metrics already carry its context.