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

[macosx] Text layout for AAT fonts ignores fractional metrics setting on macOS

    Details

    • Subcomponent:
      2d
    • CPU:
      generic
    • OS:
      os_x

      Description

      FULL PRODUCT VERSION :
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+151)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+151, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      macOS Sierra 10.12.2

      A DESCRIPTION OF THE PROBLEM :
      Text layout for AAT fonts on macOS ignores fractional metrics hint - result of layout always has floating-point advances, as if fractional metrics were enabled.

      REGRESSION. Last worked in version 8u112

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_112"
      Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
      Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run a sample program given below.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The first and the third line of output contain integer values.
      ACTUAL -
      Third line contains floating-point value.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.font.*;

      public class FontLayoutTest {
          public static void main(String[] args) {
              Font ttFont = new Font("Arial", Font.PLAIN, 12);
              Font aatFont = new Font("Menlo", Font.PLAIN, 12);
              String text = "a";
              FontRenderContext noFmFrc = new FontRenderContext(null, true, false);
              FontRenderContext fmFrc = new FontRenderContext(null, true, true);
              System.out.println(new TextLayout(text, ttFont, noFmFrc).getAdvance());
              System.out.println(new TextLayout(text, ttFont, fmFrc).getAdvance());
              System.out.println(new TextLayout(text, aatFont, noFmFrc).getAdvance());
              System.out.println(new TextLayout(text, aatFont, fmFrc).getAdvance());
          }
      }

      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                prr Philip Race
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: