Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

My main experience with Metafont was Christopher Grandsire's The METAFONTtutorial which I think is a good and concise description of the language and its tricks, but I've missing one important part: how to produce a .PDF or printed document using your newly created font.

So. How can I write a Hello World document using a newly created font with Metafont? (Or with any other font I would've created by a package such as Fontographer, FontForge, etc.)

share|improve this question
    
I believe this is as simple as \font\myfont=mymetafont.mf \myfont This is my meta font \vfill\eject\bye when mymetafont.mf is in the working directory, or the font paths searched by TeX. –  WillAdams Nov 6 '13 at 14:16
    
@WillAdams Running my tex hello.tex example I get a .dvi which I cannot read in my dvi reader. dvips produces the same result, and ps2pdf does not show the commanded characters. pdftex reports error “!pdfTeX error: pdftex (file chlscr): Font chlscr at 600 not found” and luatex reports “! Font \myfont=chlscr.mf not loadable: metric data not found or bad.” I might be missing some step. –  Carlos Eugenio Thompson Pinzón Nov 6 '13 at 15:54
    
I think this may then be addressed by the FAQ: tex.ac.uk/cgi-bin/texfaq2html?label=useMF –  WillAdams Nov 6 '13 at 16:29
1  
Found the problem: I failed to create the metric file with the gftomk command. –  Carlos Eugenio Thompson Pinzón Nov 6 '13 at 23:35
1  
@CarlosEugenioThompsonPinzón I think you mean the gftopk command, which creates a .pk file. Metafont itself creates the metric file (exension .tfm). The error you quote from pdftex indicate a missing file named chlscr.600pk. On the other hand the error from luatex indicates a missing .tfm file. That could come from using the incorrect \font command. It should be \font\myfont=chlscr (without extension), not \font\myfont=chlscr.mf. –  Dan Nov 7 '13 at 7:01

1 Answer 1

up vote 2 down vote accepted

Okay this is a working example using LaTeX:

\documentclass{article}
\newfont{\myscr}{chlscr}
\begin{document}
This is a {\myscr hello world} example:

{\myscr
The quick brown fox jumps over the lazy dog.
}
\end{document}

And this is a working example using plain TeX, as suggested by WillAdams:

\font\myfont=chlscr.mf Hello: \myfont hello world \vfill\eject\bye 

For these examples to work, I need to run
mf '\mode=ljfour; input chlscr.mf' to create the chlscr.600gf and chlscr.tmf files.
gftopk chlscr.600gf chlscr.600pk to create the chlscr.600pk file.

Without this metric files pdftex and pdflatex will fail. (and tex and latex commands will compile but the generated .dvi won't work.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.