Bug 107726 - LTC4664-Simple Chinese fonts unormal in RedHat in WCS55 Express GUI(WAS also)
Summary: LTC4664-Simple Chinese fonts unormal in RedHat in WCS55 Express GUI(WAS also)
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: ttfonts-zh_CN
Version: 2.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Yu Shao
QA Contact: Bill Huang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-10-22 14:03 UTC by IBM Bug Proxy
Modified: 2007-11-30 22:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-04-05 23:20:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description IBM Bug Proxy 2003-10-22 14:03:02 UTC
The following has be reported by IBM LTC:  
Simple Chinese fonts unormal in RedHat in WCS55 Express GUI(WAS also)
Hardware Environment:Intel CPU P4>=1.7G,Mem>=1G
Software Environment:Linux RedHat Advanced Server 2.1,DB2v8Express,IHS1.3.26 
WAS502,WCS55 Express
Steps to Reproduce:
1.Launch the installer, according Installation Guide.

Actual Results:
garbage chars on the GUI of installation.

Expected Results:
normal chars on the GUI of installation.
Additional Information:
our workaround :
1. Ensure the hanyi fonts RPM package installed in your system 
by typing "rpm -qa | grep hanyi" ,if the package is missing, Pls 
install it manually.

2. After Hanyi rpm package installed , you will find a folder 
created by it :/usr/X11R6/lib/X11/fonts/truetype

3.Swtich to that directory,if there is no fonts.dir and fonts.scale
 files in it ,you will create them manually by :
"cp fonts.scale.hanyi fonts.scale"
"vi fonts.scale" ( to insert a meanful number as first line 
indicating total counts in the file except the 1st line)
"cp fonts.scale fonts.dir"

4.Then run following command to make the change take its effect:
"cp hya6gb3.ttf gkai00mp.ttf"

5.enter dir /etc/X11, edit XF86Config-4: 

1)find line FontPath "unix/:7100" add another line , 
FontPath "[your truetype path--for example: /usr/X11R6/lib/X11/fonts/truetype ]"

2)find "Section "Module" append an entry at the end, 
Load  "xtt" 

I found there is a solution page about this old-age issue:              
http://www-900.ibm.com/developerWorks/cn/wsdd/library                   
/techarticles/yangyaping0307/waslinux.shtml                             
The way may be some different , but same at the essential:              
find & install Hanyi S.Chinese package in RedHat & rename               
it to gkai00mp.ttf which jvm uses.but our concern is that               
for RedHat(Advance Server 2.0),no Hanyi font package bundled,           
although SLES has this package so SLES has no this problem.             
Is there a way to change some in JDK(or other location) in              
order to let Commerce product use what font RedHat owns? This problem is       
not just lying in WCS, but also WAS series(I consider              
they may use the same infrastructure..)..We'd like                      
to see a complete solution for future products.                         
We're expecting your kindly reply. thank you very much!Hi support, we choose
default language as Simple Chinese during 
installation.choose local as China, GB2312, Simple Chinese in menu.Chao - when
you said "install" and the installation guide, did you mean
WebSphere ?  What is WCS55 express ?Hi Khoa, Yes, I mean WebSphere Installation,
WCS55 Express is one belonging to 
WebSphere Commerce Series. Could you advise? if any other questions , let me 
know. thanksChinen-san - please take a look at this bug for us....By the way, is
this
bug similar to Bug 5037 ?  I know very little in this area, so I am not
quite sure.  Thanks.after Checking ,I think it is different with 5037. We didn't
ecounter the 
problem that the font.dir(scale) was changed automatically..(& xfs?) we don't 
know whether they are essencially the same. but from phenomenon they are 
different. we are hoping we can be provided a way to solve it. thanks.we think
maybe the key point seems RHAS21 doesn't provide efficient fonts for 
application use. we 'd like to know how RHAS solve this problem by bugzilla. 
pls clarify our confusion, thank you very much!

(does RHAS have any action such as including some useful fonts to display NL)It
seems that Java requires fonts whose CharsetRegistry of XLFD is gbk.
RHAS 2.1 doesn't have such a font.
I'm trying to find another solution. But on the other hand, I'd like to ask to
RedHat whether they are providing gbk font for RHAS2.1.


Glen, Greg,
Could you submit this bug and this comment to RedHat bugzilla with the
following sample code?
This sample code reproduces this defect without IBM products.

Thank you in advance.


// AwtLocaleCheck.java

import java.util.*;
import java.text.*;
import java.awt.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;

public class AwtLocaleCheck extends WindowAdapter {
  private Locale lc;
  private DateFormatSymbols date;
  private Frame fr;
  private Label lv;
  private Choice ch;
  private Panel bt_panel;
  private Button bt1, bt2;

