home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxttf.zip / rxttf.doc < prev   
Text File  |  1999-03-14  |  3KB  |  73 lines

  1. 13 March 1999.  Michal Necasek  (mike@mendelu.cz)
  2.                 Daniel Hellerstein (danielh@econ.ag.gov)
  3.  
  4.         RxTTF: A procedure for creating bitmaps from TTF fonts.
  5.  
  6. RxTTF.DLL is an "OS/2 REXX callable" procedure for creating a "bitmap"
  7. image from a character string, using a TTF font.
  8.  
  9. RxTTF can use any TTF font you may have. Furthermore, you can
  10. specify the point size!
  11.  
  12. 1) Installation:
  13.  
  14. After obtaining RxTTF, unzip it to an empty temporary directory.
  15. Then, copy RXTTF.DLL to someplace in your LIBPATH (say, x:\OS2\DLL).
  16.  
  17. 2) Usage:
  18.  
  19. To use RxTTF, you first have to tell your REXX program where to find
  20. it. The following can be used:
  21.  
  22.     isthere=rxfuncquery('rxttf_image')
  23.     if isthere=1 then do
  24.        call RxFuncAdd 'rxttf_image', 'RXTTF', 'rxttf_image'
  25.     end
  26.  
  27. The calling syntax of rxttf_image is:
  28.  
  29.     rc = rxttf_image(message,ttf_file,psize, data)
  30.  
  31. where
  32.   message : a character string, length is limited to 1024 characters.
  33.   ttf_file: the name of the TTF file you want to use
  34.   ptsize  : the point size of to use
  35.   data    : a variable name to use as a stem variable.
  36. and
  37.    rc =  status code. A zero means success
  38.  
  39. rxttf_image returns results in the "data" stem variable (you don't have
  40. to use "data", it can be any valid rexx variable name).
  41.  
  42.    data.!rows =  the number of rows in the image
  43.    data.!cols =  the number of columns in the image
  44.  
  45.    data.i; where i = 0 to data.!rows-1 : the contents of the "ith" row
  46.                      (where row 0 is the top of the image)
  47.  
  48. data.i is a character string, with each character representing the value of
  49. the corresponding pixel. In particular, character values of 0 and 1 are used.
  50.  
  51. Thus: the decimal value of the pixel at the  23 column of the
  52.              9th row of the image is:
  53.                 a_value=c2d(substr(data.8,23,1))
  54.              a_value will equal either 0 or 1.
  55. ....perhaps these would be more accurately described as "byte maps".
  56.  
  57. 3) Examples:
  58.    rc=rxttf_image("Hello","c:\os2\mdos\winos2\system\times.ttf",12,'data')
  59.    rc=rxttf_image('Gone Fishing",'fishing.ttf',25,'messx')
  60.  
  61.  
  62. 4) Notes:
  63.  * RxTTF is based on source code produced by the FreeType project:
  64.        http://www.freetype.org/ft_os2/index.html
  65.  * For ambitious C programmers, the source code is also provided.
  66.  * RxTTF is in the public domain.
  67.  * Use RxTTF at your own risk.
  68.  * RXTTF.CMD is a simple "banner text program" that demonstrates how
  69.    to use RxTTF. For a more feature rich version of this banner program,
  70.    please try TTF_TEXT (look on hobbes.nmsu.edu).
  71.  
  72.  
  73.