JavaStation Client Software Guide

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.