@echo off

rem
rem    This is instfont.btm, a batch file for 4DOS/4OS2 written by
rem    Werner Lemberg <a7621gac@awiuni11.bitnet>.
rem    It creates a whole set of .pk and .tfm fonts for one CJK ttf font.
rem
rem    The only parameter is the name of the ttf font (without extension)
rem

set ttfpkdir=d:\china\pk
set ttftfmdir=d:\china\tfm

mkdir /s %ttfpkdir >& nul
mkdir /s %ttftfmdir >& nul

do i = 1 to 9
  set pkname=%ttfpkdir\%1`0`%i.pk
  set tfmname=%ttftfmdir\%1`0`%i.tfm
  iff not exist %pkname .or. not exist %tfmname then
    echo %1`0`%i
    call makettfp %1`0`%i %1`0`%i.pk 0%i %1 300
    move %1`0`%i.pk %ttfpkdir > nul
    move %1`0`%i.tfm %ttftfmdir > nul
  endiff
enddo

do i = 10 to 55
  set pkname=%ttfpkdir\%1%i.pk
  set tfmname=%ttftfmdir\%1%i.tfm
  iff not exist %pkname .or. not exist %tfmname then
  else
    echo %1%i
    call makettfp %1%i %1%i.pk %i %1 300
    move %1%i.pk %ttfpkdir > nul
    move %1%i.tfm %ttftfmdir > nul
  endiff
enddo
