Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8076545

Text size is twice bigger under Windows L&F on Win 8.1 with HiDPI display

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Environment:

      JDK 1.9.0 (build 1.9.0-ea-fastdebug-b52)

      Windows 8.1 with HiDPI display

    • Subcomponent:
      2d
    • Resolved In Build:
      b114
    • OS:
      windows_8

      Backports

        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.

          Issue Links

            Activity

            Hide
            alexsch Alexander Scherbatiy (Inactive) added a comment -
            See the attached screenshot.
            Show
            alexsch Alexander Scherbatiy (Inactive) added a comment - See the attached screenshot.
            Hide
            prr Philip Race added a comment -
            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.
            Show
            prr Philip Race added a comment - 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.
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/4c4c633ca2c1
            User: alexsch
            Date: 2016-03-15 16:17:10 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/4c4c633ca2c1 User: alexsch Date: 2016-03-15 16:17:10 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/4c4c633ca2c1
            User: lana
            Date: 2016-04-13 17:56:05 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/4c4c633ca2c1 User: lana Date: 2016-04-13 17:56:05 +0000

              People

              • Assignee:
                alexsch Alexander Scherbatiy (Inactive)
                Reporter:
                alexsch Alexander Scherbatiy (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: