Hi all !

For AWTViewer i18n, I hacked the AWTViewer for FOP-0.23.0rc
maintenance release and I had some questions.

I tried to show the menu as Japanese text for i18n for trial.
I wrote the resource files by UTF-8 encoding because it is not
possible to map multi-bytes characters by iso-8859-1 encoding.
I also convert all existed resource file for AWTViewer from
iso-8859-1 to UTF-8 automatically.

I modified some source files associated with AWTViewer, too.
This modification is for the message i18n and for additional
fonts support on AWTViewer.

The additional fonts are specified in a userconfig.xml file.
And you may start FOP with -c and -awt options. NOTE:Now the
additional fonts that you can specified is only TrueType font
(.ttf and .ttc). This restriction comes from the feature of
SUN's JDK (see java.awt.Font javadoc).

1) If you specify the embed-file attribute in userconfig.xml
and use JDK1.3 or higher, the specified TrueType font is loaded
and used in AWTViewer.

2) Otherwise, if you don't specify the embed-file attribute or
use JDK1.2, the additional font is regarded as Java's "Dialog"
logical font name for each Locale.

I attempt to show Japanese fo file. My test environment is:
SUN's JDK1.2.2 and JDK1.3. LANG=EN and JA environment variable.

When use LANG=JA, 1) and 2) are works fine (menu is Japanese
text and the represented document is readable).

LANG=EN and 1) also works fine (menu is English text and
document readable). But the convination of LANG=EN and 2) does
not works fine (menu looks English text well but document is
unreadble). However I think that this behavior is right.

Below is my questions.

Currently the text of menu for the AWTViewer is loaded from
org.apache.fop.viewer.resources package. The AWTViewer needs
two kinds of resource file (messages.lang and resources.lang).

I can not found messages.lang file for some languages (fi,fr,
it,pl.ru). Therefore the following command can not start the
AWTViewer (thrown NPE).

fop -awt -l fi foo.fo

Q1.Is not messages.lang file necessary with resources.lang file?

The language to use on AWTViewer is decided by getting the
system default or specifying -l option. The decided language
is used for the suffix of resource files. However Java has
a feature that access to a resource file for every language
by default (i.e. java.util.ResourceBundle class and
for examples rsources_ja.properties).

Currently AWTViewer regards resource files as written by
iso-8859-1 encoding. This is not good for i18n. I converted
them to UTF-8 encoding, but I think that the ResourceBundle
framework is better than now because AWTViewer can start
even if there are not resource files for any languages.

Q2.Why AWTViewer does not use ResourceBundle?

Best Regards.

石神 覚司(Satoshi Ishigami)   VIC TOKAI CORPORATION

Attachment: patch.tar.gz
Description: Binary data

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to