JDK-8076545 : Text size is twice bigger under Windows L&F on Win 8.1 with HiDPI display
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_8
  • Submitted: 2015-04-02
  • Updated: 2016-08-31
  • Resolved: 2016-03-15
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 8 JDK 9
8u102Fixed 9 b114Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Steps to reproduce:

Run the code:
----------------------- 
import javax.swing.*;

public class JMenuTest {

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            try {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
            JFrame frame = new JFrame();
            frame.setSize(200, 200);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JMenuBar menuBar = new JMenuBar();
            menuBar.add(new JMenu("Test 1"));
            menuBar.add(new JMenu("Test 2"));
            frame.setJMenuBar(menuBar);
            frame.setVisible(true);
        });
    }
}
----------------------- 

Compare the menu text with the sample which is run with the Metal L&F.
The text with the Windows L&F is twice bigger than the text with the Metal L&F.
Comments
We discussed this in a bug/thread some months ago but I cannot locate it. The gist of the analysis then was that for the Win L&F we pick up the font size in pixels from GDI So if the image is too large then we have a mismatch of handling the scale somewhere that may not be anything directly to do with the font code.
03-04-2015

See the attached screenshot.
02-04-2015