@echo off set dumvar= set del= if not "%1"=="-" goto mach set del=rem shift :mach if exist %1.afm goto los echo "Parameter: [-] fontfile [without afm suffix] [MSMenuName | - ] [N | I | B | T]" goto end :los set enc=C:\Adobe\foundry\w if exist %1.enc set enc=%1 if exist %1.inf goto makepfminf egrep CapHeight %1.afm > %1.inf if not errorlevel 1 goto capok egrep FontBBox %1.afm | sed "s,.* \([-0-9][-0-9]*\) *$,CapHeight \1," > %1.inf :capok echo Serif true >> %1.inf echo Pi false >> %1.inf :getstyle if "%3"=="" goto genstyle echo VPStyle (%3) >> %1.inf goto getname :genstyle egrep "FontName.*(Demi|Semi|Bold|Heavy|Black|Ultra|Three)" %1.afm > nul if errorlevel 1 goto testweight goto testobl :testweight egrep "Weight.*(Demi|Semi|Bold|Heavy|Black|Ultra)" %1.afm > nul if errorlevel 1 goto notbold :testobl egrep "FontName.*(Italic|Oblique|Slanted)" %1.afm > nul if errorlevel 1 goto bold echo ItalicAngle -20 >> %1.inf echo VPStyle (T) >> %1.inf goto getname :bold echo VPStyle (B) >> %1.inf goto getname :notbold egrep "FontName.*(Italic|Oblique|Slanted)" %1.afm > nul if errorlevel 1 goto normal echo ItalicAngle -20 >> %1.inf echo VPStyle (I) >> %1.inf goto getname :normal echo VPStyle (N) >> %1.inf :getname if "%2"=="" goto genname if "%2"=="-" goto genname if not "%3"=="" echo DOS command restriction: family name may not contain blanks echo MSMenuName (%2) >> %1.inf goto makepfm rem this was used with dos grep and without sed: :gennameold grep FamilyName %1.afm | sort > MSMenu$$.bat call MSMenu$$.bat type MSMenu$$.i >> %1.inf %del% del MSMenu$$.bat %del% del MSMenu$$.i goto makepfm :genname egrep -e FamilyName %1.afm | sed "s,FamilyName *\(.*\) *$,MSMenuName (\1)," >> %1.inf rem with DOS grep, grep -o could be used here instead of egrep -e :makepfm C:\Adobe\foundry\makepfm.exe -e %enc%.enc -i %1.inf -l nul %1.afm %del% del %1.inf if exist %1.pfm goto end goto error :makepfminf C:\Adobe\foundry\makepfm.exe -e %enc%.enc -i %1.inf -l nul %1.afm if exist %1.pfm goto end :error echo off echo makepfm failed. Possible errors: echo 1. CapHeight entry must be present (last value of B box of letter H) echo 2. StartCharMetrics entry must contain exact number of character entries echo 3. Character entries must have B box information. To fake them, take echo the FontBBox x1 y1 x2 y2 entry and insert behind every character's echo N (name) entry: B x1 y1 x2 y2 ; echo 4. makepfm doesn't seem to like character position 0 in afm files echo 5. .inf file was not built properly :end