Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wfont(1) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

windows(1)

,wcreate(1)

,wlist(1)

,wsh(1)

,altfont_term0(3W)

,basefont_term0(3W)

WFONT(1)

NAME

wfont − load and activate fonts

SYNOPSIS

wfont [-ar] font_path [window_spec...]
wfont -f font_path [window_spec...]
wfont [-F base_font_path alt_font_path [window_spec...]]

DESCRIPTION

This command loads and activates the font file(s) specified by font_path, for the windows specified by window_spec...  (by default, if you give no window_specs, the window connected to standard input). See windows(1) for an explanation of window_spec.

Invoking the command with no arguments is a quick way to reset fonts to defaults for the standard input window.  It behaves exactly as if you had typed:

 wfont -F $WMBASEFONT $WMALTFONT

except that, if either variable is null or not defined, the same default is used as in wcreate(1).

The affected windows must be of type term0 (or you get an error).  If font_path does not begin with "/", "./", or "../", it is assumed to be relative to the directory specified by environment variable $WMFONTDIR, or the current directory if that variable is null or undefined.

By default, only the base font is changed for future writing of characters.  Currently-displayed characters don’t change appearance (there is no immediately visible effect). 

Options are:

-a Load and activate font_path as the alternate font, not the base font, for the specified windows. 

-r Replace the existing base (or with -a, alternate) font with font_path and repaint the windows.  If any visible characters were written in the base (or alternate) font, they immediately change to the new font. 

-f Flush all existing fonts for the specified windows, load font_path as the new base and alternate font, and repaint the windows.  All currently displayed characters switch to the new font.  You can’t mix this option with any other. 

-F Flush all existing fonts for the specified windows, load base_font_path as the new base font and alt_font_path as the new alternate font, and repaint the windows.  If the current base and alternate are the same font, all currently displayed characters switch to the new base font.  If the current base and alternate are different, all characters which were written using the current alternate font switch to the new alternate, and all others switch to the new base.  You can’t mix this option with any other. 

If the font_paths given with the -F option are identical (after $WMFONTDIR is possibly prepended to each), the effect is the same as if you had used -f with only one font_path.

Normally, every font loaded must be the same cell size as those already loaded.  The -f and -F options let you change the cell size.  When this happens, window sizes may also be affected, so that the number of rows and columns displayable (and the window’s logical screen size) remains unchanged. 

Fonts are loaded into memory as needed (no more than eight at once).  To avoid confusion, no font is loaded more than once (by font filename).  All characters which use a given font use the same instance of it, so all change together when the font is replaced using the -r option.  Therefore, you can’t replace a font with any font which is already loaded (this would lead to it being loaded twice).  You can make the already-loaded font the base or alternate font, but you can’t use the -r option on it. 

NOTE: If you need to simulate multiple loading of a font without doing library calls, you can link the font file to another filename, then load the two "different" fonts at the same time. 

EXAMPLES

wfont Flush all fonts for the standard input window, set the base and alternate fonts to defaults, map all displayed characters to one of these fonts, and repaint the window. 

wfont /usr/lib/raster/8x16/cour.8U
Make the "cour.8U" font the base font for the window connected to standard input. It is loaded if not already in memory.

wfont -a  cour.8U win5

wfont -ra lp.b.8U win5
Make the font "cour.8U" the alternate font for the window "win5" (assume it is already loaded and there are characters which were written using it). Then make the font "lp.b.8U" the alternate font for the window, and repaint it. This has the effect of changing all the "cour.8U" characters to "lp.b.8U".

wfont -f 7x10/helv.8U
Flush all fonts for the window connected to standard input and repaint it with all characters displayed using the font "7x10/helv.8U".

wfont -F lp.8U lp.b.8U win2
Flush all fonts for the window "win2", make the base and alternate fonts "lp.8U" and "lp.b.8U" respectively, map all displayed characters to one of these fonts, and repaint the window.

HARDWARE DEPENDENCIES

Series 500:
HP-15 (2-byte) fonts are not supported on Series 500. Two-byte fonts work only on Series 300.

SEE ALSO

windows(1),wcreate(1),wlist(1),wsh(1),altfont_term0(3W),basefont_term0(3W). 

DIAGNOSTICS

The following values are returned by this command:

0 If no errors are detected. 

1 Prints a message to standard error and returns 1 if invoked improperly, or if it has trouble while expanding a window_spec pattern. 

2 Prints a message to standard error, continues, and later returns 2 if it encounters any error while trying to perform font operations for any one window. 

WARNINGS

If any application program which calls window library routines previously ran in a window, it is possible that one or more fonts might be loaded multiple times.  Thus, different characters displayed in the same font might not be changed together to a new font.  You can avoid confusion by using wfont -f or wfont -F to flush all existing fonts before starting new operations. 

wfont fails if you try to use -f or -F to switch to a smaller font in a window with a normal border and this would make the window size less than the minimum allowed with a normal border. 

HP-15 fonts (2-byte fonts) cannot be loaded as the alternate font.  Thus they cannot be used with the -a or -f options or as the second font of the -F option. 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026