This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Photon font server
phfont [-A] [-b file] [-D directory] [-d directory] [-E rule] [-e file] [-I] [-i file] [-L] [-l list] [-N number] [-n name] [-U family] [-u file] [-X]
helv10,phcursor,cour10b,swissi
Default is none.
Default is 15.
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.
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.
For optimum performance, it is best to run an external fontserver. Because the graphics driver
still invokes a font library instance, there is no negative performance effect in using the external fontserver.
Since the graphics driver runs at a priority higher than other applications, it processes the draw stream without
being interrupted by outside applications requesting font services.
However, if you are more concerned about memory footprint, don't run an external font server, though there is the potential of some graphic processing slow down. Any increased memory footprint is mostly data, since both instances share common code libraries. |
Start the server:
phfont -d /usr/photon/font_repository &
Normally the font server is started from the ph script. |
The rendering DLLs used by the font server are located in /lib/dll/font/*.dll. 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:
You should use the graphical tool fontadmin to configure the phfont files, though you can edit the files by hand if you need to. |
Font classifications -- required. This file lists the font foundries and their types. Each section ([SANSERIF], [SERIF], [DECORATIVE]) contains any number of foundries. Each foundry is on its own line under its appropriate section type.
This file contains a dynamic list of fonts -- optional. The ph script regenerates this file if it does not exist or if the contents of the font_repository have changed. Each entry in the font-traplist 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. The fonts listed in this file are added to the extension list (see fontext).
You may uninstall fonts specified in this file by deleting entries in /etc/system/config/font-traplist.
This file has the same format as fontdir.
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 fallback file if font-traplist doesn't exist -- optional. This file specifies fonts that are loaded dynamically, and has the same format as fontdir.
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.
Font keys -- required. There are three sections:
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 searchs for options under [dll id-subsection-dll]. If no options are specified, the default values are used.
Keywords used to identify Asian (Oriental) font foundry names -- optional. Used to optimize the extension system.
The preferred Asian font to attempt to use first for Asian (Oriental) extension processing -- optional.
For internal use only -- optional. Entries in this file override the descriptive name (e.g. "Helvetica") for a particular font stem ("helv").
Each section ([PHF], [PFR], [TTF]) followed by any number of font mappings for that font type in the form new_font_name = real_font_name.
bdftophf2, fontadmin, mkfontdir
Using the Photon microGUI and Configuring Your Environment in the Neutrino User's Guide