Printers and Fonts Kit(3.1) (pfk31qh.hlp) (
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
The PFM Editor
◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
The Printer Font Metrics (PFM) Editor is a Microsoft Windows application
that a font vendor can use to create and edit PFM files and create Printer
Cartridge Metrics (PCM) files for Hewlett-Packard printers and printer
drivers that use Printer Control Language (PCL). The PFM Editor simplifies
and accelerates the task of creating PFM files by not requiring a great deal
of knowledge about either the PFM file format or Windows device drivers. The
PFM Editor allows developers with some font experience to create the
information file needed by the driver to support the cartridge.
The PFM Editor reads the filename of a PFM file from the command line in the
WIN.INI file. Thus, defining the PFM extension in WIN.INI allows the user to
double-click PFM files to edit them.
The Main Window
The main window of the PFM Editor contains several fields that give general
identifying information about the font. All of these members appear in the
PFMHEADER structure.
You should always specify at least the Pitch member before selecting any of
the metrics or dialog boxes described in the following sections.
The following members appear in the main window.
Member Description
────────────────────────────────────────────────────────────────────────────
Font Name The name of the font, such as Courier(R).
Char Set The character set the font represents. It can be one of the
following values.
Value Meaning
───────────────────────────────────────────────────────────────
0 Windows ANSI
180 Math-8 (PCL driver only)
181 PI Font (PCL driver only)
182 LineDraw (PCL driver only)
183 PC Line (PCL driver only)
184 Tax Line (PCL driver only)
185 US Legal (PCL driver only)
255 OEM character set
Pitch Two selections: Fixed and Proportional.
Effects Three selections indicating the appearance of the font: Italic,
Underline, Strikeout.
Font Family Six selections: Don't Care, Roman, Swiss, Modern, Script, and
Decorative. The driver uses the family to classify fonts for
identification and selection purposes.
Points The point size of a font, or its height in units of 1/72 of an
inch.
Weight The weight of the font minus a number from 0 to 1000. 400
represents a normal, medium font. Larger numbers represent bold
fonts.
Copyright A 60-character string containing the font supplier's copyright
notice.
The File Menu
The File menu contains all the standard Windows File menu commands along
with one extra command: Create PCM File. The following is a list with
descriptions of those commands.
Command Description
────────────────────────────────────────────────────────────────────────────
New Causes the PFM Editor to reinitialize itself, and display
an empty, untitled PFM file.
Open Displays a standard Open File Name dialog box. PFM is the
default file extension.
Save Saves the PFM file with the same name as previously used in
a Load or Save operation. If the file is untitled, the Save
As dialog box appears.
Save As Allows the user to specify a filename before saving.
Create PCM File Allows the user to create a cartridge-metrics file for the
PCL driver.
Exit Exits the PFM Editor.
About Displays an informational dialog box.
As with all applications, the user is given the opportunity to save or
cancel if the New, Open, or Exit commands are chosen when the current file
has been saved, but not changed.
The Metrics Menu
The Metrics menu allows you to activate dialog boxes to specify dimensional
information about the font. The Metrics popup menu contains three options:
Basics, Extended, and Effects.
Basic metrics includes information about character-range heights and such
things as average widths, device resolution, and leading.
Extended metrics is detailed information about the geometry of the font,
including such things as baseline, ascents and descents, orientation, scale,
and so on.
Effects metrics is information about how to synthesize effects such as
underlining and strikeout. To get to this dialog box, you must first go
through the Extended Metrics dialog box.
The Basic Metrics Dialog Box
From the Metrics menu, choose the Basics command to display the Basic
Metrics dialog box. It contains information about font size. The dialog box
contains the following text boxes.
Text box Description
────────────────────────────────────────────────────────────────────────────
Characters
First The first character in the character set. This is the numeric
character code of the first character for which the font
contains a printable character.
Last The last character in the character set. This is usually 127 for
a 7-bit character set, or 255 for an 8-bit character set.
Default The code of the character printed if the driver is asked to
print a character that falls outside the range First through
Last.
Break The character that delimits words in word wrapping. If an
application or the DrawText function is asked to wrap a string
in a box, it will break the string into multiple lines only at
break character positions. This is generally the space character
(32 in both ANSI and ASCII).
Leading
Internal The leading that appears within the height specified by the
height of the font. Diacritical marks appear in this space.
External The recommended additional space to insert between lines. This
space is not already accounted for in the height of the font.
Resolution
Horizontal and Vertical
The number of dots-per-inch at which the font was digitized. For
an HP LaserJet, for example, both of these numbers should be
300.
Widths
Average For proportional space fonts, the average width of all the
characters in the font. This box is relabeled "All" for
fixed-pitch fonts, because all fixed-pitch characters have the
same width. It is represented in font units. The PFM Editor does
not calculate the average width from the width table; it must be
explicitly entered. It is generally the width of the lowercase
x.
Maximum The width in font units of the widest character in the font.
Again, this is not calculated from the user-width table. For
fixed-pitch fonts, this box is not used and is disabled.
Height The height in font units of the character cell, including
internal leading.
Ascent The ascent in font units of the font. The distance from the top
of the character cell to the baseline of the font.
With the exception of the width table for proportional fonts, this dialog
box fills in the remainder of the Microsoft-defined font file header. All of
these text boxes must be specified accurately.
There are also two buttons: OK, which carries out the changes in the PFM
file, and Cancel, which ignores all changes made.
The Extended Metrics Dialog Box
The extended font metrics are a more detailed description of the font's
geometry. The dialog box contains the following text boxes.
Text box Description
────────────────────────────────────────────────────────────────────────────
Lower Case
Ascent The distance in font units from the baseline to the
top of lowercase ascenders, typically measured from
the lowercase d.
Descent The distance in font units from the baseline to the
bottom of descenders, usually specified for
lowercase p.
Point Size The intended size of the font in twips (1/20th of a
point, or 1/1440 of an inch).
Cap Height The height in font units of the font's uppercase
characters, usually taken for the character H.
X Height The height in font units of lowercase characters,
usually the height of the lowercase x.
Slant The angle in tenths of a degree clockwise from the
vertical.
Master Height The size in device units at which the values in the
extent table are exact.
Master Units The Master Height text expressed in font units. If
the two are different, then the device is a linear
scaling device, and the application needs to scale
all values by the ratio of the requested size to
this value.
Scale
Min and Max The minimum and maximum sizes to which a linear
scaling device can scale a font.
Orientation
Portrait and Landscape The orientation of the font, which may be either or
both.
The Master Height, Master Units, and Min and Max Scale boxes are used on
devices that can scale fonts linearly to any size. On devices that do not
scale fonts, these numbers should all be equal to the value in the Height
box from the Basic Metrics dialog box.
All these members come from the EXTTEXTMETRIC structure.
The Effects Metrics Dialog Box
This menu item is disabled (grayed) until you specify the extended metrics.
The information you can then specify in this dialog box tells the driver how
to synthesize effects such as underlining and superscripting, while allowing
for the per-font, per-size customization of these effects. It also forms the
remainder of the EXTTEXTMETRIC structure in the PFM file.
Superscripting, subscripting, underlining, double underlining, and
strikethroughs require two numbers. The vertical position of the effect and
its size. Offsets are measured downward from the baseline of the font, which
means that strikeouts and superscripts will generally have negative offsets.
The size specifies the thickness of lines in font units for the line
effects, or the height in font units for superscripts and subscripts. For
double underlines, you may specify the upper and lower lines independently.
The Tables Menu
This popup menu contains three selections: Widths, Kerning Pairs, and
Kerning Track. Since these are only appropriate for proportional-width
fonts, they are disabled for fixed-pitch fonts.
The width table contains the exact specification, per-character, of the
widths of characters in proportional fonts. Track- and pair-kerning are used
to fine-tune character spacing.
The Width Table Dialog Box
The Width Table dialog box has a scrollable list box containing all the
characters and their widths, represented by decimal numbers in font units.
Notice that, since this table is an absolute requirement for all
proportional fonts, you must set the font pitch to proportional and the
first and last characters in the Basics dialog box before entering a width
table.
Just above the list box is a label number with an edit control next to it.
Whenever a character is selected from the list box, the label changes to the
character's code, and the edit control is changed to its width. The width
can then be changed.
To change the width of a character in the width table in the list box, you
must choose the Width button. If the character is not the last one in the
font, choosing the Width button, or pressing the ENTER key also causes the
selection to be advanced to the next character, which enables you to quickly
enter the entire width table.
The Pair Kerning Table Dialog Box
You can fine-tune character spacing for proportional fonts by using
pair-kerning. The Pair Kerning Table dialog box consists of a list box
containing character pairs and the amount of space to insert or delete
between them. A negative kern amount (given in font units) specifies tighter
spacing, while a positive amount spreads characters out.
The three edit controls are for the From and To characters and the kerning
amount. If you select a kern pair in the list box, the editor displays the
values in the structure for modification.
There are three buttons for manipulating the Pair Kerning Table:
♦ Add, which adds the kern pair to the table in the edit controls.
♦ Delete, which removes the selected kern pair from the list box.
♦ Change, which replaces the selected kern pair with the contents of the
edit control.
The Pair Kerning Table is sorted; adding or replacing a pair does not give
it a particular position in the table.
As in the other dialog boxes, the OK button carries out the changes in the
PFM file, and the Cancel button ends the dialog without saving the changes
to the table.
The Track Kerning Table Dialog Box
You type values into the Track Kerning Table in the same manner as for the
Pair Kerning Table. There are five text boxes to consider.
For the kerning degree, negative values specify tighter kerning, and
positive values specify looser kerning. The minimum size specifies the
smallest size in font units for which track kerning applies, and the maximum
size specifies the largest font.
The minimum amount specifies the amount of track kerning to apply to fonts
of the minimum size and below. The maximum amount is the track kerning to
apply to all fonts at least as large as the maximum size.
The Driver Menu
The PCL printer is currently the only supported printer in the Driver menu.
The PCL Driver dialog box contains information specific to the PCL driver
for HP LaserJet-type printers. The text boxes are as follows.
Text box Description
────────────────────────────────────────────────────────────────────────────
Symbol Set Specifies the HP-defined symbol set for a font. (For more
information about the symbol sets, see the Hewlett-Packard
LaserJet Printer documentation.) The following are the
currently defined symbol sets (selected with individual
buttons):
E.C.M.A. 94
Generic 7
Generic 8
ISO Den/Nor
ISO France
ISO Germany
ISO Italy
ISO Spain
ISO Sweden/Finland
ISO U.K.
Kana 8
Line Draw
Math 8
Math Symbols
Roman 8
Roman Ext.
U.S. ASCII
U.S. Legal
User Defined
Mem Usage An approximation of the amount of memory in the printer that
the soft font requires. This is given as the following
formula:
((sum of all character widths + 7)>> 3) * height + 63
Escape String This is the escape string you send to the printer to select
the font. It may contain any PCL commands. You may use the
following special sequences to type control characters:
\e - escape (ASCII 27, 0x1b)
\[ - escape (ASCII 27, 0x1b)
\n - line feed (ASCII 10, 0xa)
\r - carriage return (ASCII 13, 0xd)
\xnn - hexadecimal character code
\nnn - octal character code
When the PFM Editor displays an escape string, it converts
all non-ASCII printing characters to the hexadecimal format
\xnn.
As in the other dialog boxes, the OK button carries out the changes in the
PFM file, and the Cancel button ends the dialog without saving changes.
Creating PCM Files
The PCL driver uses Printer Cartridge Metric (PCM) files to define
cartridges other than built-in Hewlett-Packard cartridges. PCM files are
essentially a collection of PFM files (one for each font in the cartridge).
To make a PCM file, you must first create the individual PFM files for each
of the cartridge fonts. You can create PFM files easily with the Printer
Font Installer. Simply add the font, which must be in the Hewlett-Packard
PCL format. The Printer Font Installer will automatically scan the PCL font
and create the PFM file. Use the PFM Editor to edit the file. Verify all the
boxes and values. Also, notice that the Printer Font Installer does not
enter the font escape string. You must do this with the PFM Editor.
After you have created all the PFM files and saved them in one directory,
from the File menu, choose the Create PCM File command to display a dialog
box and prompt you for a PCM filename. Put this file in the same directory
as its constituent PFM files.
After you type a filename and choose the OK button, a second dialog box
appears with the PCM filename in a static control at the top. The first edit
control in the dialog box enables you to enter the cartridge title, which
must be a nonempty title (that is, you must fill in the edit control). This
title is the string placed in the cartridge selection list box in the
driver's Printer Setup (device-mode) dialog box. Verify that the correct
font escape string is defined for each PFM file.
The PFM Editor places a list of PFM files, that are in the same directory as
the target PCM file, in a list box on the left side of the dialog box. You
can select one or more of these files and move them to the right-hand
"selected" list box by choosing the Select button (or double-clicking a
filename). You can remove selected PFM files, or place them back in the
left-hand "available" list box by selecting filenames in the same manner in
the right-hand "selected" list box.
When you choose the OK button, the PFM files that appear in the right-hand
list box are placed in the PCM file. To create the PCM file, you must select
at least one PFM file and have a nonempty title string.
When the editor creates the PCM file, it also creates a text file in the
same directory with the same name and the .INI extension. On the first line
of this initialization file is the title of the cartridge; the list of PFM
files follows on subsequent lines, one filename per line. Whenever the PCM
dialog box is chosen, the PFM Editor looks for the .INI file and uses the
stored data to initialize the title string and the list of selected PFM
files.
Note: Editing a PFM file will not cause the PCM file to be updated. The PFM
Editor cannot directly edit PCM files. Therefore, if you make a
change in a PFM file, you must rebuild the PCM file.
Converting PFM Files for Minidrivers
If you want to use a file you've created with the PFM Editor with
minidrivers, you'll need to convert the file using the CVTHPPFM utility. You
run this utility from the MS-DOS command line.
Additionally, if you want to convert 3.1 PFM files to use with 3.0 PFM
files, you can use the CVTHPPFM utility to perform this conversion as well.
The PFM Editor Error Messages
The following error messages can appear when using the PFM Editor. A brief
explanation of why the message appears is given after each message.
Break character not in character set
The break character must be between the first and last character in the
character set, inclusive.
Can't find filename, ignored
The initialization file for a PCM file contained a reference to a PFM file
that is not in the same directory, or that does not have the .PFM
extension.
Can't open filename, ignored
The specified PFM file was in the current directory when the list box of
available PFM files was created. However, when the attempt to write the PCM
file was made, the PFM file could not be read.
Can't write the PCM file
An error occurred while writing to the PCM file, or to the associated
initialization file.
Changing the character range will invalidate the width table
If you enter a width table and then change the first and last characters,
the width table will no longer be valid. This will not occur if you have a
specific font in mind when you create a PFM file.
Couldn't save file filename
The file specified could not be saved because of an error opening or writing
the file, attempting to write over a read-only file, or running out of disk
space.
Default character not in character set
The default character must be between the first and last character in the
character set, inclusive.
Driver information not specified
You attempted to save a file that does not contain PCL driver information.
Error creating the initialization file for filename
The initialization file corresponding to the given file could not be
opened.
Error creating the PCM file filename
The PCM file could not be opened because of an inappropriate filename (such
as a nonexistent directory), a preexisting read-only file of the same name,
or being out of disk space.
filename contains the wrong driver information version
This is a warning indicating that while the PFM file appears to be in the
correct format, the driver-specific information contains a version number
that this PFM Editor does not support.
filename contains the wrong header version number
This is a warning indicating that the PFM header has a version number that
this PFM Editor does not recognize.
filename does not contain driver information
The PFM file does not contain a PCL driver structure.
filename does not contain extended text metrics
This is a warning that the PFM file being read into the PFM Editor does not
contain extended text metrics.
filename has been modified. Save before continuing?
This message allows you to save a file or abort an operation before doing
something that will abandon a modified PFM file, such as choosing the New,
Open, or Exit commands.
filename is not a valid file name
The filename given is invalid because it contains illegal characters or
syntax errors.
filename is not a valid PFM file
The specified file does not contain a PFM file, or the PFM file is either
corrupted or from the wrong version.
Proportional font requires a width table
You attempted to save a PFM file that specifies a proportional font but does
not contain a width table.
Unrecognized device devicename
The PFM contains a device name that the PFM Editor does not recognize. The
only name recognized currently is "PCL/HP LaserJet."
Width table will need to be reentered
This is warning indicating that changing your character range invalidates
your width table.
Write over original filename?
A file with the same name as the filename you specified using the Save As
command already exists. Choose Yes to write over the old file, or No to
choose a new name.
♦