| 1 |
%%% shade/shade.mf |
| 2 |
%%% shade font for use with shade.tex/sty |
| 3 |
%%% see README for licensing and contact information. |
| 4 |
|
| 5 |
mode_setup; |
| 6 |
magnification=1000; |
| 7 |
font_identifier "Shade"; |
| 8 |
font_coding_scheme "Shade Style Matrix"; |
| 9 |
font_size 10pt#; |
| 10 |
|
| 11 |
%%% a = side of smallest shaded square (3x3 pixels) |
| 12 |
a#:=(3/pixels_per_inch)*1in#; |
| 13 |
define_pixels(a); |
| 14 |
%%% greybox produces a shaded rectangle: |
| 15 |
%%% height 2^H*a |
| 16 |
%%% width 2^W*a |
| 17 |
%%% ... |
| 18 |
%%% it consists of WxH `unit squares': .*. |
| 19 |
%%% ... |
| 20 |
%%% its character code is 10*W + H |
| 21 |
%%% i.e., the first digit corresponds to the width and |
| 22 |
%%% the second digit corresponds to the height of the character |
| 23 |
|
| 24 |
def greybox (expr H, W) = |
| 25 |
HH:=2**H; WW:=2**W; |
| 26 |
beginchar(10*W+H, WW*a#, HH*a#, 0); |
| 27 |
pickup pencircle scaled 1; |
| 28 |
fill (1,1)--(1,3*HH)--(3*WW,3*HH)--(3*WW,1)--cycle; |
| 29 |
pickup pencircle scaled 2; |
| 30 |
for x = 0 step 3 until 3*HH : undraw (0,x)--(3*WW,x); endfor; |
| 31 |
for x = 0 step 3 until 3*WW : undraw (x,0)--(x,3*HH); endfor; |
| 32 |
endchar; |
| 33 |
enddef; |
| 34 |
|
| 35 |
%%% produce characters for H and W from 0 to 5 |
| 36 |
|
| 37 |
for ww = 0 upto 5 : |
| 38 |
for hh = 0 upto 5 : greybox (hh,ww); endfor; |
| 39 |
endfor; |
| 40 |
|
| 41 |
bye; |