Netra j 2.0 Administrator's Guide

Chapter 11 Setting Locales and Adding Fonts

This chapter explains how to configure JavaStation computers that will be used in countries other than the United States.

What You Will Need to Configure

You will need to change the following settings for JavaStation computers that will be used outside the United States.

Table 11-1 Description of Settings to be Changed for Localization

Setting  

Description 

Locale 

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

Keyboard 

Controls the mechanical input of each character when it is typed  

Font  

Controls the appearance of characters typed by the user  

Input Method  

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

File Encoding  

Controls the character set used in files that are saved  

Many of the settings are delivered in JavaOS properties to the JavaStation. For instructions on setting JavaOS properties, see Chapter 9, Setting JavaOS Properties .

Setting the Locale

You can set the user's locale to a language other than English in the JavaStation user interface, help text, and error messages.

JavaOS supports the locales listed in Table 11-2.

Table 11-2 JavaStation Locale Settings

Language  

Locale Setting  

German 

de 

English 

en 

Spanish 

es 

French 

fr 

Italian 

it 

Japanese 

ja 

Korean 

ko 

Swedish  

sv 

Chinese  

zh 

JavaOS also supports the language variants American English and Simplified Chinese, shown in Table 11-3.

Table 11-3 JavaStation Country Settings

Country  

Country Setting  

United States 

US 

Republic of China  

TW 

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


    -Duser.language=locale
    

locale is one of the locale settings listed in Table 11-2.

  1. If needed, set the user.country property.


    -Duser.country=
    country
    

country is one of the country settings listed in Table 11-3.

For instructions on setting JavaOS properties, see Chapter 9, Setting 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 will need to modify the login.LocaleList property.

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


    -Dlogin.LocaleList=locale-1
    ;locale-2;
    ... ;locale-n 
    

    The default value of this property is:


    -Dlogin.LocaleList=en_US;de;es;fr;it;ja;ko;sv;zh;zh_TW
    

Adding Fonts

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

You then make the font available to the JavaStation computers by setting the javaos.mountlist property to enable JavaOS 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 JavaOS 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 JavaOS 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. The font file names in the font_dir directory are:

    • HG-GothicB.ttf

    • HeiseiMin-W3H.ttf

    • HG-MinchoL.ttf

    They are being aliased to the names for use by JavaOS:

    • hggothicb

    • heiseimin

    • hgminchol

    They are all of style PLAIN.


    Note -

    font_name is case-insensitive. JavaOS 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

    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 JavaOS.

    Section 2 makes it possible for JavaOS to recognize the new font by its name, in addition to supplementing one of the default fonts. 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 JavaOS:


    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 Table 11-4.

    Table 11-4 Character Set Encodings Supported by JavaOS

    Encoding  

    Locales  

    8859-1 

    West European locales 

    8859-2 

    East European locales 

    8859-5 

    Russian 

    GB2312 

    Chinese (PRC) 

    CNS11643 

    Chinese (Taiwan) 

    BIG5 

    Chinese (Taiwan)  

    Ja-EUC 

    Japanese 

    EUCJIS 

    Japanese 

    KOI8 

    Korean 

    Unicode 

    Large, universal character set (all languages)  

    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 Table 11-4. 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 JavaOS in addition to the system fonts. Thus both English and Japanese can be used on the JavaStation computers.


    # Copyright (c) 1994-1996 by Sun Microsystems, Inc.
    #
    # AWT Font Properties for handling Japanese in JavaOS
    # 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

Making Fonts Available to JavaStation Computers

You can make new fonts available to JavaStation computers using the javaos.mountlist property.

To Make Fonts Available to JavaStation Computers

Note -

This procedure can be performed automatically by the Netra j 2.0 software. See "Defining Boot Server Global Parameters".


  1. Set the javaos.mountlist property.

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


    -djavaos.mountlist=host
    :font_dir|/FONTS
    

For example, to mount the fonts directory/export/root/javaos/fonts, which resides on the server sunroom, you would type:


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

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

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

Adding a Keyboard


Note -

If you install a native keyboard but do not install the fonts to support it, text that is typed does not appear on the screen.


JavaOS supports a number of PS/2 keyboards that may not have been supplied with your JavaStation. The following keyboards are supported:

  • 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

  • USInternatl

To Add a Localized Keyboard

Note -

This procedure can be performed automatically by the Netra j 2.0 software. See "Defining Boot Server Global Parameters".


  1. Connect the keyboard to the JavaStation.

  2. Set the javaos.mountlist property.

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


    -djavaos.mountlist=host
    :localization_top_dir
    |/REMOTE 
    

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


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

JavaOS 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:


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

  1. Set the javaos.kbd property.

This property setting tells JavaOS 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 Netra j 2.0 software and reside in the locale directory.


-djavaos.kbd=
keyboard

The syntax of keyboard is namePS2, where name is one of the countries listed on the previous page. For example, to add the Swedish keyboard:


-djavaos.kbd=SwedishPS2

Enabling Special Characters on the U.S. Keyboard

The compose.deadkeys property allows you to modify the characters typed at the U.S. English keyboard. When this property is set to true, the following keys can be used in combination with other keys to produce special characters.

For example, pressing the ' key plus the "a" key produces an á. This feature is commonly used in European locales.

Pressing a special character key twice produces its normal value.

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


    -djavaos.im.compose.deadkeys=true

Setting the Input Method

An input method controls how users in Chinese, Japanese, and Korean locales will compose characters at the keyboard. Localized versions of Solaris offer language engines to support the input methods listed below.

Table 11-5 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)

To Set the Input Method

Note -

This procedure can be performed automatically by the Netra j 2.0 software. See "Defining Boot Server Global Parameters".


  1. Set the javaos.im.url property.

    If your network has a Solaris machine running an Asian language engine, you can provide access to the engine from the JavaStation computer by setting the following JavaOS property:


    -djavaos.im.url=iiimp://
    iiimphost:port/
    input_method
    

where:

hostname is the Solaris host that is running the Asian language engine. port is 9010 by default. input_method is one of the input methods listed in Table 11-5.

  1. (Optional) Set the input method status pop-up option.

The following JavaOS property enables a pop-up window with input method status information to appear on the JavaStation monitor.


-djavaos.im.status.fixpopup=true

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

    The following JavaOS 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 will negatively impact the performance of user input.


    -djavaos.im.lookup.button=true

  2. Reboot the JavaStation.

    To reboot a JavaStation, 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 need to change the file.encoding property to describe which character set will be used when files are saved. Supported character sets are listed in Table 11-4.

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 11-4.