MCPcopy Index your code
hub / github.com/benfry/processing4 / getAscent

Method getAscent

app/src/processing/app/ui/Toolkit.java:1375–1380  ·  view source on GitHub ↗

Synthesized replacement for FontMetrics.getAscent(), which is dreadfully inaccurate and inconsistent across platforms.

(Graphics g)

Source from the content-addressed store, hash-verified

1373 * inaccurate and inconsistent across platforms.
1374 */
1375 static public double getAscent(Graphics g) {
1376 Graphics2D g2 = (Graphics2D) g;
1377 FontRenderContext frc = g2.getFontRenderContext();
1378 //return new TextLayout("H", font, frc).getBounds().getHeight();
1379 return new TextLayout("H", g.getFont(), frc).getBounds().getHeight();
1380 }
1381
1382
1383 static public String formatMessage(String message) {

Callers 11

paintComponentMethod · 0.95
paintComponentMethod · 0.95
paintComponentMethod · 0.95
getFontAscentMethod · 0.80
PFontMethod · 0.80
paintComponentMethod · 0.80
drawMethod · 0.80
paintTextMethod · 0.80
paintComponentMethod · 0.80
updateThemeMethod · 0.80
paintMethod · 0.80

Calls 3

getFontRenderContextMethod · 0.45
getHeightMethod · 0.45
getFontMethod · 0.45

Tested by

no test coverage detected