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.
8u102Fixed 9 b114Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Steps to reproduce:

Run the code:
import javax.swing.*;

public class JMenuTest {

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            try {
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            JFrame frame = new JFrame();
            frame.setSize(200, 200);
            JMenuBar menuBar = new JMenuBar();
            menuBar.add(new JMenu("Test 1"));
            menuBar.add(new JMenu("Test 2"));

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.
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.

See the attached screenshot.