# $ K + Launching the UFM editor
The UFM file cannot easily be edited without knowing which GTT file is associated with it (the GTT file describes what characters are actually in the font, and how to make the printer draw them).  Because of this, there are restrictions in this version specific to UFM files.
In particular, the only way a UFM file can be edited is to launch the editor from the Workspace editor.  To do this, select the font you wish to edit, and press Enter, double click with the mouse, or use the editing menu for the selected item.
You will be able to add UFM files to a workspace in the next version, and to open or create new UFM files if they use one of the predefined Translation Tables.  Since opening a UFM file without an associated GTT, or by querying for the location of the GTT, is inherently unsafe, it is not a planned feature.

# $ K + UFM files and the UFM editor
A UFM file describes a single device font.  It contains a great deal of complex information:
·	Flags describing how the font is used, and what it looks like
·	Metrics describing the size, shape, style, and many other aspects of the font
·	An optional width table showing the width of each character if the font is variable pitch .
·	An optional kerning pairs table if the font is variable pitch and kerning is used.
·	Optional structures used to adjust the font metrics for fonts that a printer can simulate bold or italic versions of.
·	Information describing how the font can be scaled, if the font is scalable.
Units used in metrics
Except where noted, the units used in describing the font depend upon the type of font.
Scalable fonts are described in arbitrary font units.  These units are mapped to master units at the unscaled size of the font using information on the Scalability Metrics tab.  
All other fonts describe their metrics directly in master units. 
As might be expected, the editor is also fairly complex.  It consists of 8 property sheets:
1.	General Information 
2.	General Information (2) 
3.	Metrics (General) 
4.	Selection and Flags 
5.	Simulations 
6.	Scalability Metrics 
7.	Character Widths 
8.	Kerning Pairs 
These sheets are described in the subsequent pages.

# $ K + UFM Editor General Information tab
This tab allows you to view and modify the names by which the font is known to both the user and to GDI, and several flags of a global nature to the font.
{bml UFMGI1.SHG}
UFM editor general information tab.  Click on any control for further information.
The face name is typically formed by appending the style to the default family name, and the unique name is typically formed by prepending the resource DLL base name to the face name.
The Windows NT IFIMETRICS structure allows you to specify multiple family names for a font, which is why a combo box is used for these names.
To add a family name, type it into the edit control for the combo box, and press the Add button.
To remove a family name, select it from the list in the combo box, and press the Remove button.  You must have at least one family name for the font.
Changing the character pitch and scalability settings affects information shown on other tabs.  Changing the pitch can cause a slight delay while average character widths are recalculated.

# $ Family Name
The name of the font “family”.  Fonts with the same family name share similar visual appearance and style.  You can specify multiple family names for a font.  This affects the font’s behavior with respect to the EnumFonts and EnumFontFamilies API.

# $ Add Family Name button
Press this to add the name in the Family name edit control to the list of family names for this font.

# $ Remove Family Name button
Press this to remove the selected family name from the list of family names associated with this font.

# $ Face Name
The name of the font which would be used in a LOGFONT or LOGFONTW structure.

# $ Style Name
Optional name giving the font style, for instance, Light Oblique or Demibold.  It should match the weight and other settings for the font.  In conversion, only bold and italic settings are used to generate this name.

# $ Font Unique name
This is intended to be a completely unique name for the font.  If there are Courier 10 cpi fonts for two different printers, this uses the printer name to form a name which differentiates the two.
However, examining many existing Windows NT minidrivers shows that often this name isn’t unique within a single resource DLL.  This program does not verify uniqueness at this level, either.

# $ Character style flags
These flags show how the font is represented visually- underlined, struck out, or italicized.

# $ Character pitch settings
Press these buttons to set fixed or variable pitch.  There can be a slight delay when this setting is changed, as the average character width is recalculated.

# $ Scalability flag
Use this button to turn scaling on or off.  If turned off, the general metrics and character widths may need to be reentered, as they were expressed in font units, and must now be in master units.

