% $Id: xyqc10.mf,v 3.0 1995/07/07 20:14:21 kris Exp $ -*-tex-*-
%
% XYQC10: quarter circles for XY mode at 10 point.
% Copyright (c) 1992 Kristoffer H. Rose <kris@diku.dk>
%
% 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, write to the Free Software Foundation, Inc.,
% 675 Mass Ave, Cambridge, MA 02139, USA.
%
% CONTENTS: Quarter circles in all directions:
%
% -.
% | ) | /\
% o o o o-' o o o .-o o
% ( |_ \/ | (
%
% Code: [-1] 15 31 47 65 79 95 111 127
%
% Each character has a cosinoid bounding box :-) with wd = cos I = sin F,
% where I,F are the angles from direction --> to the initial,final direction.
%
font_identifier "XYQC"; font_size 10pt#;
font_coding_scheme:="XY quarter circles";
mode_setup;
% METANESS...
%
qcd# = 1/2 designsize; % quarter circle diameter
rulew# = .4pt#; % quarter circle line width
define_pixels(qcd,rulew);
%
% beginqc draws the quarter circle starting in the direction towards endpoint
% and turning left...
def beginqc(expr cc,ex,ey) =
alpha := angle (ex,ey);
cw := sqrt(1/2) * abs(sind(alpha + 135));
beginchar(cc,cw*qcd#,0,0);
pickup pencircle scaled rulew rotated (alpha - 90);
if (cc<64): draw quartercircle shifted (-.5,0) rotated (alpha - 90)
scaled qcd
else: draw quartercircle shifted (-.5,0) rotated (alpha - 90) shifted (cw,0)
scaled qcd
fi
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,200) enddef;
% FONT.
%
% Font dimension 8 is the rule thickness (cf. The TeXbook, app.G).
fontdimen 8: rulew#;
%
% Here are the characters...
%
for cc = 0 step 1 until 31:
beginqc(cc,cc-15,-16); endchar;
endfor;
%
for cc = 32 step 1 until 63:
beginqc(cc,16,cc-47); endchar;
endfor;
%
for cc = 64 step 1 until 95:
beginqc(cc,79-cc,16); endchar;
endfor;
%
for cc = 96 step 1 until 127:
beginqc(cc,-16,111-cc); endchar;
endfor;
bye.
%
% $Log: xyqc10.mf,v $
% Revision 3.0 1995/07/07 20:14:21 kris
% Major release w/new User's Guide!
%
% Revision 2.6 1992/06/24 01:23:34 kris
% Implemented and used for hooks.
|