JavaStation Client Software Guide

Chapter 10 Setting Locales and Adding Fonts

This chapter explains how to configure JavaStation computers that will be used in different languages.


Note -

Most language settings can be configured quickly using Netra j. For information on Netra j, go to http://www.sun.com/netra-j or refer to the Netra j 3.0 Administrator's Guide.


What You Must Configure

You must configure some or all of following features for JavaStation computers that will be operated in languages other than the default language, U.S. English.

Table 10-1 Localization Features

Feature  

Description 

Configuration Procedure 

Mount Directories  

Contain the resources required by the JavaOS software to support alternate locales.  

"Setting Mount Directories "

Locale 

Controls the language and font that appears in the user interface, help text, and error messages  

"To Change the Locale Setting "

Keyboard 

Controls the mechanical input of each character when it is typed by the user  

"To Add a Localized Keyboard"

Font  

Controls the appearance of characters typed by the user  

"To Install and Configure Fonts"

Input Method  

Controls how the user composes characters; must be configured for Chinese, Japanese, and Korean languages only; requires a localized version of Solaris  

"To Set the Input Method"

File Encoding  

Controls the character set used in files that are saved and the default character set for web pages displayed in a browser 

"To Change the File Encoding Setting "

Document URL 

Provides access to documentation for the HotJava Browser running on the JavaStation (not applicable if another application is used).  

"Setting the HotJava Browser Document URL"

Overview and Examples

Localization configurations are set using JavaOS properties, which are delivered to the JavaStation computer when it boots. The following sections describe the JavaOS properties used for localization. For complete instructions on setting JavaOS properties, see Chapter 4, JavaOS Properties .

JavaOS Properties for All Locales

The following JavaOS properties are required for all locales:

The following property is required for all locales except West European locales:

The following property is required for all Asian locales:

The following property is required if you are running HotJava Browser on the JavaStation computers:

Other properties may also be required for the locale you intend to support. Each feature description in this chapter indicates the associated property settings and the locales that require them.

Example Configurations

This section shows some sample locale configurations.

To enable localization for a French-speaking Swiss user:


-djavaos.loginLocaleList=fr;de;it
-Duser.language=fr
-Dfile.encoding=8859_1
-djavaos.kbd=SwissFrenchPS2
-djavaos.im.compose.deadkeys=false
-ajavaos.mountlist=server:/export/root/javaos/classes|/REMOTE 

To enable localization for a Czech user:


-Duser.language=cs
-Dfile.encoding=8859_2
-djavaos.kbd=CzechPS2
-djavaos.im.compose.deadkeys=false
-ajavaos.mountlist=server:/export/root/javaos/classes|/REMOTE

To enable localization for a Korean user:


-Duser.language=ko
-Dfile.encoding=KSC5601
-djavaos.kbd=KoreanPS2
-djavaos.im.compose.deadkeys=false
-ajavaos.mountlist=server:/export/root/javaos/classes|/REMOTE;
server:/export/root/javaos/fonts|/FONTS
-ajavaos.im.url=iiimp://server:9010

To enable localization for a Thai user who enters text at a U.S. keyboard:


-Duser.language=th
-Dfile.encoding=TIS620
-djavaos.im.compose_th=TIS620
-djavaos.im.compose.deadkeys=false
-ajavaos.mountlist=server:/export/root/javaos/classes|/REMOTE; server:/export/root/javaos/fonts|/FONTS

Setting Mount Directories

You must set at least one mount directory to enable support for a locale other than U.S. English on the JavaStation computer.

When the JavaOS software boots on the JavaStation computer, it can mount some or all of the following directories on a server to obtain localization resources:

To Set Mount Directories
  1. Use the javaos.mountlist property to tell the JavaStation computer to mount the /REMOTE and /FONTS directories, as in this example:


    -ajavaos.mountlist=myserver:/export/root/javaos/fonts|/FONTS;
    myserver:/export/root/javaos/classes|/REMOTE
    


    Note -

    javaos.mountlist should be set using the -a (append) flag so that no previous settings for this property will be overridden.


