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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
% dkpunct.mf - punctuation for Ditko
% Copyright (C) 1990 Damian Cugley
% - pdc Sun. 30 Sept. 1990
if testing: endinput fi
% - pdc Sun. 30 Sept. 1990
def straight_line(expr code, wd_u) =
beginchar(code, wd_u, 1/2penh# + 1/2cap_ht#, 0v#, 1/3, 1/3);
pickup square_pen;
top lft z1 = (l, h); top rt z2 = (r, h);
draw z1--z2;
labels(1,2);
endchar;
enddef;
"hyphen"; straight_line("-", 6);
ifcode short_dash: "short dash";
straight_line(code.short_dash, 12);
fi
ifcode long_dash: "long dash";
straight_line(code.long_dash, 18);
fi
%% Comma-like objects:
vardef draw_comma@# =
fill top lft z@# -- bot lft z@# + dip_dp*down
-- bot rt z@# -- top rt z@# -- cycle;
enddef;
vardef draw_inverted_comma@# =
fill top lft z@# -- bot lft z@#
-- bot rt z@# -- top rt z@# + dip_dp*up -- cycle;
enddef;
def quotation_marks(expr code, double_b, left_b) =
stdchar(code, if double_b: 1 + 2penw#/u# else: penw#/u# fi, 1, 1);
pickup square_pen;
top lft z1 = (l, h if left_b: - dip_dp fi);
if left_b: draw_inverted_comma1; else: draw_comma1; fi
if double_b:
top rt z2 = (r, h if left_b: - dip_dp fi);
if left_b: draw_inverted_comma2; else: draw_comma2; fi
fi
labels(1 if double_b: , 2 fi);
endchar;
enddef;
"apostrophe"; quotation_marks("'", false, false);
"inverted comma"; quotation_marks("`", false, true);
ifcode left_quote: "left double quote";
quotation_marks(code.left_quote, true, true);
fi
ifcode right_quote: "right double quote";
quotation_marks(code.right_quote, true, false);
fi
ifcode german_quote: "german left quotation mark";
beginchar(code.german_quote, 1 + 2penw#/u#, penh#, 0v#, 1, 1);
pickup square_pen;
top lft z1 = (l, h); draw_comma1;
top rt z2 = (r, h); draw_comma2;
labels(1, 2);
endchar;
fi
def semicolon(expr code, dot_b, comma_b) =
beginchar(code, penw#/u#, if dot_b: cap_ht# else: penh# fi,
if comma_b: dip_dp# else: 0v# fi, 1, 1);
pickup square_pen;
if dot_b:
top lft z1 = (l, h); drawdot z1; labels(1);
fi
bot lft z2 = (l, baseline);
if comma_b: draw_comma2; else: drawdot z2; fi
labels(2);
endchar
enddef;
"full stop"; semicolon(".", false, false);
"comma"; semicolon(",", false, true);
"colon"; semicolon(":", true, false);
"semicolon"; semicolon(";", true, true);
|