-
Bug
-
Resolution: Duplicate
-
P4
-
11
-
None
javax/swing/text/Utilities/8142966/SwingFontMetricsTest.java is failing on
windows since JDK 11 b05.
That build introduced freetype to Oracle JDK and if run the
test with -Dsun.java2d.font.scaler=t2k it passes.
The core of the test is to compare the width of the text for a JLabel
as measured by (1) The component, (2) the graphics.
Font font = getFont();
int width1 = getFontMetrics(font).stringWidth(TEXT);
int width2 = g.getFontMetrics(font).stringWidth(TEXT);
The test specifies -Dsun.java2d.uiScale=2 but it even fails if
I specify -Dsun.java2d.uiScale=1 so it is not (just) a hi dpi issue.
Need to look at how Swing is measuring the text since the
component should report the same as the graphics.
windows since JDK 11 b05.
That build introduced freetype to Oracle JDK and if run the
test with -Dsun.java2d.font.scaler=t2k it passes.
The core of the test is to compare the width of the text for a JLabel
as measured by (1) The component, (2) the graphics.
Font font = getFont();
int width1 = getFontMetrics(font).stringWidth(TEXT);
int width2 = g.getFontMetrics(font).stringWidth(TEXT);
The test specifies -Dsun.java2d.uiScale=2 but it even fails if
I specify -Dsun.java2d.uiScale=1 so it is not (just) a hi dpi issue.
Need to look at how Swing is measuring the text since the
component should report the same as the graphics.
- duplicates
-
JDK-8199529 javax/swing/text/Utilities/8142966/SwingFontMetricsTest.java fails on windows
- Resolved