# $ K + Introduction
The Beta 1 version of the Windows NT 5.0 Minidriver Development Tool is designed to:
1.	Simplify the conversion of existing Windows 95 or Windows 3.1 minidrivers to Windows NT.
2.	Allow you to further modify and enhance your minidriver to take advantage of NT 5.0 features.
The tool consists of the following major functions:
·	Minidriver Workspace Editor 
·	Minidriver Conversion Wizard 
·	Glyph Translation Table (GTT) Editor 
·	UniDriver Font Metrics (UFM) Editor 
·	Generic Printer Description (GPD) Editor 
Experienced UniTool users should find this program much easier to use.
·	Very few modal dialogs are used.  Multiple items can be worked with at any time- you can even work with multiple minidrivers.
·	The font editors do as much of the work for you as is feasible.  You do not need to fully understand the font file formats, nor must you specify the same value in more than one place simply because it appears in more than one structure.
·	Newer UI features such as context menus, tree views, list views, and tool tips are used extensively.
·	Tool bars and windows are easily positioned to suit your working style.

# $ K + Minidriver Workspace Editor
While a single printer model needs only a single GPD file, it is common practice to place the font resources (UFM files, GTT files, string table entries, etc.) in a resource DLL which is used by several models.
A minidriver workspace is based upon the RC file for the resource DLL.  It also contains a list of the GPD files associated with that DLL.  From the editor’s window, you can easily launch an editor for any of these files.  The workspace also enforces consistency rules to prevent you from creating an invalid resource file.  In the final version, this will be extended to your GPD file, as well.

For further information, see What is a minidriver workspace? .

# $ K + Minidriver Conversion Wizard
Producing minidrivers for Windows NT has always been done by converting minidrivers designed for Windows 3.1 and Windows 95.  The conversion process has been a manual and labor intensive process, involving command line tools, use of the graphic tools UniTool and NTGPCEdt, copying and editing of RC files, and more.
The Minidriver Conversion Wizard automates virtually all of these steps.  It is capable of creating all of the minidriver source files for all of the previous versions of Windows NT as well as for Windows NT 5.0.  This includes:
·	Automatic conversion of PFM and CTT files to the IFI/RLE formats used for earlier versions of Windows NT, and to the UFM/GTT format used for Windows NT 5.0.
·	Automatic generation of RC Files with the correct file names and resource IDs for each operating system.
·	Automatic conversion of GPC data to GPD files for NT 5.0.
·	Automatic creation of a Minidriver workspace in which all of these are registered.
·	Using built-in code page information, it is possible to convert minidrivers for any locale on any machine- previously it would be necessary to use a machine running an operating system for the locale in which the minidriver was to be run to get the correct Unicode conversions.

For further information, see Converting an Existing Minidriver .

# $ K + Glyph Translation Table (GTT) Editor
The GTT editor is a property sheet.  The primary tab lists all of the code points in the table, and their associated selection strings and code page , in a list view control.  The control allows you to sort the list on any of these fields in any precedence and ascending descending order, by clicking on the sort headers (you will find this is true of all list views in this tool).  
The remaining tabs allow the addition of secondary code pages to the table (for printers with multiple code pages in a single font), and for specifying/viewing the use of one of the predefined GTT files built into UniDriver 5.0.
For further information on using the GTT editor, see Glyph Translation Tables and the GTT Editor .

# $ K + UniDriver Font Metrics (UFM) Editor
The UFM editor is an 8-tab property sheet.  Not all of the tabs have meaning for each UFM file, though.  If the font is fixed pitch , the character width and kerning tabs will not be useful, and if the font is not scalable, the same is true of the scalability metrics tab.
The editor is designed so that you enter the minimum of information needed to describe your font.  The editor will maintain consistency, and fill in the various structures (many of which contain redundant information) for you.
The editor tabs are:
1.	General Information - this lists the name strings which identify the font to the user and to GDI, along with generic flags, such as whether the font is fixed or variable pitch , and whether it is scalable, italic, underlined, and so on.
2.	General Information (2)- this describes the associated GTT file, the font location (resident in the printer, in a cartridge, etc.) and scalable technology (if relevant), as well as some edit controls for some little-used adjustments.
3.	General Metrics- the font height, weight, family, character set, break and default characters, as well as a set of controls with an associated animation that allow you to specify and visualize a set of more detailed metrics. 
4.	Selection and Flags- lets you specify the font selection and de-selection strings, as well as several global flags relating to simulation and font usage.
5.	Simulations- allows you to specify corrected values for weight, width, and italic angle for any bold, Italic, or bold italic versions of the font the printer can produce.  This reduces the number of fonts you must define.
6.	Scalability Metrics- if a font is scalable, then the metrics are in arbitrary units at a nominal point size.  This sheet lets you define a maximum and minimum size, and relate the nominal (font) units to master units, as well as state if the font exists in both portrait and landscape orientations.
7.	Character Widths- if the font is variable pitch, you can specify the width of each code point in this list view.  You can also sort this list by width in either order.
8.	Kerning Pairs- if the font is variable pitch, you can define kerning pairs here.  This is also a list view, and you can sort on first character, second character, or the kern amount, in any order desired.
For further information see UFM files and the UFM editor 

