home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 58
/
af058b.adf
/
PV21.lha
/
PV_Import
/
ConvertPSfont
next >
Wrap
Text File
|
1992-08-19
|
3KB
|
102 lines
/* ConvertPSfont --- Intuition Front-End (rexxarplib) for
PSImport Type1 font conversion. Copyright 1992 by Stylus, Inc.
USAGE:
* Double-click the macro icon.
* Select font(s) to be converted from file requester.
(It will support multiple selection under AmigaDOS 2.0.)
KNOWN BUGS:
* If source or destination is "Ram Disk:*" this macro will fail.
(Don't blame me, I didn't name a device "Ram Disk:" :^)
*/
call open STDOUT,"RAM:RxOut.txt",W
call open STDERR,"RAM:RxErr.txt",W
trace R
if ~show('L',"rexxsupport.library") then call addlib "rexxsupport.library",0,-30,0
/* Requires "rexxarplib.library" to call file requester */
if ~exists("LIBS:rexxarplib.library") then
do
say "Requires REXXARPLIB.LIBRARY in LIBS:!"
exit
end
else
do
if ~show('L',"rexxarplib.library") then call addlib "rexxarplib.library",0,-30,0
end
/* test for presence of c:RequestFile to determine OS version, ASL/ARP, etc.*/
if exists("c:RequestFile") then DOS = 3
/* test for presence of ASL to determine OS version, ASL/ARP, etc.*/
if ~exists("LIBS:asl.library") then OldDOS = T
address command
/* Get current PSImportPath for restoring */
success = open(ENV,"ENV:PSImportPath",R)
if success = 1 then do
EnvPath = readln(ENV)
call close ENV
end
else EnvPath = "SYS:"
/* If OS 3.0 we can use RequestFile */
if DOS = 3 then
do
address command 'RequestFile Pattern "#?.PFB" Title "Select Font" AcceptPattern "#?.PFB" MultiSelect NoIcons'
EXIT
end
AGAIN:
/* if OS 1.3 get one font, convert, and loop back to here */
if OldDOS = T then
do
FontPath = getfile(175,50,"#?.PFB",,"Select a Source FontName.PFB")
if FontPath = "" then
do
say "Program cancelled!"
exit
end
call ConvertFont
call Again
end
/* If OS 2.0, we can multi-select and batch process fonts */
/* Initialize options string for ASL file requester */
FRoptions = "PATGAD,MULTISELECT"
/* Call file requester to get source fonts (Use ENVPATH ? */
call GetFile(175,50,,,"Select a Batch of Fonts",,FRoptions,FontList,,,"#?.PFB")
if FontList.0 = 0 then
do
say "Program cancelled!"
exit
end
/* Loop through batch list of fonts */
do i=1 to FontList.0
FontPath = FontList.i
call ConvertFont
end
/* Restore PSImportPath */
success = open(ENV,"ENV:PSImportPath",W)
if success = 1 then do
call writeln(ENV,EnvPath)
end
call delay(100)
EXIT
CONVERTFONT:
/* Mass concatentation */
ConvertFont = "'PV_Import:PSImport File="||FontPath||" Type1=True NewColors=False AskUser=False"||"'"
say "Converting " ||FontPath|| "!"
interpret ConvertFont
say ""
return