  public void start() {
    // Classes concerned with locale
    lc = Locale.getDefault();
    date = new DateFormatSymbols (lc);

    // Frame
    fr = new Frame (lc.toString());	// Set locale name into window title
    fr.setSize (200, 150);
    fr.setLayout (new GridLayout (3, 1));

    // Label
    lv = new Label (lc.getDisplayCountry());	// Contry Name
    fr.add (lv);

    // Choice
    ch = new Choice();
      ch.addItem (date.getWeekdays()[Calendar.SUNDAY]);		// Sunday
      ch.addItem (date.getWeekdays()[Calendar.MONDAY]);		// Monday
      ch.addItem (date.getWeekdays()[Calendar.TUESDAY]);	// Tuesday
      ch.addItem (date.getWeekdays()[Calendar.WEDNESDAY]);	// Wednesday
      ch.addItem (date.getWeekdays()[Calendar.THURSDAY]);	// Thursday
      ch.addItem (date.getWeekdays()[Calendar.FRIDAY]);		// Wednesday
      ch.addItem (date.getWeekdays()[Calendar.SATURDAY]);	// Saturday
    fr.add (ch);

    // Button
    bt_panel = new Panel();
      bt1 = new Button (date.getAmPmStrings()[Calendar.AM]);	// AM String
      bt2 = new Button (date.getAmPmStrings()[Calendar.PM]);	// PM String
      bt_panel.add (bt1);
      bt_panel.add (bt2);
    fr.add (bt_panel);
    
    fr.setVisible (true);
    fr.addWindowListener (this);
  }

  public void windowClosing (WindowEvent evt) {
    fr.dispose ();
    System.exit (0);
  }

  public static void main (String args[]) {
    AwtLocaleCheck alc = new AwtLocaleCheck ();
    alc.start();
  }
}

Comment 1 Jeff Johnson 2003-10-22 15:01:23 UTC
This appears to be a XFree86 font issue.

Comment 2 Mike A. Harris 2003-10-22 16:27:55 UTC
XFree86 does not supply any fonts named "hanyi", and I don't see any
fonts named hanyi in the distribution at all.  The above bug report is
rather obscure so I'm not sure what the problem is here.  This looks less
like a bug in the distribution, and more like a 3rd party software installation
bug which requires changes to the 3rd party software itself.  In particular
it would seem that the 3rd party software is not installing fonts properly.

Closing NOTABUG

Comment 3 IBM Bug Proxy 2003-10-23 03:18:58 UTC
------ Additional Comments From chinen.com  2003-22-10 21:21 -------
Glen, could you reopen RedHat bugzilla and submit the following comment?

Thank you,

---8<------8<------8<---

The matter I asked was not whether hanyi font was provided by RedHat.

Simplified Chinese character is not displayed with Java AWT on RHAS 2.1.
It seems that this issue is caused by lack of gbk encoding ttf font.
Therefore, I'd like to ask whether RedHat provides gbk encoding ttf font.

If such a font is not provided, could you teach me a tips of the way
to display Simplified Chinese character with Java AWT? 

Comment 4 IBM Bug Proxy 2003-10-23 03:19:36 UTC
------ Additional Comments From xiechao.com  2003-22-10 21:39 -------
HI mharris, the issue never occured in SLES, also a distribution of Linux. from 
the appearance, we can only know SLES packages the a kind of S.Chinese fonts--
Hanyi, but RedHat not. the Hanyi package is very strong so it can show various 
Chinese font. 

I think it is not proper saying "XFree86 does not supply any fonts 
named "hanyi", and I don't see any
fonts named hanyi in the distribution at all." to Customers, isn't it? is it a 
reasonable cause? why not RedHat support "hanyi"? it is very possible that 
RedHat SHOULD support different fonts more widely .

but Hanyi is not just the key point.

IBM product offers the ability of handling various chars , not offering these 
chars although. So We think this is a OS problem, & what we are caring is 
whether RedHat has some other fonts which can be a substitute , or has been 
ready to solve this problem (e.g. bundling Hanyi or other substitute.)in 
future, for us DBCS language Customers. We all hope this issue can be a 
recogzition. thanks. 

Comment 5 IBM Bug Proxy 2003-10-23 11:30:54 UTC
------ Additional Comments From chinen.com  2003-23-10 07:28 -------
Here is a workaround to display Simplified Chinese characters on Java AWT
without any additional fonts.

Chao,
Could you try to check this workaround?

I assume you apply this workaround on clean installed RedHat AS 2.1.
I also assume the following option is chosen at the install of RHAS 2.1.

 Additional Language Support
  - Choose the derault language for this system: P.R. of China
  - Choose addtional languages you would like to use on this system:
    P.R. of China

---8<------8<------8<------8<---

1. Login as root user.

2. Remove ttfonts-zh_CN package once. Then reinstall it.
   # rpm -e ttfonts-zh_CN
   # rpm -ivh / (somewhere) /ttfonts-zh_CN-2.11-5.noarc.rpm