# $ K + Generic Printer Description (GPD) Editor
This is a simple text editor.  Comments are colored green (special warning and error comments issued by the GPD converter in the conversion wizard are colored brown and red, respectively).  When the editor is active, a toolbar button allows you to syntax check the GPD.  You can browse backward and forward through the error list (and be placed on the correct source line, while source line information is intact) with F4/Shift-F4 or a special dialog bar at the base of the window. 
Error information is cached if you are editing a GPD file from the driver workspace.  This allows you to save the error log as a to-do list between sessions.  You may check items off the list as you see fit.
For additional information, see Editing a GPD file 

# $ Master Units
The least common multiple of the various resolutions your printer supports.  Typically, it is the highest resolution you provide.

# $ Fixed and variable pitch
In a fixed pitch font, all of the characters are the same width.  An exception to this is found in DBCS fonts, where the double-byte characters are twice the width of the single-byte characters, but both sizes are fixed.

In a variable pitch font, each character can have a different width.  In DBCS fonts, only the single-byte characters can be of a variable width.

# $ K + Special UI features
The following section describes some of the features designed to make your job of developing a Windows NT minidriver with the Minidriver Development Tool easier.

# $ K + About Box
This dialog describes the program version, and gives you some information about the system on which you are running.
The installed code pages list is a list of those your computer currently has available to it.  The supported code pages list is a list of all of the code pages your operating system (Windows 95 or Windows NT, as the case may be) supports.
In some cases, you may notice that a code page is unnamed.  This is because a definition of the code page purpose was not available at the time the program was written.

# $ K + Tip of the day feature
This presents a dialog box with a series of useful tips for using the Minidriver Development Tool and working with minidriver source files.  The tips are stored in a file named TIPS.TXT in the directory in which the program files reside.  Each tip is a line in the file.  If others in your organization will be using this program, you may wish to add your own tips to the file.

# $ K + Converting an Existing Minidriver
This section of the document helps you to convert an existing minidriver for Windows 95 or Windows 3.1 to any of the Windows NT versions.
The information is presented in the following order:
1.	Conversion: Getting started 
2.	Conversion: Invoking the Wizard 
3.	Conversion: Selecting a conversion method 
4.	Conversion: Specifying the source file location .
5.	Conversion: Specifying the target directory or directories 
6.	Custom Conversion:  Targeting earlier NT versions 
7.	Custom Conversion:  UniTool 
8.	Custom Conversion:  Selecting code pages for Unicode mapping of CTT files 
9.	Custom Conversion:  Converting files 
10.	Custom Conversion:  Creating an NT.GPC file 

# $ K + Conversion: Getting Started
To convert an existing minidriver, you must begin with the source files for a 16-bit minidriver, built with UniTool.  The UniTool program, which is included in the DDK, has its own help file.  You will also find documentation on the tool in the MSDN Library Archive, and most recent MSDN versions.
The source files that you must have are:
·	The RC file generated by UniTool, and perhaps edited further by your development team.
·	The GPC data file produced by UniTool.
Both of these files must reside in the same directory.
In addition, if you have any device fonts, the PFM and CTT files must be in the locations your RC file says they are.
Note:  If your minidriver can actually be built from the files used, you will have satisfied these criteria.  If you happen to have missed something, you can always begin again.  The typical conversion process takes very little time.

# $ K + Conversion: Invoking the Wizard
You invoke the conversion wizard in this version of the tool by asking to create a new minidriver workspace.  You can do this by pressing Ctrl+N on your keyboard, the File New menu item, or the New button on the toolbar.
 
You will then see the first page of the wizard.