Setting the Locale

A locale setting is required to enable a language other than U.S. English to be used in the JavaStation user interface, help text, and error messages.

The JavaOS software supports the locales listed in the table below.

Table 10-2 JavaStation Locale Settings

Language  

Locale Setting  

 Arabicar

Catalan 

ca

Chinese  

zh

Czech 

cs

English 

en

French 

fr

German 

de
 Hebrewiw

Hungarian 

hu

Italian 

it

Japanese 

ja

Korean 

ko

Polish 

pl

Portuguese 

pt

Russian 

ru

Spanish 

es

Swedish  

sv
 Thaith

The JavaOS software also supports the language variants shown in the table below.

Table 10-3 JavaStation Country Settings

Country  

Country Setting  

 IsraelIL

Republic of China  

TW
 ThailandTH

United States 

US

To Change the Locale Setting
  1. Set the user.language property:


    -Duser.language=locale
    

    where locale is one of the JavaStation locale settings listed in the first table above.

  2. If needed, set the user.country property:


    -Duser.country=country
    

    where country is one of the JavaStation country settings listed in the second table above.

    For complete instructions on setting JavaOS properties, see Chapter 4, JavaOS Properties .

Modifying the Languages Displayed at Login

The localized version of the JavaStation software supports all the locales described in "Setting the Locale". At login, the user is asked to choose one of these locales.

If you want to restrict or add to the locales presented at login, especially if you will be running an application that is localized for a language not listed in "Setting the Locale", you must modify the javaos.loginLocaleList property.

To Modify the Languages Displayed at Login
  1. Set the following JavaOS property:


    -djavaos.loginLocaleList=locale-1;locale-2; ... ;locale-n
    

where each locale is defined using one of the two-letter codes that define user.language followed by (in some cases) an underscore character and one of the two-letter codes that define user.country.

The default value of this property is:


-djavaos.loginLocaleList=en_US

Thus by default U.S. English is the only language choice available at login.

Adding Fonts

Font support is automatic in JavaOS for all the languages in Table 10-2 except the following:

Font sets for the above languages are provided in the JavaStation client software. To make any of these font sets available to JavaStation computers, you must set the javaos.mountlist property, as described in "To Make Fonts Available to JavaStation Computers ".

You do not need to install new fonts for any of the locales supported on the JavaStation computer, unless you would like to change the look of characters typed by the user. To install new fonts, use the procedure described in this section.


Note -

The Arabic, Hebrew, and Thai locales also require keyboard support. The Chinese (Simplified and Traditional), Japanese, and Korean locales require keyboard and input method support. See "Overview and Examples", "Adding a Keyboard", and "Setting the Input Method ".


Overview

Font sets must reside on a network directory that is accessible to the JavaOS software via NFS. By default, this directory is /export/root/javaos/fonts. To install a font, you will go to the fonts directory and do the following:

You then must make the font available to the JavaStation computers by setting the javaos.mountlist property to enable the JavaOS software to mount the fonts directory during boot-up.

