
BDF (Bitmap Distribution Format) to QNX Windows Font Conversion Programs
==========================================================================

The suite consists of several programs. All programs except for 'fontdemo'
are run from the shell, without needing to have QNX Windows running.

readbdf   :  reads a .bdf file and creates an individual file per character
             that describes the character in terms of metrics and bitmap.

consolidate: 
             takes all the individual files created by readbdf and consolidates
             them into a QNX Windows font file.
             massaging takes place here as well. See notes.

displayit:   displays the metrics and bitmap of an individual character file
             created by readbdf.

dispqwfont:  displays the metrics and bitmaps of a QNX Windows font file.

fontdemo:    found in /windows/apps
             This program can be used within QNX Windows to test a font. 


Steps to converting a BDF file to a QNX Windows font file
=========================================================

1.Find a bdf font file .. in this example I'll use a file called 'timR24.bdf'

2.Use readbdf to parse the bdf file. There are a number of options on readbdf:
  (type 'use readbdf' for the list)

  -v   verbose.   This will display bdf specifics and bitmaps to stdout as the
                  processing is going on. 
  -o   output_prefix.  This prefix will be used when creating the individual
                  character files. Default is data/qw_    
                  Files will be created as:  output_prefix%u   where %u is
                  the ascii number of the character.
  <timR24.bdf
                  Re-direct stdin to the bdf file that you want to parse.

  e.g. If I want to create the character files in a directory on my ramdisk
       ( called /ram/tmp ) with a prefix of qw_, I would use: 

             readbdf <timR24.bdf -o /ram/tmp/qw_

3.A whole bunch of files (1 for every ascii character) will be created in the
  directory specified.
  The format of these files are as follows:
        first is the _FontMetric structure
        directly following is the bitmap
        then an EOF

4.If I wanted to display what these characters look like, I can use the 
  program 'displayit'. Pass in the files that you wish to look at.

  e.g.     displayit /ram/tmp/qw_* | less
           
  I can examine the metrics and bitmaps of all characters created.

5.Now it is possible to consolidate all these character files into a QNX 
  Windows font file.
  To do this, you use the program 'consolidate'. There are a number of
  options available:

   -i    the prefix for the input ascii files
         default is 'data/qw_'   This will try to read files from
         'data/qw_0' to 'data/qw_255'
         In the example above, the files are in /ram/tmp/ so you would
         use:  -i /ram/tmp/qw_

         All files from 0 to 255 will try to be opened. If the file exists
         then it is assumed that the ascii character for that number exists.
         It will then be included in the consolidated font file.

   -b    baseline position.
         if given, then this value will be used for _FontStruct.BaseLinePos
         if not given, then this value will be calculated from the baselinepos
         for the character 'A'. If 'A' is not defined, then 'B' is attempted.
         If no 'B', then 'C' is used etc.
         In most cases, the capital letter 'A' is a good basis for the global
         baseline position. QNX Windows requires that a global baseline be
         given in the _FontStruct font header, even though a baseline is 
         provided in the individual font metrics.

         Try the consolidate program without specifying -b first. If the font
         is incorrect in the 'fontdemo' program, then a -b option may be
         required.

   -u    underline position.
         if given, then this value will be used for _FontStruct.UnderLinePos
         if not given, then this value will be calculated as:
                   BaseLinePos + 1
         In almost all cases this option will not be used.

   -f    output file name for the font.
         Default if not given is 'testqwf.B09N'
         This option SHOULD be used. See the document 'QWFONT_FORMAT' for
         a description of what the font name should be.

   -w    force the width on all metrics to be the same as the widest character
         Useful if you want to make a fixed width font from a proportional
         font.

  In my example, I want to create a font file called 'Times.B24N'. 

  I would use:
     
      consolidate -i /ram/tmp/qw_ -f Times.B24N

6.at this point I can check the font file created with the program called
  'dispqwfont'.

   e.g. dispqwfont Times.B24N | less

7.to test the font within QNX Windows, do the following:
   
      - copy the font file to /windows/fonts

           e.g. cp Times.B24N /windows/fonts

      - start up QNX Windows.

      - run the program 'fontdemo' . A list of all fonts within /windows/fonts
        will be displayed. Choose 'Times   24  Normal' 

8.to do another font, go back to step __   Make sure that you delete all the
  files within /ram/tmp  first so that it is clean. 

===============================================================================

Notes:

1. The BDF format is completely described in the postscript files:
            bdf.PS, fig1.PS and fig2.PS

