Photon font server
phfont [-A] [-b file] [-C[-]SANSERIF|SERIF|DECORATIVE=description[;description2[;...]]] [-D directory] [-d directory] [-E rule] [-F types] [-e file] [-I] [-i file] [-K[-]FONDRY|AFTERFOUNDRYKEYS|KEYS=key[;key2[;...]]] [-L] [-l list] [-mPHF|PFR|TTF=newname[=realname][;newname2=[realname2][;...]]] [-N number] [-O[-]keyword[;[-]keyword2[;...]]] [-n name] [-s directory] [-U family] [-u file] [-X] [-Z alignment]
Neutrino
This option is used to add or remove a description to or from a font class. Use the - preceding the font class name to remove descriptions. This option could be used more than once on the command-line.
If - is used, the specified keys are removed from the specified key location. This option could be used more than once.
helv10,phcursor,cour10b,swissi
Default is none.
Default is 15.
If a keyword starts with a -, this keyword is removed from the list, otherwise it is added to the list. This option can be used more than once on the command-line.
You can pass options through the -F option to
io-graphics
when you aren't running an external font server.
The format is slightly different, based on the
getsubopt()
format. For example:
io-graphics -F"-d=/usr/photon/font_repository,-A,-N=10" ... See PfSetOptionsDll() for more information. |
The phfont utility provides all font services to Photon applications and drivers. This includes the calculation of text extents and metrics and the generation of bitmaps representing character strings. It also maintains a central cache of font metric and bitmap data. The configuration files used by phfont are described in Files below.
When phfont is being initialized, it pre-processes the command line to find out which configuration directory to use, then it tries to load the $HOME/.ph/font/fontopts file. If this file doesn't exist, it tries to load the config_dir/fontopts file. It tries to load the [io-font] and then it tries to load the [io-font-server] sections. The options from the loaded sections are combined with the options from the command line and then processed, with the options in the command line taking higher precedence in the case of conflicts. The options in the [io-font] section of the fontopts file are used by all applications that load phfont.so. When using PfAttachLocalDll, the option name is used to try to load the [io-font-option_name] section from the fontopts file too.
This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use the perms attribute to specify its permissions explicitly, and the uid and gid attributes to set the ownership correctly. |
The phfont utility loads the phfont.so DLL to provide font rendering services. The phfont.so loads DLLs located in /lib/dll/font which provide rendering services for specific font types, such as PHF, TTF, TTC, PFR, Stroke, etc.
If a particular type of rendering is not desired, you can remove the specific dll. To determine which services are provided by each DLL, use the use dll_name command, which displays the usage message for that particular DLL. If an external font server is not started, io-graphics attempts to invoke a font server instance.
The phfont server can run as a stand alone process (we refer to this as an external server) or as a plugin to io-graphics (which we call an internal server). We recommend you run an external server in these conditions:
To run an external font server, start phfont before io-graphics. To run an internal font server, simply start io-graphics.
Start the server:
phfont -d /usr/photon/font_repository &
The rendering DLLs used by the font server are located in /lib/dll/font/*.so. These files support rendering for at least these font types:
Use the use command to view the font types supported by a DLL.
Other files used by phfont include:
These files were used by previous versions of phfont, but are now deprecated:
Directory of known fonts — required. Each entry in this file contains information such as the name and type of the font, its size and style, a textual description of the font family, and the range of characters defined within the font. To be available to an application, at least one font must be defined in this configuration file. Entries in this file are static, they can't be loaded dynamically.
Each line in this file contains the following comma-separated fields, in this order, for each known font:
A set of extension rules to handle character dropouts (missing characters) — required. The format of this file is as follows:
+type = fontname [,fontname...]
Where type is the font type (normal, bold, etc.) and fontname is the font name to search for symbols.
A set of mapping rules — required. There are two types:
newfont = realfont
In this mapping rule, newfont doesn't exist, but realfont does. If you try to use newfont as a font name, it's mapped to realfont.
The following special-case entry is a default mapping for any unknown font name:
? = realfont
For example, if geneva = helv, then the font geneva12 is translated to helv12.
font = {when}scalefont
In this mapping rule, both font and scalefont must exist. When there isn't an exact PHF file for font, then a scaled version of scalefont is made according to the when character used:
For example, if the files helv08.phf, helv10.phf, and helv12.phf are present and swiss is a scalable font, the following translations are made:
Rule | Input font | Translated font |
---|---|---|
helv = *swiss | helv06 | swiss06 |
helv11 | swiss11 | |
helv23 | swiss23 | |
helv = -swiss | helv06 | swiss06 |
helv11 | helv10 | |
helv23 | helv12 | |
helv = +swiss | helv06 | Missing-symbol box |
helv11 | helv10 | |
helv23 | swiss23 | |
helv = #swiss | helv06 | swiss06 |
helv11 | helv10 | |
helv23 | swiss23 |
In all cases, the fonts helv08, helv10, and helv12 (known valid fonts) are used directly.
Contains the command-line options, one option per line — optional. Options are located under the appropriate schema section. For example, phfont-specific options are located in the [io-font] section. Options targeted towards a specific rendering DLL are divided into subsections: boolean, numeral, string. They are formatted as follows:
[dll id-subsection-schema]
The font server may run in one of two modes: server mode, or private client DLL mode. In order to differentiate options between the two, by default there is a "dll" schema. If the font server is running in server mode, it searches for options under [dll id-subsection], but if the font server is running in client DLL mode, it searches for options under [dll id-subsection-dll]. If no options are specified, the default values are used.
Using the Photon microGUI and Configuring Your Environment in the Neutrino User's Guide