summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/xypic/xycirc10.mf
blob: 8d23e2e9d384ee20aeacd73339640a329fdf22b2 (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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
% $Id: xycirc10.mf,v 3.13 2011/03/14 20:14:00 krisrose Exp $
%
% XYCIRC10: 1/8 circles with varying radii for Xy-pic at 10 point.
% Copyright (c) 1992,2011  Kristoffer H. Rose  <krisrose@tug.org>
%                    2011  Daniel Müllner <http://www.math.uni-bonn.de/people/muellner>
%
% 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]
% _________________________________________________________________________
%
font_identifier "XYCIRC"; font_size 10pt#;
mode_setup;

% METANESS...
%
rulew# = .4pt#; define_whole_blacker_pixels(rulew); % line thickness

% 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

% (It's unnecessary to give the exact control points. MetaFont
% automatically chooses a good approximation to a circular arc.)
path eighthcircle;
eighthcircle = right{up} .. {left+up}(right+up)/sqrt2;

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

 major# := radius/sqrt2;
 minor# := radius - major#;
 full#  := radius;
 define_pixels(minor,major,full);

 path arc;
 arc = eighthcircle scaled (full + rulew/2) 
    & halfcircle scaled rulew shifted (full*right) rotated 45 
    & reverse eighthcircle scaled (full - rulew/2)
    & halfcircle scaled rulew rotated 180 shifted (full*right)
    & cycle;

 beginchar(8g  ,minor#,full#,full#);
  fill arc rotated 180 shifted (full*right);
  endchar;

 beginchar(8g+1,major#,full#,full#);
  fill arc rotated 225 shifted (major*right);
  endchar;

 beginchar(8g+2,major#,full#,full#);
  fill arc rotated 270;
  endchar;

 beginchar(8g+3,minor#,full#,full#);
  fill arc rotated 315 shifted (major*left);
  endchar;

 beginchar(8g+4,minor#,full#,full#);
  fill arc shifted (major*left);
  endchar;

 beginchar(8g+5,major#,full#,full#);
  fill arc rotated 45;
  endchar;

 beginchar(8g+6,major#,full#,full#);
  fill arc rotated 90 shifted (major*right);
  endchar;

 beginchar(8g+7,minor#,full#,full#);
  fill arc rotated 135 shifted (full*right);
  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.13  2011/03/14 20:14:00  krisrose
% Preparing for release 3.8.6.
%
% Revision 3.12  2010/07/07 16:26:39  krisrose
% Rules should be whole pixels (thanks again to Daniel).
%
% Revision 3.11  2010/07/06 21:49:55  krisrose
% Daniel's fix that works around bug in mf2pt1/fontforge script.
%
% 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]