home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
On Hand
/
On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso
/
00049
/
s
/
disk1
/
msttfont.in_
/
msttfont.in
Wrap
Text File
|
1992-03-11
|
2KB
|
74 lines
DECLARE FUNCTION SafeCreateFOT LIB "fontname.dll" (a%,b$,c$,d$) AS INTEGER
DECLARE FUNCTION GetFontFacename LIB "fontname.dll" (a$,b$,c%) AS INTEGER
DECLARE FUNCTION CreateFOT (ttfPath$) AS STRING
DECLARE FUNCTION GetFaceName (ttfPath$) AS STRING
FUNCTION GetFaceName (ttfPath$) STATIC AS STRING
szBuf$ = string$(256, 32)
res% = GetFontFacename(ttfPath$, szBuf$, 256)
IF res% = 0 THEN
GetFaceName = ""
ELSE
GetFaceName = szBuf$
END IF
szBuf$ = ""
END FUNCTION
FUNCTION CreateFOT (ttfPath$) STATIC AS STRING
sysDir$ = GetWindowsSysDir()
SPLITPATH ttfPath$, ttfDrv$, ttfDir$, ttfBase$, ttfExt$
fotExt$ = ".FOT"
fotPath$ = sysDir$ + ttfBase$ + fotExt$
fotExists% = DoesFileExist (fotPath$, femExists)
IF fotExists% = 0 THEN
fotBase$ = ttfBase$
ELSE
i% = 1
WHILE (fotExists% = 1) AND (i% < 1000)
fotDigits$ = STR$(i%)
fotDigits$ = "_" + MID$(fotDigits$,2,LEN(fotDigits$)-1)
fotBase$ = MID$(ttfBase$, 1, (8-LEN(fotDigits$))) + fotDigits$
fotPath$ = sysDir$ + fotBase$ + fotExt$
fotExists% = DoesFileExist (fotPath$, femExists)
i% = i% + 1
WEND
END IF
CreateFOT = ""
IF fotExists% = 0 THEN
IF MID$(sysDir$,LEN(sysDir$),1) = "\" THEN
sysDir$ = MID$(sysDir$,1,LEN(sysDir$)-1)
END IF
ttfName$ = ttfBase$+ttfExt$
res% = SafeCreateFOT (0, fotPath$, ttfName$, sysDir$)
IF res% <> 0 THEN
CreateFOT = fotBase$+fotExt$
END IF
END IF
fotBase$ = ""
fotExt$ = ""
fotPath$ = ""
sysDir$ = ""
ttfBase$ = ""
ttfDir$ = ""
ttfDrv$ = ""
ttfExt$ = ""
ttfName$ = ""
fotDigits$ = ""
END FUNCTION