JDK-8247293 : Rotated text does not italicize correctly in JDK 11 with added Fonts folder with lucida fonts
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 11
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2020-06-08
  • Updated: 2020-06-17
  • Resolved: 2020-06-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.
JDK 11
11-poolResolved
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
Rotated text does not italicize correctly in 11.0.4 but works good in 11.0.3

REGRESSION : Last worked in version 8

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please execute the sample code given

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Text should be italicized  
ACTUAL -
Text is italicized but lost alignment

---------- BEGIN SOURCE ----------
package org.kodejava.example.geom;
 
import javax.swing.*;
import java.awt.*;
import java.awt.geom.AffineTransform;
 
public class CheckFontRotation extends JPanel {
    @Override
    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;
 
        // Define rendering hint, font name, font style and font size
        //g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2.setFont(new Font("Lucida Sans", Font.ITALIC, 22));
        g2.setColor(Color.RED);
 
        // Rotate 90 degree to make a vertical text
        AffineTransform at = new AffineTransform();
        at.setToRotation(Math.toRadians(90), 80, 100);
        g2.setTransform(at);
        g2.drawString("This is a vertical text", 10, 10);
    }
 
    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setTitle("Draw Vertical Text Demo");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.add(new CheckFontRotation());
        frame.pack();
        frame.setSize(420, 350);
        frame.setVisible(true);
    }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
Note from submitter: This issue is reproducible even without lib/fonts directory for the below fonts 1.MS Mincho (font needs to be installed manually) 2.Gadugi
17-06-2020

PS I don't see what difference it makes being in the lib/fonts folder. The "JDK rasteriser" ie freetype in JDK 11 and later will be used in the cases in the test program no matter where it is. If using LCD texf then it would however matter - GDI would be used unless the font is in the JDK's font folder - or loaded using Font.loadFont.
15-06-2020

This looks like a duplicate of JDK-8210058. Not exactly the same description but resolved by the fix for that bug.
15-06-2020

Checked this again as a follow up to additional note from submitter, "Please pick lib/fonts from earlier java version(lucida sans) and place it in jdk11.0.4 and this is reproducible". Added lib/fonts from previous version and placed in the specific directory, say jdk-11.0.4\lib\fonts This is Issue is reproducible with JDK 11 including JDK 11.0.7 when fonts directory is made available as lib/fonts. See attached image as reference result. Result: ====== 8u251: OK 10: OK 11: Fail 11.0.7: Fail 14.0.1: OK 15 ea b26: OK Apparently the change was made into JDK 11 w.r.t fonts directory availability. Issue does not reproduce with default directory structure. Not sure if we can consider this as an issue. Rotated text does italicize correctly in JDK 14 and 15 though.
11-06-2020

Reported as a regression in JDK 11.0.4, where rotated text text rotated fails to italicize correctly while working fine with JDK 11.0.3. Did a check with attached test case with reported JDK versions but couldn't reproduce the issue. See attached image as a result reference. Meanwhile, written back to the submitter to provide additional information if any to be able to reproduce this issue as reported.
10-06-2020