summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/xypic/xycirc10.mf
blob: 9ff773dc8ceddb5ba91e72cae56507a39970df6a (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
% $Id: xycirc10.mf,v 3.10 2010/06/10 18:45:50 krisrose Exp $
%
% XYCIRC10: 1/8 circles with varying radii for Xy-pic at 10 point.
% Copyright (c) 1992,1993  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/.
%
% As a special exception, you may use this file and all files derived
% from it without restriction.  This special exception was added with
% version 3.7 of Xy-pic.
% _________________________________________________________________________
%
% CONTENTS: 1/8 circles with radii from 1 to 32pt dissected into the 1/8
% circle segments shown below
%				    6     5
%                                   .......	    _
%                              7  ..   |   ..  4    |
%                                : |   |   | :	    | radius
%                               :  |   |   |  :	    |
%       Reference point ---> ___:__|___|___|__:_____|
%                               :  |   |   |  :
%                                : |   |   | :
%                              0  .!   |   !.  3
%                                   ...|...
%				    1     2
%
% such that each group of 8 characters cc+0 to cc+7 constitute a full circle
% with the given radius when typeset on the same baseline (as shown).
%
% The bounding box of each segment is the vertical slice of the unit square
% around the circle.
%
% The radius is given for each character group g = cc mod 8 by the formula
%
%  radius [pt] = g+1,		if  0 <= g < 8
%	       	 2(g-8) + 10,	if  8 <= g < 12		[= 2g-6]
%	    	 4(g-12) + 20,	if 12 <= g < 16		[= 4g-28]
%
% The bounding box of each segment is the smallest box enclosing it (not
% including the rule width) with reference point on the horizontal line
% through the center of the circle---so segment 1256 have either height or
% depth negative.
% _________________________________________________________________________
%
font_identifier "XYCIRC"; font_size 10pt#;
mode_setup;

% METANESS...
%
rulew# = .4pt#; define_whole_blacker_pixels(rulew); % line thickness
%
pickup pencircle scaled rulew; char_pen := savepen;

% TESTING...we redefine openit because the characters extend far to the
% left of the bounding box!
%
def openit = %let echar = endchar; def endchar = echar; stop ". " enddef;
 openwindow currentwindow from origin to (1000,800) at (-200,300)
enddef;

% FONT.
%
% Font dimension 8 is the rule thickness (cf. The TeXbook, app.G)
%
font_coding_scheme:="xycirc.enc";
fontdimen 8:	rulew#;			% default_rule_thickness

% Use the following macro that generates an entire group from character cc
% to cc+7 with radius:
%
def makeg(expr g,radius) =

 minor# := (1 - sqrt 1/2) * radius;
 major# := radius - minor#;
 full#  := radius;
 define_pixels(minor,major,full);

 beginchar(8g  ,minor#,full#,full#); pickup char_pen;
  z0=(0,0); z1=(minor,-major); draw z0{0,-1}..{1,-1}z1;
  penlabels(0,1); endchar;

 beginchar(8g+1,major#,full#,full#); pickup char_pen;
  z0=(0,-major); z1=(major,-full ); draw z0{1,-1}..{1,0}z1;
  penlabels(0,1); endchar;

 beginchar(8g+2,major#,full#,full#); pickup char_pen;
  z0=(0,-full); z1=(major,-major); draw z0{1,0}..{1, 1}z1;
  penlabels(0,1); endchar;

 beginchar(8g+3,minor#,full#,full#); pickup char_pen;
  z0=(0,-major); z1=(minor,0); draw z0{1, 1}..{0, 1}z1;
  penlabels(0,1); endchar;

 beginchar(8g+4,minor#,full#,full#); pickup char_pen;
  z0=(0, major); z1=(minor,0); draw z0{1,-1}..{0,-1}z1;
  penlabels(0,1); endchar;

 beginchar(8g+5,major#,full#,full#); pickup char_pen;
  z0=(0, full); z1=(major, major); draw z0{1,0}..{1,-1}z1;
  penlabels(0,1); endchar;

 beginchar(8g+6,major#,full#,full#); pickup char_pen;
  z0=(0, major); z1=(major, full); draw z0{1, 1}..{1,0}z1;
  penlabels(0,1); endchar;

 beginchar(8g+7,minor#,full#,full#); pickup char_pen;
  z0=(0,0); z1=(minor, major); draw z0{0, 1}..{1, 1}z1;
  penlabels(0,1); endchar

enddef;

% Make groups:
%
for g =  0 step 1 until  7: makeg(g,  (g+1)*pt#); endfor;
for g =  8 step 1 until 11: makeg(g, (2g-6)*pt#); endfor;
for g = 12 step 1 until 15: makeg(g,(4g-28)*pt#); endfor;

bye.

% $Log: xycirc10.mf,v $
% Revision 3.10  2010/06/10 18:45:50  krisrose
% Reference to GPL by URL.
%
% Revision 3.9  2010/05/17 23:29:21  krisrose
% Experiment: generate all the Type1 fonts with METAPOST.
%
% Revision 3.8  2010/04/16 06:06:52  krisrose
% Preparing for a new release...
%
% Revision 3.7  1999/02/16 15:12:50  krisrose
% Interim release (Y&Y fonts now free).
%
% 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.13  1995/07/04  15:11:17  kris
% Ready to release v3?
%
% Revision 2.7  1994/03/08  02:09:27  kris
% Release 3alpha.
%
% Revision 2.6.9.1  1994/03/07  04:22:46  kris
% Last internal 3alpha and pre-2.7 release.
%
% NEW file to go in version 2.7!
% Based on xymisc10.mf [Revision 2.6  1992/06/24  01:23:34  kris]