JDK-8210058 : Algorithmic Italic font leans opposite angle in Printing
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8,11,12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2018-08-28
  • Updated: 2023-01-12
  • Resolved: 2019-11-27
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 JDK 13 JDK 14 Other
11.0.7Fixed 13.0.4Fixed 14 b26Fixed openjdk8u322Fixed
Related Reports
Duplicate :  
Relates :  
Description
Many Japanese and Chinese fonts don't have Oblique style glyph, and algorithmic styling is used.
When we print characters with algorithmic Italic style and AlphaComposite, the characters leaned opposite angle (top-left to bottom-right).

This problem occurs only for printing, not on screen.

At the beginning, I thought it's FreeType library's problem and reported it to them.
https://savannah.nongnu.org/bugs/index.php?54565
But, they indicated their behavior was correct because Java code mirrored the image instead of 180 degree rotation.

Recreate steps:
1. Download and install IPAMincho font.
2. Compile and launch the attached sample code, Outline.java.
3. Mark "Print to File" checkbox
4. Print
5. Check out.ps file
Comments
Fix Request (8u) Request to backport the fix for freetype scaler to 8u. The fix applies cleanly after path shuffling. The reg test fails without the fix and passes with the fix, running test/java/awt/font tests doesn’t report any issue.
01-10-2021

Fix request (13u) Applicable for 13u as well. The patch applies cleanly, I'll push after the longer test run is finished.
04-06-2020

Hi Toshio, I'll take care of the fix - run it through our CI and then approve/push it. Best regards Christoph
25-01-2020

Fix Request Backporting this patch eliminates incorrect printing image of italic styled font. Our customer originally reported this problem with 11, and we'd like to backport it. Patch applies cleanly (including Binary file test/jdk/java/awt/font/Rotate/A.ttf) tier1 and test/jdk/java/awt/font tests pass with the patch. (I'm not a committer. I'd like to ask a sponsor to push it if it's approved.)
21-01-2020

Hi Dmitry, Thank you for fixing our problem!
09-12-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/327b35573471 User: psadhukhan Date: 2019-12-03 07:13:08 +0000
03-12-2019

URL: https://hg.openjdk.java.net/jdk/client/rev/327b35573471 User: jdv Date: 2019-11-27 11:10:15 +0000
27-11-2019

It can also be reproduced when drawing on screen: {code} public class RotatedItalicsTest { public static void main(String[] args) { SwingUtilities.invokeLater(() -> new RotatedItalicsTest().initGUI()); } private void initGUI() { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.add(new MyComponent()); frame.setSize(250, 250); frame.setVisible(true); frame.setLocationRelativeTo(null); } private static class MyComponent extends JComponent { @Override protected void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; g2d.rotate(Math.PI / 2); g2d.setFont(new Font("Tahoma", Font.ITALIC, 48)); g2d.drawString("ABC", 50, -100); } } } {code}
20-08-2019

Similar problem can be observed on Windows when printing to 'Microsoft Print to PDF' destination in landscape mode. Reproducer source code (LandscapePrintTest.java) and output (LandscapePrintTest.pdf) are attached. Produced glyphs are inclined along the wrong axis.
19-08-2019