MF(1) MF(1) NAME mf,inimf−Metafont,alanguageforalphabetdesign SYNOPSIS mf[firstline] inimf[firstline] virmf[firstline] DESCRIPTION METAFONTreadstheprograminthespecifiedfilesandoutputsfontrasters(ingfformat)and fontmetrics(intfmformat).TheMETAFONTlanguageisdescribedinTheMETAFONTbookby DonaldE.Knuth,publishedbyAddison-Wesley. LikeTEX,METAFONTisnormallyusedwithalargebodyofprecompiledmacros,andfontgenerationinparticularrequiresthesupportofseveralmacrofiles.Thebasicprogramascompiledis calledinimf;itcanbeusedtoprecompilemacrosintoa.basefile.Thevirmfvariantisusedto reloadthe.basefilesquickly.Typically,virmfhaslinkstoitbythenamesofthevariousbase files.Forexample,ifyoulinkfootovirmfandthenexecutetheprogramfoo,yougetthebasefile foo.base.Youcanloadadifferentbasebysaying,e.g.,virmf&mybase. AsdescribedinTheMETAFONTbook,thecommandline(orfirstinputline)shouldotherwisebegin withafilenameora\controlsequence.Thenormalusageistosay mf’\mode=<printengine>;[mag=magstep(n);]’inputfont tostartprocessingfont.mf.Thesinglequotesarethebestwayofkeepingyourshellfrommisinterpretingthesemicolonsandfromremovingthe\character,whichisneededheretokeepMETA-FONTfromthinkingthatyouwanttoproduceafontcalled‘‘mode’’.(Oryoucanjustsaymfand givetheotherstuffonthenextline,withoutquotes.)Othercontrolsequences,suchasbatchmode(forsilentoperation)canalsoappear.Thename‘‘font’’willbethe‘‘jobname’’,andisused informingoutputfilenames.IfMETAFONTdoesn’tgetafilenameinthefirstline,thejobname is‘‘mfput’’.Thedefaultextension,.mf,canbeoverriddenbyspecifyinganextensionexplicitly. Alogoferrormessagesgoesintothefilejobname.log.Theoutputfilesarejobname.tfmand jobname.<number>gf,where<number>dependsontheresolutionandmagnificationofthefont. The‘‘mode’’inthisexampleisshowngenericallyas<printengine>,asymbolictermforwhichthe nameofanactualdeviceor,mostcommonly,thename‘‘localfont’’(seebelow)mustbesubstituted.Ifthemodeisnotspecifiedorisnotvalidforyoursite,METAFONTwilldefaultto‘‘proof’’ modewhichproduceslargecharacterimagesforuseinfontdesignandrefinement.Proofmode canberecognizedbythesuffix.2602gfafterthejobname.Examplesofproofmodeoutputcanbe foundinComputerModernTypefaces,(VolumeEofComputersandTypesetting),byDonald Knuth.ThesystemofmagstepsisidenticaltothesystemusedbyTEX,withvaluesgenerallyin therange0.5,1.0,2.0,3.0,4.0and5.0.Alistingofgfnumbersfor118-dpi,240-dpiand300-dpi fontsisshownbelow. MAGSTEP118dpi240dpi300dpi mag=magstep(0)118240300 mag=magstep(0.5)129263329 mag=magstep(1)142288360 mag=magstep(2)170346432 mag=magstep(3)204415518 mag=magstep(4)245498622 mag=magstep(5)294597746 Magnificationcanalsobespecifiednotasamagstepbutasanarbitraryvalue,suchas1.315,to createspecialcharactersizes. Beforefontproductioncanbegin,itisnecessarytosetuptheappropriatebasefiles.Theminimumsetofcomponentsforfontproductionforagivenprint-engineistheplain.mfmacrofileand thelocal‘modedef’file.Themacrosinplain.mfcanbestudiedinanappendixtothe 24Apr92 1 MF(1) MF(1) METAFONTbook;theyweredevelopedbyDonaldKnuth,andthisfileshouldneverbealtered exceptwhenitisofficiallyupgraded.Eachmodedefspecificationhelpsadaptfontstoaparticularprint-engine.ThereisaregulardiscussionofmodedefsinthejournaloftheTEXUsers Group,TUGboat;thelocalonesinuseonthiscomputershouldbein /usr/TeX/lib/mf/macros/modes.mf.Withonlyplain.mfandthe‘‘modes’’fileloadeditis possibletocreatefontsofsimplecharacters,suchasthoseusedfortheMETAFONTlogo,andthose usedfortheLaTEXlineandcirclefonts,buttheproductionofComputerModernfontswouldbe facilitatedbymakingacmmf.basefile(whichincludesthemacrosincmbase.mfaswellasthosein plain.mf). SeveralenvironmentvariablescanbeusedtosetupdirectorypathstosearchwhenMETAFONT opensafileforinput.Forexample,thecshcommand setenvMFINPUTS.:/usr/me/mylib:/usr/TeX/lib/mf/macros ortheshcommandsequence MFINPUTS=.:/usr/me/mylib:/usr/TeX/lib/mf/macros exportMFINPUTS wouldcauseallinvocationsofMETAFONTanditsderivativestolookfor\inputfilesfirstinthe currentdirectory,theninahypotheticaluser’s‘‘mylib’’,andfinallyinthesystemlibrary.Normally,theuserwillplacethecommandsequencewhichsetsuptheMFINPUTSenvironmentvariableinhisorher.loginor.profilefile. TheeresponsetoMETAFONT’serror-recoverymodeinvokesthesystemdefaulteditorattheerro-neouslineofthesourcefile.Thereisanenvironmentvariable,MFEDIT,thatoverridesthedefault editor.Itshouldcontainastringwith"%s"indicatingwherethefilenamegoesand"%d"indicatingwherethedecimallinenumber(ifany)goes.Forexample,anMFEDITstringforthevieditor canbesetwiththecshcommand setenvMFEDIT"/usr/ucb/vi+%d%s" Theenvironmentvariablessectionbelowliststherelevantenvironmentvariables,andtheir defaults. Aconvenientfileinthelibraryisnull.mf,containingnothing.Whenmfcan’tfindthefileit thinksyouwanttoinput,itkeepsaskingyouforanotherfilename;responding‘null’getsyouout oftheloopifyoudon’twanttoinputanything. ONLINEGRAPHICSOUTPUT METAFONTcanusemostmoderndisplays,soyoucanseeitsoutputwithoutprinting.Chapter23 ofTheMETAFONTbookdescribeswhatyoucando.ThisimplementationofMETAFONTusesenvironmentvariablestodeterminewhichdisplaydeviceyouwanttouse.Firstitlooksforavariable MFTERM,andthenforTERM.Ifitcan’tfindeither,yougetnoonlineoutput.Otherwise,the valueofthevariabledeterminesthedevicetouse:hp2627,sun(forSunView),tek,uniterm (foranAtariSTTek4014emulator),xterm(foreitherX10orX11).Someofthesedevicesmay notbesupportedinallMETAFONTexecutables;thechoiceismadeatcompilationtime. ENVIRONMENT Thedefaultvaluesforallenvironmentvariablesaresetatthetimeofcompilationinafilesite.h. Seetex(1)forthedetailsofthesearching.IftheenvironmentvariableTEXMFOUTPUTisset, METAFONTattemptstoputitsoutputfilesinit,iftheycannotbeputinthecurrentdirectory. Again,seetex(1). MFINPUTS Searchpathforinputandopeninfiles.Itshouldbecolon-separated,andstartwith‘‘.’’. Default:.:/usr/TeX/lib/mf/macros:/usr/TeX/src/TeX+MF/typefaces//. MFBASES Searchpathforbasefiles.Default:/usr/TeX/lib/mf/bases. 24Apr92 2 MF(1) MF(1) MFPOOL SearchpathforMETAFONTinternalstrings.Default:/usr/TeX/lib/mf. MFEDIT Commandtemplateforswitchingtoeditor.Default:/usr/bin/TeXeditor+%d%s. MFTERM, Determinestheonlinegraphicsdisplay. FONTUTILITIES Anumberofutilityprogramsareavailable.Thefollowingisapartiallistofavailableutilitiesand theirpurpose.ConsultyourlocalMETAFONTgurufordetails. gftopkTakesaGFfileandproducesamoretightlypackedPKfontfile. gftodviProducesproofsheetsforfonts. gftypeDisplaysthecontentsofaGFfileinmnemonicsand/orimages. pktypeMnemonicallydisplaysthecontentsofaPKfile. mftFormatsasourcefileasshowninComputerModernTypefaces. FILES /usr/TeX/lib/mfMETAFONT’slibraryareas /usr/TeX/lib/mf/mf.poolEncodedtextofMETAFONT’smessages /usr/TeX/lib/mf/bases/*.baseMETAFONTbasefiles /usr/TeX/lib/mf/macros/plain.mf The‘‘standard’’macropackage /usr/TeX/lib/mf/macros/modes.mf Thefileof‘‘modedef’’sforyoursite’svariousprinters /usr/TeX/src/TeX+MF/typefaces/cm/cm*.mf METAFONTsourcesforComputerModern SUGGESTEDREADING DonaldE.Knuth,TheMETAFONTbook(VolumeCofComputersandTypesetting) DonaldE.Knuth,METAFONT:TheProgram(VolumeDofComputersandTypesetting) DonaldE.Knuth,ComputerModernTypefaces(VolumeEofComputersandTypesetting) TUGboat(thepublicationoftheTEXUsersGroup) COMMENTS Warning:‘‘Typedesigncanbehazardoustoyourotherinterests.Onceyougethooked,youwill developintensefeelingsaboutletterforms;themediumwillintrudeonthemessagesthatyouread. Andyouwillperpetuallybethinkingofimprovementstothefontsthatyouseeeverywhere,especiallythoseofyourowndesign.’’ SEEALSO gftopk(1),gftodvi(1),gftype(1),mft(1),pltotf(1),tftopl(1) BUGS OnJanuary4,1986the‘‘final’’buginMETAFONTwasdiscoveredandremoved.Ifanerrorstill lurksinthecode,D.E.Knuthpromisestopayafindersfeewhichdoubleseveryyeartothefirst personwhofindsit.Happyhunting. AUTHORS METAFONTwasdesignedbyDonaldE.Knuth,whoimplementeditusinghisWEBsystemforPascalprograms.ItwasoriginallyportedtoUnixbyPaulRichardsattheUniversityofIllinoisat Urbana-Champaign.ThispagewasmostlywrittenbyPierreMacKay. 24Apr92 3