JDK-8008572 : Changes to fontconfig.properties required on Windows
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7u7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: generic
  • Submitted: 2013-02-20
  • Updated: 2020-04-05
  • Resolved: 2020-04-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Duplicate :  
Relates :  
Description
SYNOPSIS
--------
Changes to fontconfig.properties required on Windows

OPERATING SYSTEM
----------------
Windows 7 x64
Windows XP

FULL JDK VERSION
----------------
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode)

DESCRIPTION from Licensee
-------------------------
With the current fontconfig.properties file, no characters are displayed for the following Unicode ranges by logical fonts such as Dialog:

    Gurmukhi, Gujarati, Tamil, Telugu, Kannada

The following Windows fonts should be added to the fallback sequence in fontconfig.properties:

* Raavi (raavi.ttf)
* Shruti (shruti.ttf)
* Latha (latha.ttf)
* Vijaya (vijaya.ttf)
* Gautami (gautami.ttf)
* Vani (Vani.ttf)
* Tunga (tunga.ttf)

Because these fonts can display some of the characters in these Unicode ranges.

REPRODUCTION INSTRUCTIONS
-------------------------
To see this situation, please apply following patch into FontPanel.java for demo\jfc\Font2DTest\src.zip

============================================================================================
--- demo/jfc/Font2DTest/src/FontPanel.java.orig                 Wed Aug 29 12:09:42 2012
+++ demo/jfc/Font2DTest/src/FontPanel.java                 Sat Sep 15 10:11:07 2012
@@ -1119,7 +1119,9 @@
                       currMouseOverChar = mouseOverChar;
                       /// Update status bar
                       f2dt.fireChangeStatus( "Pointing to" + MS_OPENING[textToUse] +
-                                             modeSpecificNumStr( mouseOverChar ), false );
+                                             modeSpecificNumStr( mouseOverChar  ) +
+                                             (null == Character.getName(mouseOverChar) ?
+                                               "" : " ("+Character.getName(mouseOverChar)+")"), false );
                       return true;
                   }
               }
============================================================================================

Now follow these steps:

1. Apply above patch and compile and run Font2DTest
2. On Font, select "Dialog"
3. On "Range" JComboBox, select "Tamil"
4. Nothing displayed, on bottom area
5. On Font, select "Latha"
6. Some characters are displayed, and square characters are displayed
   This square character means no font glyph is assigned or no character
   is defined. Please move mouse cursor on square character, If you can
   see glyph name, this character is defined on Unicode

The attached testcase demonstrates that the characters are in fact present in an example font (Dialog):

    java FontCheckTest7 | findstr /i Gurmukhi
    java FontCheckTest7 | findstr /i Gujarati
    java FontCheckTest7 | findstr /i Tamil
    java FontCheckTest7 | findstr /i Telugu
    java FontCheckTest7 | findstr /i Kannada

For example, the Latha and Vijaya fonts have glyphs for Tamil:

c:\> java FontCheckTest7 | findstr /i Tamil
0xB82: TAMIL SIGN ANUSVARA [Latha,Vijaya]
0xB83: TAMIL SIGN VISARGA [Latha,Vijaya]
0xB85: TAMIL LETTER A [Latha,Vijaya]
0xB86: TAMIL LETTER AA [Latha,Vijaya]
0xB87: TAMIL LETTER I [Latha,Vijaya]
0xB88: TAMIL LETTER II [Latha,Vijaya]
0xB89: TAMIL LETTER U [Latha,Vijaya]
0xB8A: TAMIL LETTER UU [Latha,Vijaya]
0xB8E: TAMIL LETTER E [Latha,Vijaya]
0xB8F: TAMIL LETTER EE [Latha,Vijaya]
0xB90: TAMIL LETTER AI [Latha,Vijaya]
0xB92: TAMIL LETTER O [Latha,Vijaya]
0xB93: TAMIL LETTER OO [Latha,Vijaya]
...

TESTCASE
--------
import java.awt.*;
import java.util.*;

public class FontCheckTest7 {
    public static void main(String[] args) throws Exception {
        Font font = new Font("Dialog", Font.PLAIN, 12);
        Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
        for (int i=Character.MIN_VALUE; i<=Character.MAX_VALUE; i++) {
            if (!Character.isDefined(i)) continue;
            if (Character.isHighSurrogate((char)i) || Character.isLowSurrogate((char)i)) continue;
            String s =Character.UnicodeBlock.of(i).toString();
            if (s.indexOf("PRIVATE_USE_AREA") > -1) continue;
            if (s.indexOf("VARIATION_SELECTORS") > -1) continue;
            if (!font.canDisplay(i)) {
                TreeSet<String> list = new TreeSet<String>();
                for (int j=0; j<fonts.length; j++) {
                    if (fonts[j].canDisplay(i)) {
                        list.add(fonts[j].getFamily(Locale.ENGLISH));
                    }
                }
                StringBuffer fname = new StringBuffer();
                for (String family : list) fname.append(","+family);
                System.out.printf("0x%X: %s%s%n", i, Character.getName(i), fname.length() != 0 ? " ["+fname.substring(1)+"]" : "");
            }
        }
    }
}

SUGGESTED FIX
-------------
Diffs relative to 7u11:

--- C:/temp/jdk7_11/jdk1.7.0_11/jre/lib/fontconfig.properties.src        Sat Jan 12 02:37:28 2013
+++ C:/temp/jdk7_11/jdk1.7.0_11/jre/lib/fontconfig.properties        Tue Jan 22 11:30:11 2013
@@ -43,6 +43,12 @@
 allfonts.thai=Lucida Sans Regular
 allfonts.georgian=Sylfaen
 
+allfonts.gujarati=Shruti
+allfonts.kannada=Tunga
+allfonts.gurmuhi=Raavi
+allfonts.tamil=Latha
+allfonts.telugu=Gautami
+
 serif.plain.alphabetic=Times New Roman
 serif.plain.chinese-ms950=MingLiU
 serif.plain.chinese-ms950-extb=MingLiU-ExtB
@@ -238,7 +244,8 @@
 
 sequence.fallback=lucida,\
                   chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
-                  japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian
+                  japanese,korean,chinese-ms950-extb,chinese-ms936-extb,georgian,\
+                  devanagari,gurmuhi,gujarati,tamil,telugu,kannada
 
 # Exclusion Ranges
 
@@ -298,3 +305,9 @@
 filename.Wingdings=WINGDING.TTF
 
 filename.Sylfaen=sylfaen.ttf
+
+filename.Shruti=SHRUTI.TTF
+filename.Tunga=TUNGA.TTF
+filename.Raavi=RAAVI.TTF
+filename.Latha=LATHA.TTF
+filename.Gautami=GAUTAMI.TTF

Comments
No plans to address for 7u and 8u.
08-09-2015

A bit more info about all of these fonts : Raavi : Gurmukhi : XP : https://www.microsoft.com/typography/fonts/font.aspx?FMID=2161 Shruti : Gujarati : XP : https://www.microsoft.com/typography/fonts/font.aspx?FMID=2163 Latha : Tamil : XP : https://www.microsoft.com/typography/fonts/font.aspx?FMID=1899 : Vijaya : Tamil : Win7 : https://www.microsoft.com/typography/fonts/font.aspx?FMID=1821 Gautami : Telugu : XP : https://www.microsoft.com/typography/fonts/font.aspx?FMID=2119 Vani : Telugu : Win7 : https://www.microsoft.com/typography/fonts/font.aspx?FMID=1905 Tunga : Kannada : XP : https://www.microsoft.com/typography/fonts/font.aspx?FMID=2168 Note that they all (I think) come in bold as well as regular so if you were to add them it would probably be worth seeing how hard it would be to add the bold ones into the bold fonts, rather than using the regular everywhere. One issue is that we do not officially support any of the scripts these support. The supported scripts are those here : http://www.oracle.com/technetwork/java/javase/java8locales-2095355.html#jfc-table And these all have "v2" indic feature tables whereas ICU only supports this for Devanagari. So we cannot render these compatibly with Windows. We would need harfbuzz in JDK 9 for that.
07-08-2015