summaryrefslogtreecommitdiff
path: root/fonts/punk/source/punk.mf
blob: 99ea8af65358bee41e761d515eeede71c46c7336 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
% Font inspired by Gerard and Marjan Unger's lectures, Feb 1985
mode_setup;

randomseed:=seed;

define_pixels(u,dev);
define_blacker_pixels(px,py,dot);
define_whole_pixels(s);
xoffset:=s;
pickup pencircle xscaled px yscaled py; punk_pen:=savepen;
pickup pencircle scaled dot; def_pen_path_;
path dot_pen_path; dot_pen_path:=currentpen_path;
currenttransform:=identity slanted slant yscaled aspect_ratio;

def beginpunkchar(expr c,n,h,v) = % code $c$; width is $n$ units
  hdev:=h*dev; vdev:=v*dev;% modify horizontal and vertical amounts of deviation
  beginchar(c,n*u#,ht#,0); italcorr ht#*slant; pickup punk_pen enddef;
extra_endchar:=extra_endchar&"w:=w+2s;charwd:=charwd+2s#";

def ^ = transformed currenttransform enddef;
def makebox(text rule) =
 for y=0,h:
  rule((-s,y)^,(w-s,y)^); endfor % horizontals
 for x=-s,0,w-2s,w-s:   rule((x,0)^,(x,h)^); endfor % verticals
 enddef;
rulepen:=pensquare;

vardef pp expr z = z+(hdev*normaldeviate,vdev*normaldeviate) enddef;

def pd expr z = addto_currentpicture contour
  dot_pen_path shifted z.t_ withpen penspeck enddef; % {\bf drawdot}

input punkl % uppercase letters
input punkae % uppercase \AE, \OE, \O
input punkg % uppercase greek
input punkp % punctuation
input punkd % digits
input punka % accents

ht#:=.6ht#; dev:=.7dev;
input punksl % special lowercase
extra_beginchar:=extra_beginchar&"charcode:=charcode+32;";
input punkl % lowercase letters
extra_beginchar:=extra_beginchar&"charcode:=charcode-35;";
input punkae % lowercase \ae, \oe, \o

font_slant:=slant;
font_quad:=18u#+2s#;
font_normal_space:=9u#+2s#;
font_normal_stretch:=6u#;
font_normal_shrink:=4u#;
font_x_height:=ht#;
font_coding_scheme:="TeX text without f-ligatures";


bye