Handling of Fonts

The GUI display driver of w3browse needs certain fonts in order to correctly display its output on the target system, see also section "Screens". All characters of such a font need to have the same width and height. Additionally, such a font should be either in IBM437 or in Unicode encoding. In the latter case, a font is supposed to contain all important characters of the IBM437 character set.

On many systems, standard Unicode fonts are available that can be used for this purpose, but other systems may not provide suitable fonts, or the capabilities that are needed in order to make use of Unicode fonts may be missing from the system.

Font List

Because of the before mentioned reasons and in order to support better adaptability, w3browse provides the possibility to define a list of preferred fonts together with a label for each of them. This list is stored in the configuration file, which can be modified with any text editor in order to add, modify or delete entries of the font list. A label whose text length should not exceed 15 characters can be assigned to each font in the list and is used by the dialog "Screen Settings" instead of the font name in order to identify a particular font. The default font list consists of the nine supplied fonts (see next section).

The font list is defined by instances of <rdf:li> properties that are part of an <rdf:Seq> element that either can be reached by or is the contents of the <Fonts> property of a <Screen> element in the configuration file. For example, the following entries may be added for use with the X Window System:

<rdf:Seq rdf:about="#fonts">
  ...
  <rdf:li rdf:parseType="Resource">
    <rdfs:label>9x18</rdfs:label>
    <rdf:value>-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1</rdf:value>
  </rdf:li>
  <rdf:li rdf:parseType="Resource">
    <rdfs:label>9x18b</rdfs:label>
    <rdf:value>-misc-fixed-bold-r-normal--18-120-100-100-c-90-iso10646-1</rdf:value>
  </rdf:li>
  <rdf:li rdf:parseType="Resource">
    <rdfs:label>10x20</rdfs:label>
    <rdf:value>-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1</rdf:value>
  </rdf:li>
  ...
</rdf:Seq>

Doing this causes the three labels 9x18, 9x18b and 10x20 to additionally appear in the font list of the dialog. Such a label may then be selected to activate the corresponding font. The real font name, which is the contents of an <rdf:value> element, is finally given to the system in order to load the desired font.

Included Fonts

In order to guard against missing or unsuitable fonts of the system, the author has created nine fonts in IBM437 encoding which can be used without any restrictions. These fonts are: pc6x12, pc7x14, pc7x14s, pc7x14b, pc8x16, pc8x16s, pc8x16ss, pc9x18 and pc10x20. The nice ones are pc6x12, pc7x14s, pc8x16s, pc9x18 and pc10x20. Depending on the target system of the GUI display driver, the fonts are either included as BDF fonts in the distribution of w3browse or contained in the executable of the display driver itself, if possible and if needed at all.

System Dependencies

In the following subsections, some notes about system dependencies in the handling of fonts are given.

X Window System

A special problem with the X Window System is its handling of fonts in order to make use of the supplied fonts. The problem is that there is no easy way for a program to make its fonts available to the X server. So it is a task of the user to issue a command to set up the fonts once in an X session before invoking termxsrv (directly or indirectly by w3browse). It can be done like this:

xset +fp /PATH/TO/FONTDIR/

The command xset prepends the specified font directory to the already defined font path. The font directory has to be located on the same machine as the X server is running on, or a font server such as xfs may be used instead.

Other fonts than the supplied ones can also be used if they are encoded in Unicode. In fact, all fonts whose real font name does not start with the prefix "pc" are assumed to be Unicode encoded. It is best to use only those fonts that match the XLFD pattern *-c-*-iso10646-1. Note that some of those fonts may not contain all needed characters and others may just have poor quality, especially scaled fonts are affected by this.

MS-Windows 9x/ME/NT/2000/XP

On MS-Windows, all nine supplied fonts are embedded in the resource section of the executable where the system is instructed to search for them. It is currently nearly impossible to use other fonts except when they are in IBM437 encoding, because that encoding is always assumed.

The main problem of this platform is that there is no general support for describing a particular font in a uniform way solely by a string. Another problem is that Unicode support is only available on NT-based systems (NT/2000/XP).

MS-Windows CE

On MS-Windows CE, standard Unicode fonts are used which contain (nearly) all needed characters. Only the last number (height) of the font name matters and is used to determine a suitable font.