summaryrefslogtreecommitdiff
path: root/macros/generic/diagrams/xypic/mfinputs/xyline10.mf
blob: 41aad6e043452792fe5e5cdff8e82211e24df1a9 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
% $Id: xyline10.mf,v 3.5 2010/06/10 18:45:50 krisrose Exp $ -*-tex-*-
%
% XYLINE10: line segments for XY mode at 10 point.
% Copyright (c) 1991,1992  Kristoffer H. Rose  <krisrose@tug.org>
%
% This file is part of the XY-pic macro package.
%
% The XY-pic macro package is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or (at your
% option) any later version.
%
% The XY-pic macro package is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
% Public License for more details.
%
% You should have received a copy of the GNU General Public License along
% with this macro package; if not, see http://www.gnu.org/licenses/.
%
% CONTENTS: Line segments going either segl# down or to the right.  Codes
% range from 0 to 127, distributed evenly in each of the
% intervals between the `purely' horizontal/
% vertical/diagonal characters with code 31,	    ..../
% 63, 95, and 127 (code -1 would be  pure as	    :  /:
% well if it existed):				    : /	:
%                                                   :/	:
%      	..../  ..../   |   o   o....  o....  o----  o...:
%       :  /:  :  /:   |   |   :\  :  :\  :
%       : / :  : / :   |   |   : \ :  : \ :
%       :/  :  :/  :   |   |   :  \:  :  \:
%       o...:  o...:   o   |   :...\  :...\
%
% Code: [-1]     0    30  31     63     64     95     127
%
font_identifier "XYLINE"; font_size 10pt#;
font_coding_scheme:="XY line segments";
mode_setup;

% METANESS...
%
segl# = 1/2 designsize; define_pixels(segl);	% line segment length
rulew# = .4pt#; define_whole_blacker_pixels(rulew); % line thickness
%
% drawsegment draws a line from (0,0) to the argument point...
def drawsegment expr endpoint =
 z0 = (0,0); z1 = endpoint;
 pickup pencircle scaled rulew rotated (angle (z1-z0) - 90);
 draw z0--z1; penlabels(0,1) enddef;

% TESTING...we redefine openit because the characters extend far to the
% left of the bounding box!
%
def openit = openwindow currentwindow
 from origin to (screen_cols,screen_rows) at (-200,300) enddef;

% FONT.
%
% Font dimension 8 is the rule thickness (cf. The TeXbook, app.G)
fontdimen 8: rulew#;
%
% The characters follow...
%
for cc = 0 step 1 until 30:
 beginchar(cc,(31-cc)/32*segl#,segl#,0); drawsegment (w,h); endchar;
endfor;
%
for cc = 31 step 1 until 63:
 beginchar(cc,(cc-31)/32*segl#,0,segl#); drawsegment (w,-d); endchar;
endfor;
%
for cc = 64 step 1 until 94:
 beginchar(cc,segl#,0,(95-cc)/32*segl#); drawsegment (w,-d); endchar;
endfor;
%
for cc = 95 step 1 until 126:
 beginchar(cc,segl#,(cc-95)/32*segl#,0); drawsegment (w,h); endchar;
endfor;
%
beginchar(127,segl#,segl#,0); drawsegment (w,h); endchar;

bye.
%
% $Log: xyline10.mf,v $
% Revision 3.5  2010/06/10 18:45:50  krisrose
% Reference to GPL by URL.
%
% Revision 3.4  2010/04/16 06:06:52  krisrose
% Preparing for a new release...
%
% Revision 3.3  1996/12/19 03:31:56  krisrose
% Maintenance release
%
% Revision 3.0  1995/07/07 20:14:21  kris
% Major release w/new User's Guide!
%
% Revision 2.1  1992/01/02  14:54:07  kris
% Release version.
%
% Revision 1.7  1991/12/17  04:51:16  kris
% Version distributed with `final draft' on Usenet.
%
% Revision 1.6  1991/11/27  06:54:21  kris
% \beta-test on DIKU.
%
% Revision 1.5  1991/10/21  23:19:08  kris
% Version described in DIKU student report 91-7-10.
%
% Revision 1.4  1991/07/28  22:16:18  kris
% Inverted char0..30 to avoid negative widths.
%
% Revision 1.3  1991/07/26  01:22:28  kris
% Set bounding box completely!
%
% Revision 1.2  91/06/09  21:59:49  kris
% separated METANESS and CHARACTERS
%
% Revision 1.1  91/06/06  22:52:31  kris
% furst succesful attempt