From: Addison Phillips [wM] (aphillips@webmethods.com)
Date: Fri Sep 19 2003 - 19:33:20 EDT
Hi Anne,
This is a common problem, which has a solution on two different levels. The
problem you have would be more succinctly phrased as "Java knows what the
characters are, but doesn't have a picture of each character to show you.
You need to supply the 'picture'."
You have the right solution, which involves the font.properties file.
First there is the problem of what you do when developing the product (so
you can see that it is working correctly). If you are working on Windows and
own a copy of MS-Office, the easiest thing to do is install the font "Arial
Unicode MS" and modify your font.properties file appropriately (there are
other such fonts in the world... I'm sure you can find them if you look, but
this one is common to have). From that point on you'll be able to see the
characters in your JTable.
Secondly is what you do for your end users. You'll have to provide the end
users with instructions about how to identify appropriate fonts and install
them into their font.properties files.
Here's how you modify your font.properties. For each logical font "block",
you can add the additional font(s) like this:
dialog.0=Arial,ANSI_CHARSET
dialog.1=WingDings,SYMBOL_CHARSET
dialog.2=Symbol,SYMBOL_CHARSET
dialog.3=MS PMincho,SJIS_CHARSET # example of Japanese font
dialog.4=Arial Unicode MS #Note the spaces!
Then you need to add a reference to the font's disk name, like this:
# Font File Names
#
filename.Arial=ARIAL.TTF
filename.Arial_Bold=ARIALBD.TTF
filename.Arial_Italic=ARIALI.TTF
filename.Arial_Bold_Italic=ARIALBI.TTF
filename.Arial_Unicode_MS=ARIALUNI.TTF # Note the underscores here!
filename.MS_PMincho=MSMINCHO.TTF
For some fonts (but not Arial Unicode) you must modify the font converters
and exclusion ranges:
# Component Font Character Encodings
#
fontcharset.dialog.0=sun.io.CharToByteCp1252
fontcharset.dialog.1=sun.awt.windows.CharToByteWingDings
fontcharset.dialog.2=sun.awt.CharToByteSymbol
fontcharset.dialog.3=sun.io.CharToByteCp932 #Mincho is a Shift-JIS font and
requires conversion. 932 is the Japanese code page.
# Exclusion Ranges
#
exclusion.dialog.0=0500-20ab,20ad-ffff
exclusion.dialoginput.0=0500-20ab,20ad-ffff
exclusion.serif.0=0500-20ab,20ad-ffff
exclusion.sansserif.0=0500-20ab,20ad-ffff
exclusion.monospaced.0=0500-20ab,20ad-ffff
When you are done, save the file as "font.properties" in your jre/lib
directory. Now your program should work the way you expect.
A few more tips:
1. Be sure your code uses logical fonts (that is,
dialog/serif/sanserif/monospaced/etc., not
Times/Arial/Helvetica/Verdana/etc.
2. Be careful of bold and italic. Many Asian fonts do not contain a full set
of glyphs for these styles. You'll have to substitute the plain fonts in
order to see the characters, but they won't be bold or italic or
what-have-you.
Hope this helps.
Best Regards,
Addison
Addison P. Phillips
Director, Globalization Architecture
webMethods | Delivering Global Business Visibility
432 Lakeside Drive, Sunnyvale, CA, USA
+1 408.962.5487 (office) +1 408.210.3569 (mobile)
mailto:aphillips@webmethods.com
Chair, W3C-I18N-WG, Web Services Task Force
http://www.w3.org/International/ws
Internationalization is an architecture.
It is not a feature.
> -----Original Message-----
> From: unicode-bounce@unicode.org [mailto:unicode-bounce@unicode.org]On
> Behalf Of Magda Danish (Unicode)
> Sent: Friday, September 19, 2003 2:13 PM
> To: unicode@unicode.org
> Cc: anne.gleitsmann@lhsystems.com
> Subject: FW: Web Form: Other Question: Java Tool
>
>
> Anne,
>
> I am forwarding your email to the Unicode Public Email list
> http://www.unicode.org/consortium/distlist.html.
> I hope someone will be able to answer your question.
>
> Regards,
>
> Magda Danish
> Administrative Director
> The Unicode Consortium
> 650-693-3921
>
> > -----Original Message-----
> > Date/Time: Fri Sep 19 05:38:35 EDT 2003
> > Contact: anne.gleitsmann@lhsystems.com
> > Report Type: Other Question, Problem, or Feedback
> >
> > Dear Unicode-Team,
> >
> > my name is Anne Gleitsmann. My task is to implement a tool in
> > java that administers different Ressource-Bundles. In my tool
> > you can choose a master-document and one or more
> > slave-documents, then follows the data-comparision. The
> > document is being displayed in JTables.
> > Now the language-variety has been expanded to include
> > Japanese and Korean - and that is where my problem is: the
> > font of these languages is shown as little squares.
> >
> > I found the information in the internet that I need to add
> > the range of those characters to the font.properties file -
> > but how do I do this? Could you help me or give me advise as
> > to how to do this?
> >
> > Thank you!
> >
> > Greetings from Germany!
> >
> > Sincerely
> > Anne Gleitsmann
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > (End of Report)
> >
> >
This archive was generated by hypermail 2.1.5 : Fri Sep 19 2003 - 20:31:29 EDT