home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / LASER / FONTLD.ZIP / WIDTHTBL.TXT < prev    next >
Encoding:
Text File  |  1990-06-29  |  5.0 KB  |  94 lines

  1.  
  2.  
  3.                             FontLoader Width Tables
  4.  
  5.  
  6. FontLoader can create a width table when the "-WT" option is specified.  The 
  7. width table is an ASCII file.  Each line contains information about the font.  
  8.  
  9. Most application programs have their own format for creating printer drivers 
  10. and or width tables.  By creating an ASCII file,  a program can be easily 
  11. created to read this file and create a new file in the application programs 
  12. format.  
  13.  
  14. Presently,  only one program has been written to read FontLoader's width table 
  15. and create a new file for an application program.  This program is 
  16. "WT2SPL.EXE".  It is for Sprint.  It reads FontLoader's width table and 
  17. creates a file in Sprint's programing language.  The source code is provided.
  18.  
  19. Most major application programs have programs available to add support for 
  20. any soft font.  I suggest looking for these programs first.  If you can't find 
  21. one of these programs for your application program,  then you can write it 
  22. yourself.  The program I used to write FontLoader's documentation,  Sprint,  
  23. does not have an automated method for adding a soft font.  This prompted me to 
  24. create "WT2SPL.EXE".  It does the majority of the work for me.  
  25.  
  26. The source code to "WT2SPL.PAS" is written in Turbo Pascal 5.0 (no objects).  
  27. This language has been chosen because,  in my opinion,  it it the easiest to 
  28. understand for those who don't know the language.  For example:  C programers 
  29. should be able to make sense of it whereas those who don't know C would be 
  30. bewildered by C.  
  31.  
  32. If you plan on writing a program ike "WT2SPL.EXE",  I suggest modifying the 
  33. source code "WT2SPL.PAS".  If you get it running and wish to donate it to 
  34. others,  please send me a copy and I will include it with FontLoader.
  35. 
  36.  
  37.  
  38. The following is an explanation of each of the first fourteen lines in a 
  39. FontLoader width table:
  40.  
  41. Line
  42. ----
  43.  1  Orientation  ( "0" if portrait.  "1" if landscape.                        )
  44.  2  Symbol_Set   ( A number.  Must be computed to find the single digit plus  )
  45.                  ( single letter format that is used in escape codes.         )
  46.                  ( Formula:  digit  = (Symbol_Set and 224) div 32             )
  47.                  (           letter = char((Symbol_Set and 31) + 64)          )
  48.  3  Spacing      ( "0" if fixed spacing.  "1" if proportional.                )
  49.  4  Pitch        ( Number of quarter dots per character.                      )
  50.                  ( Formula:  chars/inch = 300 / (Pitch / 4)                   )
  51.  5  Height       ( Height in quarter dots.                                    )
  52.                  ( Formula:  point size = (72 / 300) * (Height / 4)           )
  53.  6  Style        ( "0" if upright.  "1" if italic.                            )
  54.  7  Weight       ( Ultra Thin "-7" to Ultra Black "7".                        )
  55.  8  Typeface     (                                                            )
  56.  9  Font_Type    ( "0" if only ASCII codes 32 to 127 are printable.           )
  57.                  ( "1" if ASCII codes 32 to 127 and 160 to 255 are printable. )
  58.                  ( "2" if all except 0, 7, 15, and 27 are printable.          )
  59. 10  Baseline     ( Distance in dots from the top of the character cell to the )
  60.                  ( baseline.                                                  )
  61. 11  Cell_Width   ( In dots.                                                   )
  62. 12  Cell_Height  ( In dots.                                                   )
  63. 13  XHeight      ( In quarter dots.                                           )
  64. 14  Font_Name    ( An optional string usually containing the font name.       )
  65.  
  66. 15  This line,  line fifteen,  is text indicating that character information 
  67.     follows.  Ignore this line.  
  68.  
  69. The rest of the lines are character information lines.  There is one line for 
  70. each character defined in the font file.  Each line has six numbers,  text 
  71. strings,  right justified in ten spaces.  Following is a list of the items 
  72. respectively: 
  73.  
  74. Char_Num         ( The ASCII number of the character being defined.           )
  75. Deltax           ( In quarter dots.                                           )
  76. Char_Width       ( In dots.                                                   )
  77. Char_Height      ( In dots.                                                   )
  78. Left_Offset      ( In dots.  May be negative.                                 )
  79. Top_Offset       ( In dots.  May be negative.                                 )
  80.  
  81. Most applications printer drivers and width tables use only the Deltax value 
  82. for the character width.  Undefined characters are usually given the Pitch to 
  83. substitue for Deltax.  This is how the space character is normaly defined.    
  84. Both Deltax and Pitch are usually divided by 4 to obtain dots from quarter 
  85. dots.  
  86.  
  87. I suggest creating a width table and looking at the results.  
  88.  
  89. Remember: Pitch, Height, XHeight, and Deltax are all in quarter dots. Divide 
  90.           by four to obtain the value in dots.
  91.  
  92.  
  93.  
  94.