Netra j 2.0 Administrator's Guide

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.