# $ K + Conversion: Selecting a conversion method
On the first page of the conversion wizard, you are asked to choose one of two conversion methods:
·	Standard:  This is the recommended method, and will work for the vast majority of minidrivers.  A standard conversion assumes the following:
1.	You do not want to generate minidriver source files for the earlier versions of Windows NT.
2.	You will use the current ANSI code page to convert the byte codes in your CTT files to Unicode.  This setting has no effect if you used a predefined CTT ID.
·	Custom:  A custom conversion allows you to generate source files for earlier versions of Windows NT, and to specify a code page for each CTT file (OEM or ANSI, for all locales for which the tool has code pages).  If you create files for earlier versions of Windows NT, it also provides you with the opportunity to run UniTool and the NT.GPC file creation tool (the latter must be run to build these minidrivers).
{bml WIZARD1.SHG}
First page of the Minidriver Conversion Wizard.  Press any of the buttons for further details.
Once you have selected the desired method, you may proceed by pressing the “Next” key.  If you should change your mind before the Wizard is done, you may back up to this step, and select the other method.

# $ Standard Conversion
This is a default conversion with the most common options.  It will:
·	Create Windows NT version 5.0 source files (RC, GPD, GTT, and UFM) but no other Windows NT version.
·	Use the current ANSI code page for converting CTT files to GTT files, unless you are in a DBCS locale, in which case the US English ANSI code page 1252 will be used (Windows 95 and Windows 3.1 minidrivers do not use DBCS encoding in CTT files).
·	Convert GPD files using the bin names from Common.RC, and by collecting paper size names from the spooler.
·	Use the base name of the RC file name as the unique name base for all UFM files.

# $ Custom conversion
Use the custom conversion if:
1.	You want to generate minidriver source files for the earlier versions of Windows NT (3.x and 4.0).
2.	You want to use a different name than the RC file base name to name the fonts in your UFM files (but you may also edit these later, if you want to).
3.	You know that a different code page than the ANSI code page for the locale your version of Windows NT is for was used to encode characters in the Windows 95 minidriver (for instance, the minidriver is for a different country than your own).
4.	You wish to view or modify your existing minidriver files with UniTool before you convert them.  If errors are encountered during a standard conversion, you may need to do this.

# $ K + Conversion: Specifying the source file location
Once you have decided which conversion method to use, you will be presented with a file open dialog for the Windows Explorer.  It will allow to select a file with either an RC (which is the normal resource compiler script extension) or W31 (which is a common extension on the proper RC files from earlier versions of the Windows NT DDK) extension.
If your RC file has neither of these extensions, you must rename it.
{bml wizfind.bmp}
Once you have selected the file, press Open to proceed.

# $ K + Conversion: Specifying the target directory or directories
In this step of the Wizard, you will be presented with a target directory for each Windows NT version you have selected.  By default, these will be in NTx (3, 4, or 5) directories directly beneath the directory for your source minidriver exists.
You may type in a new directory name for each targeted version, if needed.
 {bmc WIZDEST.SHG}
Destination selection page of the minidriver conversion wizard.  Press any control for details.
If an entry is not correct, you will receive a message box stating that the target directory could not be created.
In addition to the directory or directories you name, separate subdirectories are used in each version for font (UFM or IFI) and character translation (GTT or RLE) files.
If you are doing a standard conversion, this is the final step of the Wizard.  Press Finish, and the conversion will take place.  If the conversion fails, you will be returned to this step, so you can fix whatever problems were noted during the conversion.

# $ Destination directory
The directory name you enter in any of these controls will be created, if the rest of the path already exists.  The Windows NT 5.0 directory will also have UFM and GTT subdirectories made, while the other versions will have IF and RLE subdirectories.
A failure to make any of these directories will result in an error message.
# $ K + Custom Conversion: Targeting earlier NT versions
If you select custom conversion, the next step after identifying your source files is to identify which Windows NT versions you want to create source files for.  You will always create Windows NT 5.0 source files, but here have the option of generating the files for Windows NT 4.0 and for Windows NT 3.x. 
In addition, an edit control at the bottom contains a driver unique name.  This name is used in converting font files to create a (hopefully) unique name for each font in GDI’s name space.  Thus, while your printer model and a competitor’s model may both have fonts named Roman, each will also have a unique name (e.g., My Roman, Their Roman) to GDI.
You can change the driver unique name here.  You can also change the font unique names later, if you need to, using the built-in UFM editor.
{bml WIZTARG.SHG}
Optional target selection page of the minidriver conversion wizard.  Press any control for further information.
Once you have completed your entries, you may proceed to select the destination directories with the Next button, or go back and start from different source files with the Back button.

