Using Hardware Fonts
To use hardware fonts, you must set the value of the !P.Font system variable to 0 (zero). For example:
WAVE> !P.Font=0
note | By default, software fonts are enabled (!P.Font is set to –1). If you want to use hardware fonts by default, add the statement !P.Font=0 to the PV‑WAVE startup file. |
note | Windows hardware fonts are not affected by the current graphics function. This means that you cannot erase drawn text with an XOR operation if hardware fonts are used. This is a limitation of Windows. The only exception is the graphics function GXnoop, which works correctly. |
note | Clipping does not work when hardware fonts are selected. |
Hardware Font Formatting Commands
In general, you can use hardware fonts in the same way you use software fonts. The text formatting commands (for example, !U) and font commands (for example, !3) described and listed in the previous section can all be used with hardware fonts.
note | A string resource file is used to map software font commands to specific hardware fonts. A resource file with default settings is provided; however, you can easily change these defaults. This resource file is described in detail in
"String Resource File for Font Mappings". |
Using PostScript Formatting Commands
PV‑WAVE provides a set of DEVICE procedure keywords that can be used to set the default font for the PostScript driver. See the appendix called Output Devices and Window Systems in the PV‑WAVE Reference for a list of these DEVICE keywords.
note | The default PostScript fonts changed with PV‑WAVE 6.21. The previous default PostScript font was 12 point Helvetica. The new default PostScript font is 14 point Times Roman. You can change the default font by editing the file fontmap_ps, which is discussed in
"String Resource File for Font Mappings". |
For example, to set the default PostScript font to boldface Helvetica, use the commands:
SET_PLOT, 'ps'
DEVICE, /helvetica, /bold
Additional Text Formatting Commands
The following formatting commands for hardware fonts can be used with the WIN32, WMF, X, and PostScript drivers:
!FB—Switch to the bold face of the current font.
!FI—Switch to the italic face of the current font.
!FU—Underline the current font.
!FN—Switch to the normal form of the current font.
!P
xx—Switch to point size
xx of the current font, where
xx is a two digit integer (01-99).
String Resource File for Font Mappings
PV‑WAVE provides a string resource file that lets you map PV‑WAVE software font commands to device-specific hardware fonts. This section explains the basic format and location of this file.
Format of the Fontmap String Resource File
The string resource file used for font mapping consists of a tab or space separated list of font numbers and target fonts. For example, the first five lines of the default fontmap file for the WIN32 driver are as follows:
3 | Times New Roman, 12 |
4 | Symbol, 12 |
5 | Times New Roman, 12, Bold |
6 | Times New Roman, 12, Bold, Italic |
7 | Symbol, 12, Bold, Italic |
For example, if the output device is set to WIN32 and hardware fonts are selected (!P.Font = 0), then you can use the !5 command in a text string to produce Times New Roman, 12 point, boldface text in your plot:
XYOUTS, x, y, '!5Carbon Dioxide Data'
Location of the Fontmap String Resource File
By default, the fontmap string resource files for each device are in:
(UNIX) <wavedir>/xres/!Lang/kernel
(WIN) <wavedir>\xres\!Lang\kernel
Where <wavedir> is the main PV‑WAVE directory.
Files are named according to the convention: fontmap_device. For example, the fontmap file for the WIN32 device is:
fontmap_win32
note | If you change the fontmap_x file to add a localized font, we recommend that you make a similar change to the fontmap_ps file. The reason for this is that VDA Tools assume that the X Window and PostScript font number load equivalent fonts. |
Using the WAVE_FONTMAP_PATH Environment Variable
You can also use the environment variable WAVE_FONTMAP_PATH to specify a path of directories to search for the font map file.
Font map files are named by the following convention:
GETENV('WAVE_FONTMAP_FILEBASE') + '_device'
where device is one of the following supported devices:
WIN32—WIN32 Driver
WM —Windows Metafile Driver
X—X Windows Driver
PS—PostScript Driver
The default value of the variable WAVE_FONTMAP_FILEBASE is fontmap. Thus, the default font mapping file for the WIN32 driver is:
<wavedir>\xres\!Lang\kernel\fontmap_win32
note | The value of WAVE_FONTMAP_FILEBASE can be the name of a hidden file. |
Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.