[metapost] Problem with generating EPS from MetaFont source

Michael Ummels michael.ummels at rwth-aachen.de
Mon Nov 29 17:02:06 CET 2010

Hi guys,

I am trying to use MetaPost to generate EPS files for each character in a
MetaFont as described in Appendix B of the MetaPost manual. However, some
strokes do not come out correctly or are missing at all in the resulting EPS
files. I would be glad if somebody could tell me what is going wrong.

To replicate my results, run "mpost '&mfplain \mode:=localfont; mag=100.375;
input test'" on the file test.mf, which is given below. In the resulting EPS
files test.2 and test.3, strokes are missing/incorrect, whereas test.0 and
test.1 are fine.

Interestingly, the problem does not occur when using pencircle instead of

Any ideas?


And here is the contents of test.mf:

font_size := 10pt#;
u# := 0.6pt#;
side_bearing# := u#;
equal_spread# := 1.93pt#;
line_thickness# := 0.65pt#;
rule_thickness# := 0.58pt#;
arrow_diag_len# := 9u#;
arrow_spread# := 1.6equal_spread#;

define_whole_pixels(equal_spread, arrow_horiz_len, arrow_vert_len,
arrow_diag_len, arrow_spread, line_thickness, rule_thickness, side_bearing);

current_char := -1;
for alpha = 45, 135, 225, 315:
  current_char := current_char + 1;

  beginchar(current_char, arrow_diag_len# + 2side_bearing#, arrow_diag_len#,
    pair centre, head, foot;
    centre := (w/2, (h-d)/2);
    head := centre + (arrow_diag_len - line_thickness)/2 * dir alpha;
    foot := centre - (arrow_diag_len - line_thickness)/2 * dir alpha;

    pickup pensquare scaled line_thickness rotated alpha;
    draw foot -- head;
    draw (foot - arrow_spread * dir (alpha + 90)) --
         (foot + arrow_spread * dir (alpha + 90));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/metapost/attachments/20101129/5effeee5/attachment.html>

More information about the metapost mailing list