# $ Windows NT version 4.0 minidrivers
This will:
·	copy the original GPC file,
·	convert PFM files to IFI format,
·	convert CTT files to RLE format,
·	generate an NT.GPC file, and 
·	generate an RC file with all of the correct file names and resource ID information for these files in it.
Any RC information not related to the above (e.g., a version resource) is carried into the new RC file as well.
The difference between a Windows NT 4.0 and a Windows NT 3.x driver is primarily in the SOURCES file used for the BUILD program.  This version of Minidriver Development Tool does not yet generate this file for you. 

# $ Windows NT version 3.x minidrivers
This will:
·	copy the original GPC file,
·	convert PFM files to IFI format,
·	convert CTT files to RLE format,
·	generate an NT.GPC file, and 
·	generate an RC file with all of the correct file names and resource ID information for these files in it.
Any RC information not related to the above (e.g., a version resource) is carried into the new RC file as well.
The difference between a Windows NT 4.0 and a Windows NT 3.x driver is primarily in the SOURCES file used for the BUILD program.  This version of Minidriver Development Tool does not yet generate this file for you. 

# $ Driver Unique name
This name is used to uniquely name all of your device fonts by prefixing.  In other words, in this example, a device font named Bodoni would be given a unique name of Dec3200 Bodoni.  This name defaults to the base name of your original RC file.
Font Unique names may also be edited in the UFM editor.
# $ K + Custom Conversion: UniTool
This represents a step that is always optional, but often turns out to be necessary when converting older minidrivers.
UniTool is the tool used to create and maintain the RC, GPC, CTT, and PFM files for Windows 9x and Windows 3.1 minidrivers.  If you experience problems during conversion, or wish to make some late adjustments, this provides you an opportunity to do so.
Press the pushbutton to run UniTool, or Next/Back to move about the other steps in the Wizard.
{bml WIZUNIT.SHG}
Minidriver conversion wizard optional UniTool page.  Press any button for further details.
When you exit the dialog with the “Next” button, the RC File from UniTool will be loaded and interpreted, and the conversion process will begin in earnest.
Note:  The version of UniTool in use here does not accept a command line.  You will be in the correct directory to load the RC and other files, but you must do the file open command yourself.  The UniTool help file is included in the DDK, and is accessible in the usual manner.

# $ Run UniTool button
Press this button to run UniTool.  You will not be able to use other features of Minidriver Developer Studio while running UniTool in this fashion (although you can if you start another copy of the program).  For further information on Unitool, see the UniTool help file.

# $ K + Custom Conversion: Selecting code pages for Unicode mapping of CTT files
In this step, you have the option of change the code page used for MBCS-to-Uniicode conversion of each CTT file.  The code page used for each CTT file is also used to translate name strings for the font files that use that CTT File.
The list box shows you, for each CTT listed in the original RC file, the code page that will be used to translate it.  This defaults to the current ANSI code page for the operating system you are running.  The About box will tell you what code page that is, at any time.
{bml WIZCPSEL.SHG}
Code Page Selection Page of the minidriver conversion wizard.  Press any control for details.
To change the code page for a CTT file, select the CTT file in the list box, and press the Change Page… button to bring up the Code Page Selection Dialog.
Once you believe you have the correct code pages selected, proceed by pressing the Next button.

# $ CTT-to-code page assignments
This list box shows each of the CTT files in the original minidriver, and the code page assigned to each for conversion purposes.  Where the code page name and purpose is identified in an SDK, it is listed after the page number.  Otherwise, only the number is given.
To change an assignment, select the CTT file from this list, and press the Change Page button.  The Code Page Selection dialog will be invoked for this CTT file.
Hint:  You will need to change code pages if your printer uses an OEM character set, or is for a different country than your own.  If you do choose an incorrect page, you can make corrections using the GTT editor (but not if you are building minidrivers for earlier versions of Windows NT). 
CTT files are SBCS-encoded, so DBCS code pages are rarely used in this step.

# $ Change Page button
Press this button to change the code page for the CTT file selected in the list box.

# $ K + Custom Conversion: Converting files
In this step of the conversion process, you may optionally change the GPC – to – GPD conversion method, prior to completing the source file conversion process.
Once you press the Convert Files button, the CTT, PFM, and GPC file(s) will be converted into GTT/RLE, UFM/IFI, and multiple GPD files respectively.  Errors and warning messages from the GPD converter will be stored in the resulting minidriver workspace for each GPD file, and may be viewed after the Wizard is complete.
{bml WIZCNVT.SHG}
Click on any button on this picture for more detail on what it does.

