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

[macosx] LCD Rendering hints seems not working without FRACTIONALMETRICS=ON

XMLWordPrintable

    • 2d
    • b70
    • os_x

        Run the attached AntialiasDemo.java on Mac. By default, antialias hints set to OFF in this demo.

        Note that desktop settings is ON, not some LCD, regardless of monitor, be it a generic old Sony or iMac.
        It's easy to see that fonts have grayscale antialiasing in Swing component by default.

        Change the value in Demo to LCD_HRGB and play with size of the "The sky is blue": apparently hint is still ON, and hinting gray.

        Now, add somewhere to line 524 in demo a line
        g2Image.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); compile and run again.

        All of a sudden LCD_HRGB start working, and letters in the sample have visible color tint.

        Now, is it a bug? Shouldn't LCD hints be default on Mac for Swing?

        It's not a regression, I believe, not between 7 and 8 releases.

        2D_Font/SwingAntialiasLCDTextTest

              bae Andrew Brygin
              yan Yuri Nesterenko
              Votes:
              0 Vote for this issue
              Watchers:
              18 Start watching this issue

                Created:
                Updated:
                Resolved: