Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8008572

Changes to fontconfig.properties required on Windows

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • CPU:
      generic
    • OS:
      windows

      Backports

        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

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                prr Philip Race
                Reporter:
                dkorbel David Korbel (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: