Synthesized replacement for FontMetrics.getAscent(), which is dreadfully inaccurate and inconsistent across platforms.
(Graphics g)
| 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) { |
no test coverage detected