JDK-8207941 : [TESTBUG] javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java fails on machines without Arial font
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2018-07-20
  • Updated: 2018-10-05
  • Resolved: 2018-07-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12
11.0.2Fixed 12 b04Fixed
Related Reports
Duplicate :  
Description
The jdk  jtreg test "javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java"  tests some
swing related functionality .
For some of the tests it relies on a special font .

The test chooses a font "Arial" in the getFont() method, but in case such a font is not available it falls back to 
fontNames[0] in the coding :

        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        String[] fontNames = ge.getAvailableFontFamilyNames();

This leads to failing tests because arbitrary fonts cannot be used in some of the subtests.
Suggested improvements :
- add warnings  in case preferred font Arial is not found
- provide fallback font choices "Bitstream Charter" and "Dialog"  in case Arial is not there;
those worked on our tests systems as well


errors we get in case Arial is not available :
java.lang.RuntimeException: String is not properly drawn!
java.lang.RuntimeException: Numeric shaper is not used!

(these issues have been observed on various Linux and AIX machines).
Comments
Fix request This is a test only fix; please bring it to jdk11u. The test change handles cases of machines without Arial Fonts installed, we have a few of those . I would like to get the tests for jdk11 green, especially as this is a LTS release and we will run these tests for a very long time. The patch applies cleanly.
02-10-2018