# $ Font Units
Font Units are the units in which all measurements except for resolution (which defines the master units), italic angles (always in 10ths of a degree) and character weights (no units) are expressed.
If the font is not scalable, then font units are identical to master units.  If the font is scalable, then font units may have greater resolution than master units.  The conversion between font units and master units for scalable fonts is defined on the Scalability Metrics tab of the UFM editor.

# $ K + UFM Editor General Information (2) tab
This tab allows you to specify additional global flags related to how the font is used by the printer, and by UniDriver. This includes the specification of the master units, where the font information resides, and more.
{bml UFMGI2.SHG}
UFM Editor General Information (2) tab.  Click any control for further details.
Because changing the GTT assigned to a UFM file is an inherently unsafe operation, and the correct checking for it is very complex, the GTT assignment is read-only in this version of the product.

# $ Font Location
States where the font glyph information resides.  The available choices are:
Resident-the information is always part of the printer, typically in a ROM.
Primary in Cartridge-the font information is in a cartridge, where it is the main font for the cartridge.
Secondary in cartridge-the font’s glyphs are in a cartridge, but the font is not the default font in the cartridge.
Downloadable-the font is a software font that can be downloaded to the printer.

# $ Scalable font technology
The font’s scalable technology, e.g. HP IntelliFont, Canon CAPSL.  This control is disabled when the font is not scalable.

# $ Master Unit Specification
These controls let you enter the master units in the X and Y direction.

# $ Baseline Adjustments
These entries are used where the printer’s definition of the font baseline differs from that used by GDI.  The baseline is adjusted up or down before and after using the font according to the amount entered here in Y master units. 

# $ Centering adjustments
Sometimes a printer’s definition of the origin of a character cell differs from GDI’s.  This setting adjusts the X-offset used in placing a character to handle these differences.  The measurement is in X master units.
Differences in the vertical or Y direction are handled by the baseline adjustment settings.

# $ Private Data
This is a 16-bit value available for the printer driver to use.  For 16-bit minidrivers, it was used to describe supported simulations.  No checking is done on the value you enter here.

# $ Associated GTT description
The name of the GTT file that shows how to print the characters in this font.  This setting is read-only.  If the GTT is predefined, the name of the predefined table is used.  Otherwise, it is the name of the GTT as shown in the workspace editor.

# $ K + UFM Editor Metrics (General) tab
This tab lets you define the metrics that describe the size and intended usage of the font.  It includes an animation of the various metrics.
The most common metrics have individual edit boxes.  More detailed metrics can be selected, viewed, and edited using the combo box and spin control at the bottom of the sheet.
{bml UFMMET.SHG}
UFM editor Metrics (General) tab-press any control area for further details.
The Unicode translations for the special characters are done using the first code page in the associated GTT file.
The available special metrics are:
Baseline-the offset from the top of the character cell to the font baseline, minus any internal leading in font units.  This is the value shown in the animation.
Capital H height-the height of the ascender for the capital H, given in font units.  If this value is 0, a default will be calculated by GDI.
Lowercase x height-the height of the ascender for a lowercase x, also in font units.  Again, a value of 0 will cause a suitable default to be calculated.
Internal leading-the amount of blank space at the top of the character cell built into the font, given in font units.
External leading-the amount of space that should be used between lines of characters in this font, given in font units.
Superscript height, width, X offset, and Y offset-the size and offset of the superscript version of the font
Subscript height, width, X offset, and Y offset-the size and offset of the subscript version of the font
Italic Angle-the angle, given in 10ths of a degree clockwise from a vertical line, at which the font is slanted.
Underline offset and width-defines the placement and size of an underline for the font.
Strikeout offset and width-defines the placement and size of a strike-through line for the font.
Lowercase p descender-given in font units.  This is only available when the font is scalable.
Lowercase d ascender-given in font units.  Also available only when the font is scalable.
The editor performs internal checks to keep these values consistent with the font height and width, as well as each other.

# $ Font Family
The general family of the font- these settings match those defined for the lfPitchAndFamily member of the LOGFONT structure.  The settings are:
Modern-Fixed pitch fonts
Swiss-Variable pitch fonts without serifs 
Roman-Variable pitch fonts with serifs
Decorative-Novelty fonts, dingbats, and the like
Other-anything else

