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

RFE: JDK should support Thai text display

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs
    • 2d
    • sparc
    • solaris_2.5.1



      Name: rm29839 Date: 01/29/98


      The following code creates a small java application which contains a menu, a text label, a TextField, and a button.
      If I modify the font.properties file to change the standard dialog .plain font definition to a Thai font
      Example, change:
      -b&h-lucida sans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
      to:
      -logic-gothic-medium-r-normal--*-%d-*-*-c-*-tis620.2533-0

      the menu, label, and button no longer display their text. The TextField still works properly and can accept either English or
      Thai characters and display them correctly.

      This problem happens with JDK 1.1.3, 1.1.5, and 1.2beta2.

      The Platform is Solaris 2.5.1 with Thai Language Extensions (TLE) installed.

      The following is the source code of the application:

      import java.awt.*;

      public class Frame1 extends Frame
      {
      public Frame1()
      {
              setLayout(null);
      setVisible(false);
      setSize(insets().left + insets().right + 405,insets().top + insets().bottom + 305);
              setTitle("Empty App");
              
              myFont = new Font("dialog", java.awt.Font.PLAIN, 12);
              
      label1 = new java.awt.Label("Name");
      label1.setBounds(insets().left + 25,insets().top + 156,73,23);
      label1.setFont(myFont);
      add(label1);

      textField1 = new java.awt.TextField();
      textField1.setBounds(insets().left + 105,insets().top + 156,136,36);
      textField1.setFont(myFont);
      add(textField1);
      button1 = new java.awt.Button();
      button1.setActionCommand("button");
      button1.setLabel("Ok");
      button1.setBounds(insets().left + 84,insets().top + 204,59,28);
      button1.setBackground(new Color(12632256));
      button1.setFont(myFont);
      add(button1);

      mainMenuBar = new java.awt.MenuBar();

      menu1 = new java.awt.Menu("File");
      menu1.setFont(myFont);
      miExit = new java.awt.MenuItem("Exit");
      miExit.setFont(myFont);
      menu1.add(miExit);
      mainMenuBar.add(menu1);

      menu3 = new java.awt.Menu("Help");
      menu3.setFont(myFont);
      mainMenuBar.setHelpMenu(menu3);
      miAbout = new java.awt.MenuItem("About..");
      miAbout.setFont(myFont);
      menu3.add(miAbout);
      mainMenuBar.add(menu3);
      setMenuBar(mainMenuBar);


      SymAction lSymAction = new SymAction();
      miExit.addActionListener(lSymAction);

              setVisible(true);
      }

      public Frame1(String title)
      {
      this();
      setTitle(title);
      }

      public synchronized void show()
      {
      move(50, 50);
      super.show();
      }

      static public void main(String args[])
      {
      (new Frame1()).show();
      }

      java.awt.MenuBar mainMenuBar;
      java.awt.Menu menu1;
      java.awt.MenuItem miNew;
      java.awt.MenuItem miOpen;
      java.awt.MenuItem miSave;
      java.awt.MenuItem miSaveAs;
      java.awt.MenuItem miExit;
      java.awt.Menu menu2;
      java.awt.MenuItem miCut;
      java.awt.MenuItem miCopy;
      java.awt.MenuItem miPaste;
      java.awt.Menu menu3;
      java.awt.MenuItem miAbout;
      java.awt.Label label1;
      java.awt.TextField textField1;
      java.awt.Button button1;
      java.awt.Font myFont;

      void Frame1_WindowClosing(java.awt.event.WindowEvent event)
      {
      hide(); // hide the Frame
      dispose(); // free the system resources
      System.exit(0); // close the application
      }

      class SymAction implements java.awt.event.ActionListener
      {
      public void actionPerformed(java.awt.event.ActionEvent event)
      {
      Object object = event.getSource();
      if (object == miExit)
      miExit_Action(event);
      }
      }

      void miExit_Action(java.awt.event.ActionEvent event)
      {
      // Action from Exit Create and show as modal
      hide(); // hide the Frame
      dispose(); // free the system resources
      System.exit(0);
      }

      }



      The following shows the modified lines of the font.properties file:

      # Dialog font definition
      #
      #dialog.plain.0=-b&h-lucida sans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
      dialog.plain.0=-logic-gothic-medium-r-normal--*-%d-*-*-c-*-tis620.2533-0
      dialog.1=-urw-itc zapfdingbats-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific
      dialog.2=--symbol-medium-r-normal--*-%d-*-*-p-*-sun-fontspecific
      (Review ID: 24234)
      ======================================================================

            bcbeck Brian Beck (Inactive)
            rmandelsunw Ronan Mandel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: