2

I am trying to get started with METAFONT and I created my first glyph using this tutorial. Unfortunately, when I run mf beta.mf in the command line, I receive the error message: Letter beta [66]Error: Can't open display:. I have googled extensively and cannot seem to find the reason for this. Could this be because the gray and black fonts were not compiled correctly? I believe I did compile those fonts correctly and my understanding is that if this were the problem, the proofsheet would simply be full of unintelligible characters; not that the viewer would not open. Here's what my beta.mf file looks like:

u#:=4/9pt#;
define_pixels(u);
beginchar(66,13u#,16u#,5u#);"Letter beta";
    x1=2u; x2=x3=3u;
    bot y1=-5u; y2=8u; y3=14u;
    x4=6.5u; top y4=h;
    z5=(10u,12u);
    z6=(7.5u,7.5u); z8=z6;
    z7=(4u,7.5u);
    z9=(11.5u,2u);
    z0=(5u,u);
    penpos1(2u,20);
    penpos2(.5u,0);
    penpos3(u,-45);
    penpos4(.8u,-90);
    penpos5(1.5u,-180);
    penpos6(.4u,150);
    penpos7(.4u,0);
    penpos8(.4u,210);
    penpos9(1.5u,-180);
    penpos0(.3u,20);
    pickup pencircle;
    penstroke z1e..z2e..z3e..z4e..z5e..z6e..{up}z7e..z8e..z9e..{up}z0e;
    labels(range 1 thru 9);
endchar;
end

I'm getting a little desperate and would greatly appreciate any help!

1 Answers1

3

The problem is that you don't have an X server on your machine. Mac OS X Yosemite doesn't provide it by default.

You can install XQuartz from this link or run

mf-nowin beta.mf
egreg
  • 1,121,712
  • Thank you! Installing X11 helped get rid of the error, but the window still doesn't open (it appears for a fraction of a second and then disappears). What could be the reason for this? – Constantin Mar 09 '15 at 20:01
  • 1
    @Constantin The end command makes the window go away. – egreg Mar 09 '15 at 21:56
  • Thank you! The tutorial is a bit misleading as it implies that the window will open even when the end command is there. – Constantin Mar 09 '15 at 22:27
  • Well, it does open; it just goes away rather quickly. I have found that it's best to script your commands for producing proofs; a script compiling, then converting with gftodvi, then to pdf with dvipdfm (or something like it), then keeping the pdf open and reloading as needed. – dgoodmaniii Mar 10 '15 at 10:23