[OpenJDK 2D-Dev] [9] RFR JDK-8147002:[macosx] Arabic character cannot be rendered on MacOS X

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Feb 9 09:08:11 UTC 2017

Hi All,

Please review a fix for an issue which causes arabic character "alef" to 
be not rendered in osx for menlo font in italic style.

Bug: https://bugs.openjdk.java.net/browse/JDK-8147002

The issue was actually a regression caused by the fix to JDK-7162125: 
[macosx] A font has different behaviour for ligatures depending on its 
creation mode
in which we have added cascaded font list to find the real fonts that 
CFont uses, so that there is no need to use "negative" glyph code for 
finding the fallback fonts
using the "subsititution"/"fallback" mechanism used by osx code.

However, the above logic of using cascaded font list in CFont does not 
take into account of using JRE provided fonts like all those Lucida* ttf 
in jdk/lib/fonts/, so
when a glyph (in this intance, arabic 'alef' character) is intended to 
be rendered in Menlo font in italic style, osx will not be able to find 
the glyph in Menlo-Italic font
and neither in all the cascaded system fonts provided by CoreText, so it 
results in empty box.

Before 7162125 fix, the fallback code in 
CoreTextSupport.m#CTS_CopyCTFallbackFontAndGlyphForJavaGlyphCode() uses 
was adding jre/lib/fonts to the fallback list which was causing the 
glyph to be found in "LucidaBrightRegular.ttf" font and the glyph was 

So, the proposed fix is to add jre provided font "Lucida Sans Regular" 
to the cascaded list so that we get the "alef" glyph.
The reason for choosing "Lucida Sans Regular" over "Lucida Bright 
Regular" is, because it is the largest font file in jre and has all the 
glyph codepoints that no other font in the jre has,
so we will not lose out on any codepoints and will help us in not 
getting missing glyph.

webrev: http://cr.openjdk.java.net/~psadhukhan/8147002/webrev.00/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20170209/4ad48b17/attachment.html>

More information about the 2d-dev mailing list