2

I tried to use Metafont to output a lowercase letter i, but the result was lamentable. It was almost as if the unit of measurement inside a character definition is different from outside.

Regular.mf

font_size 10pt#;

u#:=20/36pt#;

x_height#:=160/36pt#; caps_height#:=260/36pt#; descender#:=72/36pt#;

% Width of vertical stroke stroke_width:=5/6pt#;

% First optical correction oo#:=.1pt#;

input romanl;

romanl.mf

numeric dot_height;
dot_height#=(x_height#*2/3)+(caps_height#/3)+0.55*stroke_width;
beginchar("i",4u#,dot_height#,0);
    "The letter i";
    pickup pencircle xscaled stroke_width# yscaled 0.9stroke_width#;
    x1=x2=x3=.5w;
    top y1=x_height#+oo#; bot y2=-oo#;
    y3=2/3x_height#+caps_height#/3;
draw z1--z2;
pickup pencircle scaled 1.1stroke_width#;
drawdot z3;

endchar;

The undesiring result: The line is too short and too thin

Bernard
  • 271,350

1 Answers1

1

Just solved my own question. It seems that there are two different coordinates, and the hash symbol should not be used in the definition. Instead, I should use commands like define_pixels to convert properly.