home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / FONT_KIT.ZIP / COM2DATA.BAS next >
Encoding:
BASIC Source File  |  1993-04-13  |  1.6 KB  |  71 lines

  1. $IF 0
  2. ┌──────────────────────────────────────────────────────────────────────────┐
  3. │ WESTFORD CUSTOM PC/FX        ·■·   COM2DATA.BAS 1.0   ·■·        4/15/93 │
  4. │ CIS: 76470,2417 ┌────────────────────────────────────────────────────────┘
  5. │ 508-692-8163 ┌──┘
  6. └──────────────┘
  7. ■ Extracts raw font data from the executable font file generated by
  8.   FONTEDIT.COM.
  9.  
  10. $ENDIF
  11.  
  12. '$COMPILE EXE
  13. $LIB ALL OFF
  14.  
  15. DEFINT A-Z
  16.  
  17.  
  18.  
  19. '''get file name
  20. if command$="" then
  21.     input "Enter name of FONTEDIT file: ", file$
  22. else
  23.     file$=command$
  24. end if
  25.  
  26. if file$ = "" then end
  27.  
  28. '''does file exist?
  29. file$ = ucase$(file$)
  30. dot = instr(file$, ".")
  31. if dot then
  32.     comfile$ = file$
  33.     file$ = mid$(file$, 1, (dot -1))            'to extract file name w/o ext
  34. else
  35.     comfile$ = file$ + ".COM"
  36. end if
  37.  
  38. ok = len(dir$(comfile$))
  39. if isfalse ok then print "Cannot find file "; comfile$ : end
  40.  
  41. '''extract font data
  42. file1 = freefile
  43. open comfile$ for binary as #file1
  44.  
  45. '''crude check to identify FONTEDIT executable font file
  46. size& = lof(file1)                    'big size& for big mistake
  47. if size& <> 8291 then
  48.     close #file1
  49.     print "The file "; comfile$; " does not appear to be a FONTEDIT 1.0 font file."
  50.     end
  51. else
  52.     fontfile$ = file$ + ".F16"
  53. end if
  54.  
  55. file2 = freefile
  56. open fontfile$ for output as #file2
  57. close #file2                          'clear destination file if it exists
  58. open fontfile$ for binary as #file2
  59.  
  60. seek #file1, 99                                'location of font data
  61. buffer$ = space$(4096)
  62. get #file1, , buffer$
  63. put #file2, , buffer$
  64.  
  65. close #file1, #file2
  66.  
  67. print "Font data written to: "; fontfile$
  68.  
  69. END
  70.  
  71.