[OpenJDK 2D-Dev] [9] request for review: 8078382: Wrong glyph is displayed for a derived font

Phil Race philip.race at oracle.com
Wed Jul 15 16:25:38 UTC 2015

This probably needs more examination and perhaps a more complex fix.
The observation that GDI bases bold-italic on the bold version not the
italic version is an implementation choice just as we had done the
opposite. It is possible some other time it does the opposite or some
other platform does the opposite. I have supposed it is harder to
synthesise italic than to do 'over-strike'. And this GDI usage
applies only to LCD glyphs.

Maybe what we need to do is see if we can detect the cases when
GDI and JDK  disagree on the actual font and remap the glyph id.


On 7/15/15 4:12 AM, Andrew Brygin wrote:
> Hello,
>  could you please review a fix for 8078382?
> bug: https://bugs.openjdk.java.net/browse/JDK-8078382
> webrev: http://cr.openjdk.java.net/~bae/8078382/9/webrev.00/
>  The problem is caused by following peculiarity of the Code New
>  Roman font: this font provides plain, italic and bold variants.
>  In bold and italic variants of the font, different glyphs
>  correspond to the apostrophe character (0039):
> bold: 0039 -> 0x250 (592)
> italic: 0039 -> 0x256 (598)
>  So, we translate character to glyphs using italic variant
>  of the font, and then request glyph images from GDI.
>  However, GDI uses the bold variant of the font in order
>  to compose glyph images for artificial bold-italic variant,
>  and we have got a glyph image for ® instead of apostrophe.
>  Suggested fix is to select bold variant (if possible) as a
>  base for artificial bold-italic.
>  There is no regression test because it requires a specific font
>  to be installed on a test system. The font can be found here:
>  http://www.dafont.com/code-new-roman.font
> Please take a look.
> Thanks,
> Andrew

More information about the 2d-dev mailing list