# $ Character Set
This defines the character set, as used in the lfCharSet member of the LOGFONT structure.  Some checking is done here with respect to DBCS code pages and DBCS characters sets to guarantee consistency.

# $ Font Animation
In this area of the tab, the font metrics are animated.  The font used in the animation is the best matching TrueType font with the same family, size, and weight characteristics as those you specify.  As you select different special metrics in the special metrics combo box, they will be displayed in the animation area.
Note that since this is NOT the exact font you are using on the printer, the animated values may not look right when displayed.  They do provide some guidance as to what the metric actually does, however.

# $ Font Height
The font height in font units.  This is the full cell height, including the ascender, descender, and any internal leading.

# $ Font Weight
This is the font weight, expressed in a range from 0 (thinnest) to 1000 (thickest).

# $ Maximum Character Width
This is the maximum width of any character in the font.  In non-DBCS variable pitch fonts, this value cannot be altered, and is calculated from the character width table.

# $ Average character width
This is a read-only value, as it can always be correctly determined from the available font data.
·	If the font is a DBCS font, it is ½ of the maximum width, and it represents the actual (for fixed pitch) or nominal (for variable pitch) width of the glyphs represented by single-byte character codes in the font.
·	If the font is not DBCS, and is fixed pitch, this value is the same as the maximum width entered above.
·	If the font is not DBCS and is variable pitch, it is the average of the width of the space character and the lowercase characters ‘a’ to ‘z’, if they exist in the font.
·	If the lowercase characters do not exist in a non-DBCS variable pitch font, then it is the average width of all of the characters in the font.

# $ First and last character codes
These are read-only values because they are derived from the associated GTT file.  They represent either the SBCS or Unicode values for the highest and lowest code point in the font.  If this is a DBCS font, then the highest value will always be 0xFF, because only one byte is reserved in the GDI structure being edited here.
These values are represented in hex.  The choice of SBCS or Unicode is made using the nearby radio buttons.

# $ Default character
The character which is to be used when a request is made to print a non-existent character.  It is either SBCS or Unicode depending upon the selection made nearby.  It must be a code with an SBCS representation.

# $ Break character
The blank or line-breaking space character.  It must be a code with an SBCS representation.  It is almost always 0x20 (ASCII space).  Will be SBCS or Unicode depending upon the nearby selection.

# $ Character representation selection
Press one of these buttons to select the encoding you wish to view and enter the special characters in.

# $ Special Metric Selection
Select the special metric you wish to view/edit, and/or animate, using this drop-down list.

# $ Special Metric value
The value of the selected metric in the appropriate units.  You may spin this value up or down, or enter it directly to change it.

# $ Serifs
Serifs are decorative features appearing at the end of the strokes in a glyph.  Fonts without serifs tend to be easier to read at small resolutions, which is why they are commonly used in help text and dialogs.
This line of text has no serifs.
This line of text has serifs.

# $ K + UFM Editor Selection and Flags tab
This tab allows you to specify the string issued to the printer select the font, and a final set of global flags that spilled over from the other sheets.
{bml UFMSEL.SHG}
UFM Editor Selection and Flags tab-click over any control for further information.

# $ Font Selection command
This is the string sent to the printer to cause it to load this font.  Non-alphanumeric characters are displayed and entered using \x notation, as in C.  Spaces are also significant, so only use them where they actually belong in the command sequence.  This can be an empty string.

# $ Font Deselection command
This is the string, if any is needed, sent to the printer to cause it to unload this font.  Non-alphanumeric characters are displayed and entered using \x notation, as in C.  Spaces are also significant, so only use them where they actually belong in the command sequence.

# $ Simulation Flags
These check boxes show which versions of the font the printer is capable of providing.  If the bold and/or italic flag is checked, then the corresponding flag(s) on the Simulations tab must also be set.  The editor does not yet catch this error.

# $ Carriage return flag
Set this flag if a carriage return character must be sent to the printer after a line of text.

# $ Overstrike via Backspace flag
Set this flag if the backspace character will always back up over the previous character in a way that will guarantee correct overstriking.  This is only relevant when the associated GTT file requires overstriking of two-byte codes.  See Predefined tables tab for further information on the overstrike flag.

