JDK-8172960 : [macosx] Text layout for AAT fonts ignores fractional metrics setting on macOS
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: generic
  • Submitted: 2017-01-12
  • Updated: 2017-01-19
  • Resolved: 2017-01-18
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 9
9Resolved
Related Reports
Duplicate :  
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 ----------


Comments
https://bugs.openjdk.java.net/browse/JDK-8144012
18-01-2017

Verified the issue against 8u112,9ea+152 on MacOS,Windows,Linux and could reproduce the issue against 9ea+152 on MacOS only, but could not on Windows/Linux . Steps to reproduce(javac): ************************** - Run the attached file(FontLayoutTest.java) with JDK. Result: ********* OS : macOS Sierra version 10.12 [Mac mini(Late 2014)] JDK (MacOS): ++++++++++++++ 8u112 b15 : Pass 9ea+152 : Fail ================================================================ Output: ********* dcsusr$ java -version java version "9-ea" Java(TM) SE Runtime Environment (build 9-ea+152) Java HotSpot(TM) 64-Bit Server VM (build 9-ea+152, mixed mode) dcsusr$ javac FontLayoutTest.java dcsusr$ java FontLayoutTest 7.0 6.673828 7.2246094 7.2246094 --------------------------------------------------------------------------------------------------- JDK 8u112: ************* dcsusr$ javac FontLayoutTest.java dcsusr$ java FontLayoutTest 7.0 6.673828 7.0 6.673828
18-01-2017