/*****************************************************************************/ /* xfont.cmd Install extended-size SysPro & Warpsans fonts to support 'Text Size' (C) 2023 Ulrich M”ller. (C) 2023 R L Walsh */ /*****************************************************************************/ err_unlock = 'Unable to find xunlock.exe or unlock.exe.' err_nofile = 'Unable to find font file' err_noneed = 'Update not needed for' xit = 0 nul = x2c('00') /*****************************************************************************/ call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs' call SysLoadFuncs /* get the boot drive */ if RxFuncQuery('SysBootDrive') = 0 then boot = SysBootDrive() else do temp = SysSearchPath('PATH', 'CMD.EXE') if temp = '' then boot = '' else boot = Left(temp, 2) end /* get this script's directory - our other files should be here too */ Parse Source . . thisFile src = Left(thisFile, Lastpos('\', thisFile) - 1) /* find an unlock utility */ xunexe = Stream(src'\..\bin\xunlock.exe', 'c', 'query exists') if xunexe = '' then do xunexe = SysSearchPath('PATH', 'UNLOCK.EXE') if xunexe = '' then do say err_unlock exit 8 end end /* install the fonts */ if InstallSysPro() > 0 then xit = 2 if InstallWarpSans() > 0 then xit = 2 '@del' thisFile exit xit /*****************************************************************************/ InstallSysPro: if Stream(src'\syspro.fon', 'c', 'query exists') = '' then do say err_nofile 'System Proportional' return 2 end newsize = Stream(src'\syspro.fon', 'c', 'query size') if Stream(boot'\psfonts\syspro.fon', 'c', 'query exists') <> '' then oldsize = Stream(boot'\psfonts\syspro.fon', 'c', 'query size') else oldsize = 0 if newsize > oldsize then do if oldsize > 0 then '@'xunexe boot'\psfonts\syspro.fon' '@copy' src'\syspro.fon' boot'\PSFONTS\SYSPRO.FON' call SysPutEA boot'\PSFONTS\SYSPRO.FON', '.LONGNAME', '' call SysIni 'USER', 'PM_Fonts', 'SYSPRO', boot'\PSFONTS\SYSPRO.FON'nul end else say err_noneed 'System Proportional' '@del' src'\syspro.fon' return 0 /*****************************************************************************/ InstallWarpSans: if Stream(src'\warpsans.fon', 'c', 'query exists') = '' then do say err_nofile 'WarpSans' return 2 end newsize = Stream(src'\warpsans.fon', 'c', 'query size') if Stream(boot'\psfonts\warpsans.fon', 'c', 'query exists') <> '' then oldsize = Stream(boot'\psfonts\warpsans.fon', 'c', 'query size') else oldsize = 0 if newsize > oldsize then do if oldsize > 0 then '@'xunexe boot'\psfonts\warpsans.fon' '@copy' src'\warpsans.fon' boot'\PSFONTS\WARPSANS.FON' call SysPutEA boot'\PSFONTS\WARPSANS.FON', '.LONGNAME', '' call SysIni 'USER', 'PM_Fonts', 'WARPSANS.FON', boot'\PSFONTS\WARPSANS.FON'nul end else say err_noneed 'WarpSans' '@del' src'\warpsans.fon' return 0 /*****************************************************************************/