# $ K + UFM editor Simulations tab
This tab allows you to describe how the metrics for any bold or italic versions of the font produced by the printer differ from the normal one.
{bml ufmsim.BMP}
UFM editor Simulations tab for a font for which the printer provides a bold version.
Click the appropriate check box to enable a simulation.  Enter the values for the weight, maximum and average width, and (for italic fonts) the italic angle .  When you first enable a simulation, the current values for the font will be copied to these controls.  These settings will be adjusted if they conflict with the normal font settings (e.g., if you make the normal font heavier, and it becomes heavier than the weight shown in your bold setting).
Caveats:  These apply only to the Beta 1 version.  
·	If you enable bold and italic simulations, you must enable the bold italic simulation and provide settings for it.
·	The enabling of bold and italic simulations must match the corresponding flags on the Selection and Flags tab.

# $ Italic Angle
The angle by which the font slants from the ascender.  It is expressed in 10ths of a degree, and in a clockwise direction.

# $ K + UFM editor Scalability Metrics tab
This tab lets you define how to convert font units to master units, and the range of sizes through which a scalable font can be scaled.
{bml ufmscale.BMP}
The font units entry is the same as the font height field on the General Metrics tab, minus any internal leading (thus it is the ascender + descender = the em height).  These values must be for the font size at which any character width information is exact.
The Master Units entry is the same height expressed in master units.
Specify the orientations in which the font can be displayed in the Orientation group box.
The maximum and minimum sizes the font can be scaled through can be viewed and edited in either integral point sizes, or master units.  Warning:  Do not express these values in font units unless they are identical to master units.

# $ K + UFM editor Character Widths tab
If your font is variable pitch, you can use this tab to view, sort, and edit the character width information.
{bml ufmwid0.BMP}
The Character Widths tab after a couple of code points have had their widths adjusted.
To change a width, select it with the keyboard and press F2, or select it with the mouse, and then hold the left button down for about 1 second.  Type in the new value and use Cancel or Enter to accept or reject the new value.
The data can be sorted in ascending or descending order in either column by clicking on the column headers.  In the above case, clicking the Code Points column a second time sorts it in reverse order, and then clicking the Width column twice gives it first precedence, and ascending order, producing the following result:
{bml ufmwid1.BMP}
Character widths sorted in ascending order by width, then descending order by code point.
DBCS fonts have fixed width glyphs for all of the DBCS-encoded code points, so these are not available for entry here.  Neither are any single-byte codes above 0x7F, as these are also fixed pitch.

# $ K + UFM editor Kerning Pairs tab
This tab allows you to define kerning pairs for a variable pitch font.  It is disabled if the font is fixed pitch.
{bml ufmkrn00.BMP}
UFM editor Kerning pairs tab (initially empty) after right clicking the mouse in the view.
The three columns are for the first and second character in the pair, and the amount by which the inter-character gap is to be adjusted.
This can be sorted in ascending or descending order in any priority using the column headers.  For a description of this mechanism, see  Sorting the displayed code points.  Although the column names are different here, the mechanism is identical.
The F10 key displays a context menu (or takes you directly to the Add Kern Pair dialog if there are no pairs defined).  The F2 key allows you to change the kern amount for a pair, while the Delete key is used to delete a pair.
All of these functions can be accessed using the mouse by selecting an item if necessary and right clicking.
{bml ufmkrn01.BMP}
UFM editor Kern Pairs tab showing a context menu for the first pair.
There is a limit of 512 pairs in Windows NT GDI.  The editor enforces this limit.

# $ Kerning
Kerning is the altering of the space between adjacent characters to make them more visually appealing.  It is handled in the UFM by specifying pairs of characters to kern, and the amount (usually negative) in font units by which the spacing is to be adjusted.

# $ K + Add Kern Pair dialog
This dialog allows you to specify the pair of characters to kern , and the amount by which they can be kerned.
{bml addkern.BMP}
Select the first and second character from the dropdown lists, and type the kern amount in the edit control.  The lists in the dropdowns are maintained using the code points in the GTT and the current set of pairs so that you cannot specify an invalid or already existing pair.