This chapter covers the following topics:
In addition to full support of bitmap fonts, Photon also provides scalable fonts. These fonts can be scaled to virtually any point size as well as anti-aliased (16 shades) for crisp, clean output on screen at practically any resolution.
Photon's scalable fonts are achieved by means of a high-speed font server that retrieves highly compressed font data from Portable Font Resource (PFR) files (*.pfr), and then renders the font character shapes at any point size and resolution. Note that PFRs provide better than 2-to-1 compression over PostScript fonts.
The Photon Core Latin set (latin.pfr), which comprises the Unicode Basic Latin (U+0000 - U+007F) and the Latin-1 Supplement (U+0080 - U+00FF) character sets, includes the following scalable fonts:
Dutch
Dutch Bold
Dutch Italic
Dutch Bold Italic
Swiss
Swiss Bold
Swiss Italic
Swiss Bold Italic
Wingbats
It also contains the Euro symbol.
A mono-space font set (courier.pfr) includes the following scalable fonts:
The Photon Extended Latin set (latinx.pfr) comprises the Unicode Latin Extended-A (U+0100 - U+017F) and Latin Extended-B (U+0180 - U+0217) sets. The Extended Latin set includes these fonts:
Dutch
Dutch Bold
Dutch Italic
Dutch Bold Italic
Swiss
Swiss Bold
Swiss Italic
Swiss Bold Italic
The following fonts are algorithmically generated: Dutch Italic, Dutch Bold Italic, Swiss Italic, and Swiss Bold Italic. |
Armed with the Photon Core Latin set, the developer can support a host of languages, including:
Danish
Dutch
English
Finnish
Flemish
French
German
Hawaiian
Icelandic
Indonesian
Irish
Italian
Norwegian
Portuguese
Spanish
Swahili
Swedish
By adding the Photon Extended Latin set (latinx.pfr), the developer can support several additional languages, including:
Afrikaans
Basque
Catalan
Croatian
Czech
Esperanto
Estonian
Greenlandic
Hungarian
Latvian
Lithuanian
Maltese
Polish
Romanian
Slovak
Turkish
Welsh
Apart from the standard character sets shipped with Photon, developers may wish to order specific PFRs to support certain languages and alphabets (e.g. Cyrillic, Korean, etc.) |
An optional Photon product, the Japanese Language Supplement, offers developers full support for Japanese characters.
Besides a complete set of PFRs (Hon Mincho Kanji set), the package also includes a front-end processor that allows users to provide input using either an English or a Japanese keyboard.
Photon has a simple editor that allows the entry of stylized UTF-8 encoded text. For more information, see the ped utility in the Applications and Utilities chapter.
By default, Photon uses a global configuration based on configuration files located in the /usr/photon/font directory. Each individual user may have their own specific set of configurations located in the $HOME/.photon/font directory. This allows, for example, some users to have access to a set of (memory-intensive) Japanese fonts, whereas other users may not require these. Once you've created your own font configuration, it's used by subsequent Photon sessions.
The superuser (root) doesn't have a private configuration - any modifications made will apply to the global default. In this case, the -G option must be specified to prevent accidental modification of the global configuration.
The following files hold a user's configuration:
These files are located in the $HOME/.photon/font directory. Although these files may be edited directly, you should use the graphical fontcfg utility, because an error in the configuration may prevent the Photon font subsystem from functioning.
To start the configuration utility:
Or
fontcfg
The utility opens with a dialog showing four tab sections, a status bar, a Save button, and an Exit button.
Each section configures a different aspect of the font system. Click on the tab (or use the appropriate hotkey) to switch to a specific section.
When you're finished, you can save or discard your changes:
Before a font can be used by an application, it must be made available to Photon. You use the Fonts tab to install the fonts you want to use.
The fonts tab shows two lists of fonts:
The font type is indicated by the icon beside the name. For example: Photon bitmap files are shown with a blue Pf symbol, and Bitstream scalable fonts are shown with a gold Bf symbol. These fonts must reside in the /usr/photon/font directory and have a file extension of *.phf or *.pfr.
Initially, the font tree shows only the descriptive name of the font - click the expand button (+) by the name and the entry expands to show all the sizes and styles for that font. The Helvetica entry represents the set of helv*.pfr bitmap files. Expanding this entry reveals branches with names such as 8pt Regular and 8pt Bold Italic, each corresponding to a specific instance of the font. An expanded font tree will look similar to this:
To install a new font:
When you select a font by the descriptive name, all the sizes and styles of that font are selected. To install only a subset of a font, expand the tree and select the individual font size(s) and type(s) desired. |
To remove an existing font:
You can display just the Bitmap (*.phf) or Scalable (*.pfr) fonts by toggling the appropriate check boxes in the center of the window.
You use this tab to configure Font name mappings and scalable font substitution rules.
You use font mappings to provide aliases for font names defined in other systems (such as Arial or Geneva) or for "virtual fonts." For instance, when you create a font mapping for term and use it in all of your applications, you modify the definition of this pseudo-font in one place, and the change is propagated throughout.
The Font Name Mappings panel on the left side contains all the current settings for font name mappings. To create an alias:
To modify an existing alias:
To delete an existing alias:
To specify which font to use when a font name can't be resolved by any of the mapping rules:
In the Unknown Font field, select a font from the combobox. |
The font system uses scalable font substitution rules when you request a font size that isn't available. Bitmap fonts are augmented with a scaled version of a similar font according to your specifications. The list of scalable font substitution rules appears in the scalable font substitutions panel.
To create a new substitution rule:
To modify an existing rule:
To delete an existing rule:
The Bitstream scalable fonts shipped since Photon 1.12 include:
If you use scalable fonts, these mappings may be appropriate. You can control the point size limits at which these rules take effect by uninstalling the smaller or larger bitmap fonts from your system.
You use this tab to configure a set of rules to locate the appropriate fonts for the rendering of international characters.
Whenever a character isn't contained within the base font specified by an application, the font server searches an internal list of fonts to find a definition of that character. The first font located that can render the required character is used.
Although multiple search rules may be defined, only one rule is used by the font server at a time. From the Extension Rule combobox, you can:
The Sizes/Styles and Font Name lists contains the fonts to be searched, in order from top to bottom, when looking for a character definition. To add a new entry:
You can add a new entry before the first entry using the Insert Before button, or after the last entry using the Insert After button. If no items are selected in the list, the new entry becomes the first or last item, depending on the selected button.
To delete or shuffle the order of the items in the search order list:
Note that the Bitstream scalable fonts of the same base name are automatically merged together to provide an enlarged character set. For example, when the latinx.pfr (Photon Extended Latin set) file is installed, the new characters are immediately available to applications using "Swiss" and "Dutch" without any change to the Extensions rules.
In this section, you configure the runtime options (such as memory caching) of the font server.
The options include:
This pane also contains a list of synthesized missing symbol sizes (used in conjunction with PHF fonts) and lets you add, delete, and change these sizes. Missing symbols for PFR fonts are scaled to an exact size.
The bar graph on the right of the Options pane shows the relative disk space occupied by the various types of font (Bitmap *.phf or Scalable *.pfr). Use this to determine the space allocation of the various caches.
The fontcfg utility may also run in an automatic batch mode, where it reads commands from a script file (given on the command line) and executes the font configuration commands contained in that script file. This facility is used, for example, by the Photon installation script when the Japanese language package is installed to add the new fonts and extensions rules.