To Install and Configure Fonts
  1. Install the font files in the fonts directory.

    By default, this directory is /export/root/javaos/fonts on the fonts server.

    Follow the instructions that accompany the font package.

  2. Modify the FONTS.LST file, which maps font names recognized by the JavaOS software to the font file names you have installed.

    FONTS.LST contains a list of one-line entries, each of which contains:

    font_name style truetype file_name

    where:

    font_name is the alias that the JavaOS software uses for the font. style is one of PLAIN, BOLD, ITALIC, and BOLDITALIC. file_name is the font file you have installed.

    Example:


    hggothicb
    PLAIN truetype HG-GothicB.ttf
    heiseimin PLAIN truetype HeiseiMin-W3H.ttf
    hgminchol PLAIN truetype HG-MinchoL.ttf
    

    In this example, three TrueType fonts have been installed. They are all of style PLAIN. The font file names in the font_dir directory are aliased to the names for use by the JavaOS software, as shown in the following table:

    Table 10-4 Font Name-to-JavaOS Alias Mapping in Above Example

    Font Name 

    Name for Use by JavaOS Software 

    HG-GothicB.ttf

    hggothicb

    HeiseiMin-W3H.ttf

    heiseimin

    HG-MinchoL.ttf

    hgminchol


    Note -

    font_name is not case-sensitive. The JavaOS software recognizes HGGothicB, hggothicb, and HggothicB as the same name.


  3. In the lib subdirectory, modify the font.properties.locale file.

    locale is the locale that the font properties file is relevant for. For the English locale, the name font.properties (without a locale specification) is used.

    The font properties file has four sections.

    • Section 1 defines where the new fonts are to be used in place of default system fonts.

      The server provides five default system fonts to JavaStation computers: serif, sansserif, monospaced, dialog, and dialoginput. Section 1 contains up to one line for each default system font, where each line uses the following syntax:

      system_font.suffix=JavaOS_font_name

      This line specifies that the font is available to JavaOS. If you want a new font (identified by its JavaOS font name) to override the system font, set suffix to 0. If you want the new font to be available in addition to the system font, set suffix to any other number (1 is a good choice).

      The following example makes the hgminchol font available in addition to the serif font:


      serif.1=hgminchol
      

      The serif font will be used for all English characters. The hgminchol font will be used for all Kana and Kanji characters.

    • Section 2 makes each new font name available to the JavaOS software.

      Section 2 makes it possible for the JavaOS software to recognize the new font by its name, so that the font can be identified and used. Section 2 contains up to one line for each new font, where each line uses the following syntax:

      JavaOS_font_name.0=JavaOS_font_name

      The following example makes the hgminchol font name available to the JavaOS software:


      hgminchol.0=hgminchol
      

    • Section 3 (optional) enables you to further alias the new font names.

      Section 3 contains up to one line for each new font, where each line uses the following syntax:

      alias.new_name=JavaOS_font_name

      The following example aliases the hgminchol font to the name "mincho."


      alias.mincho=hgminchol
      

    • Section 4 specifies the character set encoding of each font. Supported encodings are listed in the table below.

    Table 10-5 Character Set Encodings Supported by the JavaOS Software

    Encoding  

    Locales  

    8859_1 

    West European locales 

    8859_2 

    East European locales 

    8859_5 

    Russian 

     8859_6 Arabic
     8859_8 Hebrew

    GB2312 

    Chinese (PRC) 

    CNS11643 

    Chinese (Taiwan) 

    BIG5 

    Chinese (Taiwan)  

    Ja-EUC 

    Japanese 

    EUCJIS 

    Japanese 

    KSC5601 

    Korean 

     TIS620 Thai

    Unicode 

    Large, universal character set  

    For each font, you must add a line with the following syntax:

    fontcharset.font.1=sun.io.CharToByteencoding

    Where encoding is one of the values in the table below.

    The following example is for the monospaced font that is Unicode-encoded:


    fontcharset.monospaced.1=sun.io.CharToByteUnicode
    

    The following is an example font properties file for a server that has two new Unicode-encoded Japanese fonts. The new fonts will be available to the JavaOS software in addition to the system fonts. Thus both English and Japanese can be used on the JavaStation.


    # Copyright (c) 1994-1996 by Sun Microsystems, Inc.
    #
    # AWT Font Properties for handling Japanese in the JavaOS
    # environment using disk-based fonts
    
    serif.1=hgminchol
    sansserif.1=hggothicb
    monospaced.1=hggothicb
    dialog.1=hggothicb
    dialoginput.1=hggothicb
    
    hgminchol.0=hgminchol
    hggothicb.0=hggothicb
    
    alias.mincho=hgminchol
    alias.gothic=hggothicb
    
    fontcharset.serif.1=sun.io.CharToByteUnicode
    fontcharset.sansserif.1=sun.io.CharToByteUnicode
    fontcharset.monospaced.1=sun.io.CharToByteUnicode
    fontcharset.dialog.1=sun.io.CharToByteUnicode
    fontcharset.dialoginput.1=sun.io.CharToByteUnicode

