[OpenJDK 2D-Dev] [11] Cannot use italic font style with MS Gothic and MS Mincho fonts

Ichiroh Takiguchi takiguc at linux.vnet.ibm.com
Fri Jul 27 11:22:44 UTC 2018


Hello.

According to my investigation, FT_Render_Glyph() was not called
even if FT_GlyphSlot_Oblique() was called.

=========
     if (ftglyph->format == FT_GLYPH_FORMAT_OUTLINE) {
         FT_Render_Glyph(ftglyph, FT_LOAD_TARGET_MODE(target)); <<===
     }
=========

It seemed FT_Load_Glyph() and renderFlags affected this issue.

On my Windows,
For "MS Mincho" with italic, renderFlags was "FT_LOAD_TARGET_MONO | 
FT_LOAD_NO_BITMAP | FT_LOAD_RENDER".
I also tested "Meiryo" font (it could handle italic style)
For "Meiryo" with italic, renderFlags was "FT_LOAD_TARGET_MONO | 
FT_LOAD_RENDER".

I think, after FT_LOAD_NO_BITMAP is turned on, FT_LOAD_RENDER should be 
turned off.
So how about following fix ?

=========
diff -r 1edcf36fe15f 
src/java.desktop/share/native/libfontmanager/freetypeScaler.c
--- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Wed 
Jul 18 11:57:51 2018 -0400
+++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c	Fri 
Jul 27 19:44:12 2018 +0900
@@ -700,6 +700,9 @@

      if (!context->useSbits) {
          renderFlags |= FT_LOAD_NO_BITMAP;
+        if (context->doBold || context->doItalize) {
+            renderFlags &= ~FT_LOAD_RENDER;
+        }
      }

      /* NB: in case of non identity transform
=========


On 2018-07-25 19:29, Ichiroh Takiguchi wrote:
> Hello.
> I'm using jdk-11+23 build on Japanese Windows 7.
> 
> I ran Font2DTest Demo, then select like:
> Font: MS Mincho
> Range: Basic Latin
> Method: drawString
> Size: 24
> Style: Italic
> 
> But style was not changed to Italic.
> Antialiasing and Fractional Metrics did not affect this issue.
> 
> I assume it's side-effect for:
> 8204929: Fonts with embedded bitmaps are not always rotated
> 
> Could you check it ?
> 
> Thanks,
> Ichiroh Takiguchi
> IBM Japan, Ltd.



More information about the 2d-dev mailing list