Debian Codegraph @

texmf-dist/fonts/source/public/xypic/xyqc10.mf

raw
1 % $Id: xyqc10.mf,v 3.1 2010/06/10 18:45:50 krisrose Exp $ -*-tex-*-
2 %
3 % XYQC10: quarter circles for XY mode at 10 point.
4 % Copyright (c) 1992 Kristoffer H. Rose <[email protected]>
5 %
6 % This file is part of the XY-pic macro package.
7 %
8 % The XY-pic macro package is free software; you can redistribute it and/or
9 % modify it under the terms of the GNU General Public License as published by
10 % the Free Software Foundation; either version 2 of the License, or (at your
11 % option) any later version.
12 %
13 % The XY-pic macro package is distributed in the hope that it will be
14 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16 % Public License for more details.
17 %
18 % You should have received a copy of the GNU General Public License along
19 % with this macro package; if not, see http://www.gnu.org/licenses/.
20 %
21 % CONTENTS: Quarter circles in all directions:
22 %
23 % -.
24 % | ) | /\
25 % o o o o-' o o o .-o o
26 % ( |_ \/ | (
27 %
28 % Code: [-1] 15 31 47 65 79 95 111 127
29 %
30 % Each character has a cosinoid bounding box :-) with wd = cos I = sin F,
31 % where I,F are the angles from direction --> to the initial,final direction.
32 %
33 font_identifier "XYQC"; font_size 10pt#;
34 font_coding_scheme:="XY quarter circles";
35 mode_setup;
36
37 % METANESS...
38 %
39 qcd# = 1/2 designsize; % quarter circle diameter
40 rulew# = .4pt#; % quarter circle line width
41 define_pixels(qcd,rulew);
42 %
43 % beginqc draws the quarter circle starting in the direction towards endpoint
44 % and turning left...
45 def beginqc(expr cc,ex,ey) =
46 alpha := angle (ex,ey);
47 cw := sqrt(1/2) * abs(sind(alpha + 135));
48 beginchar(cc,cw*qcd#,0,0);
49 pickup pencircle scaled rulew rotated (alpha - 90);
50 if (cc<64): draw quartercircle shifted (-.5,0) rotated (alpha - 90)
51 scaled qcd
52 else: draw quartercircle shifted (-.5,0) rotated (alpha - 90) shifted (cw,0)
53 scaled qcd
54 fi
55 enddef;
56
57 % TESTING...we redefine openit because the characters extend far to the
58 % left of the bounding box!
59 %
60 def openit = openwindow currentwindow
61 from origin to (screen_cols,screen_rows) at (-200,200) enddef;
62
63 % FONT.
64 %
65 % Font dimension 8 is the rule thickness (cf. The TeXbook, app.G).
66 fontdimen 8: rulew#;
67 %
68 % Here are the characters...
69 %
70 for cc = 0 step 1 until 31:
71 beginqc(cc,cc-15,-16); endchar;
72 endfor;
73 %
74 for cc = 32 step 1 until 63:
75 beginqc(cc,16,cc-47); endchar;
76 endfor;
77 %
78 for cc = 64 step 1 until 95:
79 beginqc(cc,79-cc,16); endchar;
80 endfor;
81 %
82 for cc = 96 step 1 until 127:
83 beginqc(cc,-16,111-cc); endchar;
84 endfor;
85
86 bye.
87 %
88 % $Log: xyqc10.mf,v $
89 % Revision 3.1 2010/06/10 18:45:50 krisrose
90 % Reference to GPL by URL.
91 %
92 % Revision 3.0 1995/07/07 20:14:21 kris
93 % Major release w/new User's Guide!
94 %
95 % Revision 2.6 1992/06/24 01:23:34 kris
96 % Implemented and used for hooks.