To Make Fonts Available to JavaStation Computers
  1. Set the javaos.mountlist property.

    This property setting tells the JavaOS software to mount the fonts directory at startup:


    -ajavaos.mountlist=host:font_dir
    |/FONTS
    

    The default fonts directory is /export/root/javaos/fonts. To mount this directory on a server called sunroom, you would type:


    -ajavaos.mountlist=sunroom:/export/root/javaos/fonts|/FONTS
    

  2. Reboot JavaStation computers that need access to the new fonts.

    To reboot a JavaStation computer, turn it off and then on.

Adding a Keyboard

The JavaOS software supports a number of PS/2 keyboards that may not have been supplied with your JavaStation computers. To support most locales, you must configure a new keyboard to replace the default keyboard, USPS2. As an exception, Latin accent characters and Arabic, Hebrew, and Thai characters can be typed at any supported keyboard if one of the javaos.im.compose properties has been set. This document refers to the U.S. keyboard. See "Enabling Special Characters on the U.S. Keyboard".


Note -

The Arabic, Hebrew, and Thai locales also require font support. The Chinese (Simplified and Traditional), Japanese, and Korean locales require font and input method support. See "Overview and Examples", "Adding Fonts", and "Setting the Input Method ".


JavaOS supports the following keyboards:

  • Arabic

  • Belgian

  • Bulgarian

  • CanadianBi

  • CanadianFr

  • Chinese ROC

  • Czech

  • Danish

  • Estonian

  • French

  • German

  • Greek

  • Hebrew

  • Hungarian

  • Italian

  • Japanese

  • Korean

  • Latvian

  • Lithuanian

  • Netherlands

  • Norwegian

  • Polish

  • Portugese

  • Russian

  • Slovakian

  • Spanish

  • SpanishLatin

  • Swedish

  • Swiss

  • Thai

  • Turkish

  • UK

  • US

  • USInternatl

To Add a Localized Keyboard
  1. Connect the keyboard to the JavaStation.

  2. Set the javaos.mountlist property.

    This property setting tells the JavaOS software to mount the locale directory at startup.


    -ajavaos.mountlist=host:localization_top_dir
    |/REMOTE
    

    By default, the locale directory is /export/root/javaos/classes. If you set javaos.mountlist as follows:


    -ajavaos.mountlist=sunroom:/export/root/javaos/classes|/REMOTE 
    

    The JavaOS software mounts the directory /export/root/javaos/classes/sun/javaos. Note that if you are specifying a FONTS directory as well as a REMOTE directory, the javaos.mountlist property is a list delimited by semicolons. For example:


    -ajavaos.mountlist=sunroom:/export/root/javaos/fonts|/FONTS;
    sunroom:/export/root/javaos/classes|/REMOTE
    

  3. Set the javaos.kbd property.

    This property setting tells the JavaOS software the name of the keyboard file, which contains the keyboard mapping table. Keyboard files for all of the countries listed on the previous page are included in the JavaStation client software.


    -djavaos.kbd=keyboard
    

    The syntax of keyboard is namePS2, where name is one of the countries in the preceding list. For example, to add the Swedish keyboard:


    -djavaos.kbd=SwedishPS2
    

Enabling Special Characters on the U.S. Keyboard

Four javaos.im.compose properties enable you to modify the characters typed at the U.S. English keyboard. You can enable input of Latin accent characters or Arabic, Hebrew, or Thai characters.

To Enable Latin Accent Characters on the U.S. Keyboard
  1. Set the following JavaOS property:


-djavaos.im.compose.deadkeys=true

To Enable Arabic Characters on the U.S. Keyboard
  1. Set the following JavaOS property:


-djavaos.im.compose_ar=ISO8859_6

ISO8859_6 is the code for the Arabic character set. Once this property is set, the Ctrl-t key sequences toggles the JavaStation keyboard between U.S. and Arabic modes.

To Enable Hebrew Characters on the U.S. Keyboard
  1. Set the following JavaOS property:


-djavaos.im.compose_iw=ISO8859_8

ISO8859_8 is the code for the Hebrew character set. Once this property is set, the Ctrl-t key sequences toggles the JavaStation keyboard between U.S. and Hebrew modes.

To Enable Thai Characters on the U.S. Keyboard
  1. Set the following JavaOS property:


-djavaos.im.compose_th=TIS620

TIS620 is the code for the Thai character set. Once this property is set, the Ctrl-t key sequences toggles the JavaStation keyboard between U.S. and Thai modes.

Setting the Input Method

An input method controls how JavaStation users in Chinese (Simplified and Traditional), Japanese, and Korean locales will compose characters at the keyboard. The input method is administered by a language engine running on a Solaris system in the JavaStation network. Localized versions of Solaris offer language engines to support the input methods listed below.


Note -

To fully support one of the preceding locales, you must also set up keyboard and font support. See "What You Must Configure", "Adding Fonts" and "Adding a Keyboard" for more information.


Table 10-6 Input Methods by Language

Language  

Input Methods  

Chinese Simplified 

  • Location

  • Double Pinyin

  • Stroke

  • Full Pinyin

  • Golden Input

  • Intelligent Pinyin

  • Chinese Symbol

Chinese Traditional  

  • TsangChieh

  • ChuYin

  • I-Tien

  • Telecode

  • ChienI

  • NeiMa

  • ChuanHsing

Korean  

  • 2-Bulsik

  • Hanja Input

  • Special Character

  • Code Value

Japanese  

  • CS00

  • Wnn6 (Solaris 2.6 only)


Note -

Arabic, Hebrew, and Thai characters are also composed using an input method. However, support for these input methods is automatic in the JavaOS software and does not require additional configuration.


To Set the Input Method
  1. Set the javaos.im.url property.

    This property enables JavaStation computers to access to the Solaris machine running the language engine for the input method. To support multiple input methods for all the JavaStation computers in your network, use a semicolon-delimited list of Solaris machines. Set this property as follows:


    -djavaos.im.url=iiimp://hostname:port;hostname:port...

    where:

    hostname is the Solaris host running the language engine. port is the port at which the engine is located. By default, the JavaStation computers use port 9010.


    Note -

    To make an input method server accessible to only a subset of the JavaStation computers in your network, you will need to create a unique macro for these computers in the dhcptab file. See "Sample dhcptab File ".


  2. (Optional) Set the javaos.im.status.fixpopup property.

    Setting this property to true, as follows, enables a pop-up window with input method status information to appear on the JavaStation monitor.


    -djavaos.im.status.fixpopup=true
    

  3. (Optional) Set the javaos.im.lookup.button property.

    This property controls how the JavaStation user selects characters when using an input method. If false, when the list of candidate characters is displayed, letters are used to indicate each choice. If true, letters are replaced with buttons so that the user must click on a button to pick a choice. Note that enabling this option degrades the performance of user input.


    -djavaos.im.lookup.button=true

  4. Reboot the JavaStation computer.

    To reboot a JavaStation computer, turn it off and then on.

Changing the File Encoding Setting

If the locale you have chosen does not use the 8859_1 character set (Roman alphabet), you must change the file.encoding property to describe which character set will be used when files are saved. Supported character sets are listed in Table 10-5.

To Change the File Encoding Setting
  1. Set the following JavaOS system property:


-Dfile.encoding=encoding 

where encoding is one of the settings listed in Table 10-5.

Setting the HotJava Browser Document URL

If Sun's HotJava Browser will run on the JavaStation computers, you must set the doc.url property to make HotJava Browser documentation accessible to JavaStation users.

To Set the Document URL
  1. Set the following JavaOS system property:


-Ddoc.url=file:/REMOTE/hotjava

HotJava Browser documentation is translated for all locales. If the doc.url property is set exactly as above, HotJava Browser automatically locates the translation for the current locale.