Once the files are successfully converted the Next or Finish button is enabled so you can continue.  If conversion fails, you will probably have to go back to a previous step to correct the problem.

# $ K + Custom Conversion: Creating an NT.GPC file
If you are creating a minidriver for earlier versions of Windows NT, then you will need to create an NT.GPC file.  This file contains information related to system halftoning, and it is described in the DDKs for the earlier Windows NT versions.
{bml WIZNTGPC.SHG}
Press the button to run the editor.  Once you have saved your results, the NT.GPC file will be duplicated, if needed, to place a copy in each of the necessary target directories.  You may then press Finish.
This is the final step in the conversion Wizard.  You have successfully created all of the source files for your new minidrivers.

# $ Start GPC Editor button
Press this button to start the NT GPC editor.  You will need to select your RC file from the list presented when the editor starts (this program does not accept a command line).
Remember to save the GPC file before you leave it.  The wizard should not let you proceed if you have not done so, but a bug allows you to do this.

# $ Write Strings into GPD File
The display names of paper sizes and of input bins will be written directly into the GPD file.  This is the simplest conversion option, but the resulting GPD file is not localizable.

# $ Use Standard Macro Names
In this option, the Microsoft-provided file stdnames.gpd is used to provide value macros for the display names of the supported paper sizes and input bins.  You do not need to install this GPD file on the end user’s machine (i.e., it does not need to be placed in your INF file)- however, if you are running in a multi-locale environment, all users will see the display names in the locale of the print server.
To parse this GPD file with the GPD editor, you will need to copy the stdnames.gpd file from the proper DDK directory.

# $ Use Predefined String table IDs
In this option, the common.rc file is included in the resource DLL.  It provides standard paper and bin names via a known set of resource IDs, and these resource IDs are used in your GPD file in *rcNameID form.  The conversion wizard will automatically make the required changes to your RC File for this option.

# $ Predefined Bin Names, Paper Names from Spooler
This is the default option for GPD conversion.  Bin names are mapped to specific resource IDs, which are provided by the common.rc file, but paper names are retrieved from the spooler’s Forms database.

# $ Convert Files
Press this button to begin the conversion process.  The GPC file and any font files you provided will be converted into the desired formats.

# $ Back button
Press this button to move back one step in the Wizard.

# $ Next Button
Press this button to move on to the next step of the Wizard.

# $ Cancel button
Press this button to cancel the current operation.

# $ Help button
Press this button to display this help page.

# $ Code Page
A code page is a mapping from an ANSI or OEM character set (typically single or double-byte) to Unicode.  The code page information used in the Minidriver Development Tool is derived from the code pages used by the various operating systems.  However, unlike the systems, in this tool the conversions are one-to-one, to facilitate correctly tracking the value of the code point for each character as code pages are changed in the editors.

# $ K + Creating a minidriver from scratch
This couldn’t even be done with UniTool, where you had to pick an existing driver as a template.  So you still can’t get there from here.  However, if you have a 16-bit minidriver handy (you can find them in the Windows 95 DDK), you can do the following:
1.	Delete all of the models but one.
2.	Create as many CTT files as you will need GTT files.  In other words, as many files as you support different character encoding commands in the device fonts used for your printer.  You need not be accurate with respect to the encoding information you put in them.
3.	Create as many PFM files as you will need.  For each PFM file, enter the correct CTT Id, as you cannot change this value after the conversion.  Do not make the font variable pitch, and do not worry about the font metrics, as you can use the UFM editor to establish these.
4.	Convert the minidriver.
5.	Edit the GTT and UFM files to establish the correct information.
6.	Edit the GPD files from the conversion, and import any additional files you may need.

# $ K + Building the minidriver
Once you have converted the workspace, you will have an RC file in the NT version 5.0 target directory that correctly lists the GTT and UFM files needed to build the Resource DLL.  You can find templates for the other files you will need in the DDK samples.  To build, you must:
·	Create a SOURCES file specifying what must be built.  For the resource DLL, this can be only the RC file, since Win32 DLLs do not need initialization code.
·	You may need to adjust the #include files in the RC file.  They will initially be the same as those used for the 16-bit minidriver, except that Common.RC is added if needed, and mindrvrc.h is replaced by unirc.h.
·	You will want to modify the version resource, if you used one.  This can be done with Visual Studio or similar tools.
There is no build step needed for GPD files.  If you are using an OEM DLL, build it with the standard NT tool set.