3. Remove /usr/share/fonts/zh_CN/TrueType directory from X font server's path
   # chkfontpath -r /usr/share/fonts/zh_CN/TrueType

4. Change current directory to /usr/share/fonts/zh_CN/TrueType.
   # cd /usr/share/fonts/zh_CN/TrueType

5. Edit fonts.scale file like the following.

---8<--- (fonts.scale) ---8<---
6
gkai00mp.ttf -arphic-ar pl kaitim gb-medium-r-normal--0-0-0-0-c-0-iso8859-1
gkai00mp.ttf -arphic-ar pl kaitim gb-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
gkai00mp.ttf -arphic-ar pl kaitim gb-medium-r-normal--0-0-0-0-c-0-gbk-0
gbsn00lp.ttf -arphic-ar pl sungtil gb-medium-r-normal--0-0-0-0-c-0-iso8859-1
gbsn00lp.ttf -arphic-ar pl sungtil gb-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
gbsn00lp.ttf -arphic-ar pl sungtil gb-medium-r-normal--0-0-0-0-c-0-gbk-0
---8<------- (end) -------8<---

6. Recreate fonts.dir file.
   # mkfontdir .

7. Edit /etc/X11/XF86Config-4 file:
  1) Find the line ` FontPath "unix/:7100" '. Then, add another line:
        FontPath "/usr/share/fonts/zh_CN/TrueType"

  2) Find ` Section "Module" '. Then, append an entry at the end:
        Load  "xtt"

8. Change current directory to /opt/IBMJava2-131/jre/lib.
   # /opt/IBMJava2-131/jre/lib

9. Make a copy of font.properties.zh. The name of copied one is
   ` font.properties.zh.2.4.9-e.3 '.
   # cp font.properties.zh font.properties.zh.2.4.9-e.3

10 Edit font.properties.zh.2.4.9-e.3:
   - Find the line ` # font filenames '. Then, add the following lines:
        filename.song_medium_r=gkai00mp.ttf
        filename.song_medium_i=gkai00mp.ttf
        filename.song_bold_r=gkai00mp.ttf
        filename.song_bold_i=gkai00mp.ttf
        filename.fangsong_medium_r=gkai00mp.ttf
        filename.fangsong_medium_i=gkai00mp.ttf
        filename.fangsong_bold_r=gkai00mp.ttf
        filename.fangsong_bold_i=gkai00mp.ttf
        filename.kai_medium_r=gkai00mp.ttf

11. Restart X font server.
  # /etc/init.d/xfs restart

12. Logout. Then restart X with hitting [Ctrl] + [Alt] + [Back Space] 

Comment 6 IBM Bug Proxy 2003-10-23 22:16:52 UTC
------ Additional Comments From khoa.com  2003-23-10 17:57 -------
Chinen-san - thanks for working on this bug!
(ATTR: 10/17 -> 10/23). 

Comment 7 Yu Shao 2003-10-24 02:02:26 UTC
Red Hat does provide CJK encoded truetype fonts, for Simplified Chinese fonts,
all in ttfonts-zh_CN package which includes three fonts, gbsn00lp.ttf,
gkai00mp.ttf and zysong.ttf, and zysong.ttf is GB18030 certified and exclusive
to Red Hat.

If SDK hardcoded the font properties by using font file name, it is going to
have problems. Latest ttmkfdir can recognize font encodings pretty good for CJK
fonts.

I tested above sample code with IBMJava2-SDK-1.4.1-9 on RHEL3, Chinese fonts are
shown OK. You can try RHEL3 which has full Simplified Chinese support.


Comment 8 IBM Bug Proxy 2003-10-24 03:10:48 UTC
------ Additional Comments From jiangmk.com  2003-23-10 23:07 -------
Hi, I am Channing's backup. I just tried the workaround provided by Chinen. The 
font displayed well. I have one additional question to yshao. 


For SDK1.4.1 on RHES 3.0, can we using font name directly? 

Comment 9 Yu Shao 2003-10-24 09:49:24 UTC
Yes, you can.

Comment 10 IBM Bug Proxy 2003-10-28 10:35:44 UTC
------ Additional Comments From chinen.com  2003-28-10 05:36 -------
Chao,

Why don't you and your team try RHEL 3.0?
For product testing, you can get RHEL 3.0 from https://ftp3.linux.ibm.com/ .
The iso images are in the redhat/release_cds/RHEL-3.0/i386/as .

Thank you, 

Comment 11 IBM Bug Proxy 2003-11-13 19:23:21 UTC
------ Additional Comments From chinen.com  2003-13-11 04:48 -------
Workaround for RedHat AS 2.1 is available.
And this issue has already fixed in the latest release, RHEL3.0.
Therefore I'd like to close this bug.

Many thanks to RedHat engineers for their assistance. 


Note You need to log in before you can comment on or make changes to this bug.