@echo off set dumvar= set del= if not "%1"=="-" goto mach set del=rem shift :mach 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 end 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 end :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 :end