Fonts with embedded bitmaps are not always rotated

Mitsuhiro Yamamoto m.yamamoto at change-vision.com
Tue May 14 23:34:19 UTC 2019


Hi Christoph,

This is an issue for JDK8.
Actually there was a problem with a higher OpenJDK, but it has already been
fixed in JDK11..
https://bugs.openjdk.java.net/browse/JDK-8204929
I just want to get the same fix into JDK8.

Mit

2019年5月15日(水) 5:51 Langer, Christoph <christoph.langer at sap.com>:

> Hi Mit,
>
> first of all: Is this an issue with JDK8 only which requires a new patch
> or is it something that is fixed in a higher OpenJDK release and needs to
> be backported? If the latter is the case, please send us the bug URL in JBS
> = OpenJDK Bug system [0]. If not, can you please send a problem description
> by which one can open a bug.
>
> Secondly, if you want to contribute your patch, the OpenJDK project
> requires you to sign a committers agreement (OCA). Do you have that?
> Further information can be found at [1], [2].
>
> Thanks
> Christoph
>
> [0] https://bugs.openjdk.java.net/
> [1] https://openjdk.java.net/contribute/
> [2] http://www.oracle.com/technetwork/oca-405177.pdf
>
>
> > -----Original Message-----
> > From: jdk8u-dev <jdk8u-dev-bounces at openjdk.java.net> On Behalf Of
> > Mitsuhiro Yamamoto
> > Sent: Dienstag, 14. Mai 2019 06:57
> > To: jdk8u-dev at openjdk.java.net
> > Subject: Fonts with embedded bitmaps are not always rotated
> >
> > Hi there,
> >
> > I would like to fix a issue below, so I created a patch file for it.
> > https://github.com/AdoptOpenJDK/openjdk-build/issues/945
> >
> > Can you help me with this?
> >
> > diff --git a/jdk/src/share/native/sun/font/freetypeScaler.c
> > b/jdk/src/share/native/sun/font/freetypeScaler.c
> > index 8c9207d9b2..59747cc860 100644
> > --- a/jdk/src/share/native/sun/font/freetypeScaler.c
> > +++ b/jdk/src/share/native/sun/font/freetypeScaler.c
> > @@ -364,6 +364,19 @@
> > Java_sun_font_FreetypeFontScaler_createScalerContextNative(
> >      context->doBold = (boldness != 1.0);
> >      context->doItalize = (italic != 0);
> >
> > +    /* freetype is very keen to use embedded bitmaps, even if it knows
> > +     * there is a rotation or you asked for antialiasing.
> > +     * In the rendering path we will check useSBits and disable
> > +     * bitmaps unless it is set. And here we set it only if none
> > +     * of the conditions invalidate using it.
> > +     * Note that we allow embedded bitmaps for the LCD case.
> > +     */
> > +    if ((aa != TEXT_AA_ON) && (fm != TEXT_FM_ON) &&
> > +        !context->doBold && !context->doItalize &&
> > +        (context->transform.yx == 0) && (context->transform.xy == 0))
> > +    {
> > +        context->useSbits = 1;
> > +    }
> >      return ptr_to_jlong(context);
> >  }
> >
> > @@ -685,9 +698,8 @@
> > Java_sun_font_FreetypeFontScaler_getGlyphImageNative(
> >          return ptr_to_jlong(getNullGlyphImage());
> >      }
> >
> > -    /* if algorithmic styling is required then we do not request bitmap
> */
> > -    if (context->doBold || context->doItalize) {
> > -        renderFlags =  FT_LOAD_DEFAULT;
> > +    if (!context->useSbits) {
> > +            renderFlags |= FT_LOAD_NO_BITMAP;
> >      }
> >
> >      /* NB: in case of non identity transform
> >
> > Mit
>


More information about the jdk8u-dev mailing list