% a dicey font % change this to get a different size size_in_points = 10; mode_setup; autorounding := 0; smoothing := 0; un#=(size_in_points/10) * pt#; define_whole_pixels(un); font_normal_space 3un#; % amount of space to the left and right of a die face % if you change this, also change the 2nd parameter to % beginchar for each character sb = .5 un; % if you want bigger dots, make this bigger DotSize = .7un; def face (expr width, height, rounding) := begingroup; save w, h; numeric w[], h[]; lft w1 = sb = w2 - rounding = w3 - width + rounding = rt w4 - width; bot h1 = 0 = h2 - rounding = h3 - height + rounding = top h4 - height; draw (w1,h2)---(w1, h3)..(w2, h4)---(w3,h4)..(w4,h3)--- (w4,h2)..(w3,h1)---(w2,h1)..cycle; endgroup; enddef; def drawadot (expr xpos, ypos) := fill (xpos, ypos+DotSize){right}..{left}(xpos, ypos-DotSize)..cycle; enddef; beginchar("1",9un#,8un#,0); "One"; pickup pencircle scaled .5 un; % draw the box with a little bit of rounding face(8un, 8un, 10DotSize); % dots drawadot (w/2,h/2); endchar; beginchar("2",9un#,8un#,0); "Two"; pickup pencircle scaled .5 un; % draw the box with a little bit of rounding face(8un, 8un, 10DotSize); % dots drawadot (sb+3h/4,3h/4); drawadot (sb+h/4,h/4); endchar; beginchar("3",9un#,8un#,0); "Three"; pickup pencircle scaled .5 un; % draw the box with a little bit of rounding face(8un, 8un, 10DotSize); % dots drawadot (sb+3h/4,3h/4); drawadot (sb+h/4,h/4); drawadot (w/2,h/2); endchar; beginchar("4",9un#,8un#,0); "Four"; pickup pencircle scaled .5 un; % draw the box with a little bit of rounding face(8un, 8un, 10DotSize); % dots drawadot (sb+3h/4,3h/4); drawadot (sb+h/4,h/4); drawadot (sb+3h/4,h/4); drawadot (sb+h/4,3h/4); endchar; beginchar("5",9un#,8un#,0); "Five"; pickup pencircle scaled .5 un; % draw the box with a little bit of rounding face(8un, 8un, 10DotSize); % dots drawadot (sb+3h/4,3h/4); drawadot (sb+h/4,h/4); drawadot (sb+3h/4,h/4); drawadot (sb+h/4,3h/4); drawadot (w/2,h/2); endchar; beginchar("6",9un#,8un#,0); "Six"; pickup pencircle scaled .5 un; % draw the box with a little bit of rounding face(8un, 8un, 10DotSize); % dots drawadot (sb+3h/4,3h/4); drawadot (sb+h/4,h/4); drawadot (sb+3h/4,h/4); drawadot (sb+h/4,3h/4); drawadot (sb+3h/4,h/2); drawadot (sb+h/4,h/2); endchar; end