summaryrefslogtreecommitdiff
path: root/fonts/utilities/mff-29/mfcommas.mf
blob: 908b1714a21f2fcd5e8b7011b3124c241ab199fe (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
57
58
59
60
61
62
63
64
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Programs to make comma-like characters for mflogo
%  Damian Cugley, SEH <pdc@oxford.prg> Sun 2 Jul 1989
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

def comma(suffix $)(text -+-) =		% -+- should be `+' or `-'
    pickup dot_pen; drawdot(z$); 
    x$a = x$b = x$ -+- 1/2(dot_pen_width - px);	% Right edge
    x$c = x$ -+- 1/2(px - dot_pen_width);	% Left edge
    y$a = y$; 					% Middle of blob
    y$b = y$a -+- -1/2 dot_pen_height;		% bottom of blob
    y$c = y$b -+- -(ygap + o - 1/2 py);		% Bottom of tail bit
    pickup pencircle xscaled px yscaled 0.75 py;
    draw z$a ... z$b ... z$c;  labels($a,$b,$c)
enddef;

def semicolon_like(expr code, desc, updot, downtail) = 
    beginchar(code,6 u# + 2 s#, 
		if updot: xheight# else: dot_pen_height# - 2o# fi,
		if downtail: ygap# else: 0 fi); desc;
	pickup dot_pen; 
	lft x1 = lft x2 = leftstemloc; 
	top y1 = xheight + o; bot y2 = -o;
        if updot: drawdot z1 fi; 
	if downtail: comma(2,+) else: drawdot(z2) fi;
	labels(1,2); 
    endchar;
enddef;

semicolon_like(".","Full stop",false,false);
semicolon_like(",","Comma",false,true);
semicolon_like(":","Colon",true,false);
semicolon_like(";","Semi-colon",true,true);

beginlogochar("'",8); "Quote (')";
    pickup dot_pen;
    top y1 = h + o; lft x1 = leftstemloc - ho;
    comma(1,+); labels(1); 
endchar;

beginlogochar("`",8); "Backquote (`)";
    pickup dot_pen;
    top y1 = h - ygap +o; rt x1 = w - leftstemloc + ho;
    comma(1,-); labels(1); 
endchar;

open_quotes := nextcode;
beginlogochar(open_quotes,12); "Double open-quotes (``)";
    pickup dot_pen;
    rt x1 = rt (x2 + 3.5 u) = w - leftstemloc + ho;
    top y1 = top y2 = h - ygap + o; 
    comma(1,-); comma(2,-); labels(1); 
endchar;

close_quotes := nextcode;
beginlogochar(close_quotes,12); "Double close-quotes ('')";
    pickup dot_pen;
    lft x1 = lft (x2 - 3.5 u) = leftstemloc - ho;
    top y1 = top y2 = h + o; 
    comma(1,+); comma(2,+); labels(1,2); 
endchar;

ligtable "`": "`" =: open_quotes;
ligtable "'": "'" =: close_quotes;