home *** CD-ROM | disk | FTP | other *** search
- $IF 0
- ┌──────────────────────────────────────────────────────────────────────────┐
- │ WESTFORD CUSTOM PC/FX ·■· COM2DATA.BAS 1.0 ·■· 4/15/93 │
- │ CIS: 76470,2417 ┌────────────────────────────────────────────────────────┘
- │ 508-692-8163 ┌──┘
- └──────────────┘
- ■ Extracts raw font data from the executable font file generated by
- FONTEDIT.COM.
-
- $ENDIF
-
- '$COMPILE EXE
- $LIB ALL OFF
-
- DEFINT A-Z
-
-
-
- '''get file name
- if command$="" then
- input "Enter name of FONTEDIT file: ", file$
- else
- file$=command$
- end if
-
- if file$ = "" then end
-
- '''does file exist?
- file$ = ucase$(file$)
- dot = instr(file$, ".")
- if dot then
- comfile$ = file$
- file$ = mid$(file$, 1, (dot -1)) 'to extract file name w/o ext
- else
- comfile$ = file$ + ".COM"
- end if
-
- ok = len(dir$(comfile$))
- if isfalse ok then print "Cannot find file "; comfile$ : end
-
- '''extract font data
- file1 = freefile
- open comfile$ for binary as #file1
-
- '''crude check to identify FONTEDIT executable font file
- size& = lof(file1) 'big size& for big mistake
- if size& <> 8291 then
- close #file1
- print "The file "; comfile$; " does not appear to be a FONTEDIT 1.0 font file."
- end
- else
- fontfile$ = file$ + ".F16"
- end if
-
- file2 = freefile
- open fontfile$ for output as #file2
- close #file2 'clear destination file if it exists
- open fontfile$ for binary as #file2
-
- seek #file1, 99 'location of font data
- buffer$ = space$(4096)
- get #file1, , buffer$
- put #file2, , buffer$
-
- close #file1, #file2
-
- print "Font data written to: "; fontfile$
-
- END
-
-