looks
  1. looks
  2. LOOKS-182

Default font policy not showing Japanese correctly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.6.0
    • Component/s: windows
    • Labels:
      None
    • Environment:

      Operating System: Windows Vista
      Platform: All

    • Issuezilla Id:
      182

      Description

      Serious problem that using the JGoodies LAF the Japanese characters are shown as
      squares, but if you use the Windows (or Suns) Look and Feel the Japanese
      characters are shown. (Swapping from Windows to JGoodies LAF it still continues
      to use the same Tahoma font but stops working)

      Full example below tested on Windows Vista

      import javax.swing.*;

      public class UnicodeTest
      {
      public void start() throws Exception

      { //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel("com.jgoodies.looks.windows.WindowsLookAndFeel"); JTextField txtField = new JTextField(); txtField.setText("\u5742\u672c"); System.out.println("Font is:"+txtField.getFont()); JFrame frame = new JFrame("UnicodeTest"); frame.add(txtField); frame.pack(); frame.setVisible(true); }

      public static void main(String args[]) throws Exception

      { UnicodeTest test = new UnicodeTest(); test.start(); }

      }

        Issue Links

          Activity

          Hide
          golovnin added a comment -

          I forgot to mention that it only works with Java 6 or Java 7.

          Show
          golovnin added a comment - I forgot to mention that it only works with Java 6 or Java 7.
          Hide
          esigler added a comment -

          The CompositeFontPolicy work around seems to fix the issue for me with the WindowsLookAndFeel, but doesn't seem to fix the issue when used with the PlasticLookAndFeel on WinXP.

          Show
          esigler added a comment - The CompositeFontPolicy work around seems to fix the issue for me with the WindowsLookAndFeel, but doesn't seem to fix the issue when used with the PlasticLookAndFeel on WinXP.
          Hide
          gb2810 added a comment - - edited

          Hi,

          I am pretty sure that I've run into the same issue but I'm left with some open questions...

          I found out that JAVA 7 causes an incompatibility issue with I18N (Hebrew in my case). My applet runs just fine when being used with JAVA 6 JRE or below but when someone has JAVA 7 JRE (which becomes more and more common due to EOL of 6) all the characters are displayed as squares...

          I took the CompositeFontPolicy and set it to the L&F and indeed 90% of the squares were gone and I see Hebrew letters again (except in some titles). However, this caused some other incompatibilities with respect to the font size when displayed in JTable, the line height is no longer sufficient to the chosen font...

          So, here are my questions:
          1 - Am I experiencing the same issue or some other dialect of it ?
          2 - What is it with JAVA 7 that causes the incompatibility ? maybe I should open a defect to Oracle ? maybe they already have a workaround to this problem ?
          3 - if #1 is true==same issue & #2 is false==bug in JGoodies then: this defect is already ~5 years old and is marked as critical (I totally agree with the severity as it prevents users from working with the application since mine is pure Hebrew based and thus....all I see is squares). How come there isn't any stable/robust fix to this matter which doesn't cause other abnormalities and that supports multi-platform etc. ?
          4 - does the paid version of JGoodies (looks) fix this ? if not then I cannot understand how companies can use this 3rd party...

          Thanks.

          Show
          gb2810 added a comment - - edited Hi, I am pretty sure that I've run into the same issue but I'm left with some open questions... I found out that JAVA 7 causes an incompatibility issue with I18N (Hebrew in my case). My applet runs just fine when being used with JAVA 6 JRE or below but when someone has JAVA 7 JRE (which becomes more and more common due to EOL of 6) all the characters are displayed as squares... I took the CompositeFontPolicy and set it to the L&F and indeed 90% of the squares were gone and I see Hebrew letters again (except in some titles). However, this caused some other incompatibilities with respect to the font size when displayed in JTable, the line height is no longer sufficient to the chosen font... So, here are my questions: 1 - Am I experiencing the same issue or some other dialect of it ? 2 - What is it with JAVA 7 that causes the incompatibility ? maybe I should open a defect to Oracle ? maybe they already have a workaround to this problem ? 3 - if #1 is true==same issue & #2 is false==bug in JGoodies then: this defect is already ~5 years old and is marked as critical (I totally agree with the severity as it prevents users from working with the application since mine is pure Hebrew based and thus....all I see is squares). How come there isn't any stable/robust fix to this matter which doesn't cause other abnormalities and that supports multi-platform etc. ? 4 - does the paid version of JGoodies (looks) fix this ? if not then I cannot understand how companies can use this 3rd party... Thanks.
          Hide
          guille.rodriguez added a comment - - edited

          I can confirm this problem is also present in JGoodies Looks 2.5.3. In my setup, an application using com.jgoodies.looks.windows.WindowsLookAndFeel with default fonts cannot display Chinese characters whereas all is OK if I switch to the standard L&F (as returned by UIManager.getSystemLookAndFeelClassName()). I am using Windows XP and my default locale is Spanish.

          I can also confirm that using Andrej Golovnin's CompositeFontPolicy fixes the problem for me.

          Show
          guille.rodriguez added a comment - - edited I can confirm this problem is also present in JGoodies Looks 2.5.3. In my setup, an application using com.jgoodies.looks.windows.WindowsLookAndFeel with default fonts cannot display Chinese characters whereas all is OK if I switch to the standard L&F (as returned by UIManager.getSystemLookAndFeelClassName()). I am using Windows XP and my default locale is Spanish. I can also confirm that using Andrej Golovnin's CompositeFontPolicy fixes the problem for me.
          Hide
          karsten added a comment -

          The Windows font lookup and the font policies have been overhauled and now aim to build composite fonts so they use the same glyph fallback mechanism as the core Swing L&fs.

          Show
          karsten added a comment - The Windows font lookup and the font policies have been overhauled and now aim to build composite fonts so they use the same glyph fallback mechanism as the core Swing L&fs.

            People

            • Assignee:
              karsten
              Reporter:
              paultaylor
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: