[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] [11] Cannot use italic font style with MS Gothic	and MS Mincho fonts
From:       Ichiroh Takiguchi <takiguc () linux ! vnet ! ibm ! com>
Date:       2018-07-27 11:22:44
Message-ID: 9d84ad21937adbb383a431970c5aaf01 () linux ! vnet ! ibm ! com
[Download RAW message or body]

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.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic