Oxford branding logos and images

This commit is contained in:
Dimitri Lozeve 2018-07-26 11:09:03 +01:00
parent 48a6b0e75f
commit 057df1abea
78 changed files with 1937 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,962 @@
% The "belted" crest of Oxford University.
% MF source by Ian Collier, June 1997,
% (C) Oxford University Computing Laboratory.
%
% The design drawn by this program is a trade mark of the University of
% Oxford. It may only be used for official University business, and
% then only for non-commercial purposes. More information is available
% from ftp://micros.oucs.ox.ac.uk/graphics/crests/readme.1st or from Mrs
% Patricia Whitehead, University Purchasing Officer.
% If this is invoked in proof mode then reduce the resolution as
% 36 pixels per pt is rather too large for this design. Make sure
% a large enough window is opened on the display.
mode_def myproof = proof_; mode_param (pixels_per_inch, 600); enddef;
if unknown mode: mode=myproof; fi
def openit = openwindow currentwindow
from origin to (1152,1152) at (-50,800) enddef;
% size# defines the diameter of the whole symbol. It probably doesn't
% help to change this.
size# = 95pt#;
if unknown cmbase: input cmbase fi
font_identifier "crest"; font_size size#;
font_coding_scheme "Char0";
fontdimen 1: 0,0,0,0,0,0,0;
def font_identifier text t = enddef;
def font_size text t = enddef;
def font_coding_scheme text t = enddef;
% input the definitions of letters
scantokens ("input " & jobname & "letters");
% The larger letters will be based on cmr9.
def generate primary p = enddef;
input cmr9;
mode_setup; font_setup; def t_ = transformed currenttransform enddef;
% Things satisfying the vague description "parameters" follow.
% Most numbers described as "position" are angles of elevation
% relative to the centre of the crest. It seems to be more
% convenient to work in polar co-ordinates.
% Names ending with f1, f2, etc describe parameters which didn't seem to
% deserve more descriptive names.
thick# = 1.2pt#; % pen width for outer circle and belt
thin# = 0.33pt#; % pen width for inner circle and most details
outer_diam# = size#-thick# % diameter of outer circle
= 2outer_rad#; % radius of outer circle
circle_gap# = 1.4pt#; % circle-circle and circle-letter gap
belt_left_angle = 236; % position of edge of buckle
belt_over_angle = -49; % position 1 where belt crosses itself
belt_under_angle = -67; % position 2 where belt crosses itself
buckle_vert = -7; % angle of vertical bit of buckle
buckle_diam# = 3.5pt#; % diameter of round ends
buckle_width# = 3.5pt#; % width of buckle at wide end
pin_length# = 8pt#; % length of pin
pin_width# = 2.4pt#; % width of pin
fleur_depth# = 12pt#; % depth of tip of fleur
fleur_width# = 15pt#; % width of fleur
fleur_narrow# = 7pt#; % width of fleur at narrow point
bell_length# = 16pt#; % length of bell-shaped part
wavy_length# = 4.1pt#; % length of black wavy bit
wavy_width# = 2.0pt#; % initial width of wavy bit
wavy_dir = 4; % initial direction of wavy bit
belt_gap1# = 0.9pt#; % gap for horizontal belt
belt_gap2# = 0.6pt#; % gap for vertical belt
beltf1 = -62; % horizontal belt/ra2 cross position
beltf2 = 5; % horizontal belt/ra2 cross angle
beltf3 = -65; % horizontal belt 1-2 cross position
beltf4 = -59; % horizontal belt 2-3 cross position
beltf5 = 5; % angular width of vertical belt curl
beltf6 = -87; % position of top left of vertical belt
beltf7 = -93; % position of bottom left of v.b.
beltf8 = -80; % position of bottom right of v.b.
beltf9 = -83; % position of top right of lower v.b.
beltf10 = -96; % position of top left of lower v.b.
beltf11# = 17pt#; % width of lower v.b. at widest point
beltf12# = 55pt#; % depth of lower v.b. end
dot_angle1 = -89; % position of first dot
dot_angle2 = -79; % position of second dot
fleurf1# = 2.9pt#; % x-coord of inner point
fleurf2# = 4pt#; % y-coord of inner point rel to tip
fleurf3 = 10; % first direction
fleurf4 = 65; % second direction
fleurf5 = 105; % third direction
fleurf6 = -15; % fourth direction
fleurf7 = 80; % fifth direction
fleurf8 = 50; % sixth direction
fleurf9# = 9.8pt#; % height of points rel to tip
fleurf10# = 10pt#; % height of narrowest point rel to tip
book_width# = 38pt#; % overall width of book
book_height# = 22pt#; % overall height of book
book_inset# = 4.0pt#; % distance between cover and top page
book_thick# = 0.6pt#; % thickness of line for book outline
book_pos = 0.38; % how much of book is above centre line
book_wave# = 0.4pt#; % page deformation
seal_offset# = 4.0pt#; % horizontal length of seals
seal_width# = 1.8pt#; % width of seals
seal_diam# = 3.0pt#; % diameter of seals
crown_width_b# = 14.2pt#; % width of crown bottom
crown_width_t# = 20.2pt#; % width of crown between points
crown_height# = 13.4pt#; % total height of crown
crown_band# = 3.0pt#; % width of band at bottom of crown
crown_mag = 1.15; % difference in size of bottom crown
crown_gap# = 0.6pt#; % gap in crown band
crown_pos = 43; % angular position of top crowns
crown_pos3# = 2.3pt#; % height of bottom crown
crownf1# = 1.4pt#; % curve of crown bottom
crownf2# = 1.1pt#; % curve of crown band
crownf3 = 80; % angle of points
crownf4# = 1.0pt#; % protrusion of points
% At various places in the source there are arbitrary numbers determined
% by trial and error. Any number which is used in two or more places is
% defined here.
ff1 = 0.55; % fudge factor 1 (buckle)
ff2 = -3; % fudge factor 2 (bell shape)
ff3 = 0.7; % fudge factor 3 (belt)
ff4 = 0.84; % fudge factor 4 (crown band)
ff5 = 0.78; % fudge factor 5 (crown)
ff6 = 5; % fudge factor 6 (crown)
ff7 = 0.56; % fudge factor 7 (crown)
ff8 = 0.35; % fudge factor 8 (crown)
ff9 = 1.6; % fudge factor 9 (shape within vertical belt)
% Conversion from degrees to radians and vice versa
twopi=6.28318531;
vardef rad primary d = save r; 360r=twopi*d; r enddef;
vardef deg primary r = save d; 360r=twopi*d; d enddef;
% It beats me why this useful definition was left out of plain.mf. :-)
vardef good.xy primary p = (good.x xpart(p),good.y ypart(p)) enddef;
% For positions which are expressed as angles, it is useful to know
% at what point a path reaches that angle. The time will be
% angletime(path,dir) and the position will therefore be
% point angletime(path,dir) of path.
vardef radius primary d = (origin--2outer_rad*dir d) enddef;
vardef angletime (expr p,d) = xpart (p intersectiontimes radius d) enddef;
% Helper function for inner_path
def offset(expr l) expr n of p = (unitvector direction n of p zscaled (0,l))
enddef;
% The following function takes a path p and a distance l and returns a
% (approximate) parallel path at distance l from p. If p goes
% anti-clockwise and l is positive, the new path will be inside p.
% The new path will be given f points for every point on the old path.
% This doesn't work for paths which are cycles, but some cycles can
% be hacked (see the shapes inside the lower belt).
def inner_path (expr p,l,f) =
begingroup save a,b,t,d,q;
(point 0 of p shifted offset(l) epsilon of p){direction epsilon of p}
for n=1 upto f*length p-1:
..
hide (
pair d[];
d2 = unitvector (direction (n/f-epsilon) of p);
d3 = unitvector (direction (n/f+epsilon) of p);
d5 = point n/f of p;
)
if abs ((d2 rotated 90) dotprod d3) < eps:
(d5 shifted offset(l) n/f of p){direction n/f of p}
elseif (d2 zscaled (0,l)) dotprod d3 < 0:
% An external point is being made.
hide (
d6 = d5 + d2 zscaled (0,l) + whatever*d2;
d6 = d5 + d3 zscaled (0,l) + whatever*d3;
)
d5 shifted (d2 zscaled (0,l)) .. {curl1}d6{curl1} ..
d5 shifted (d3 zscaled (0,l))
else:
% An internal point is being made
hide (
numeric t[]; path q[];
d1 = unitvector (direction (n-1)/f+epsilon of p);
d4 = unitvector (direction (n+1)/f-epsilon of p);
q1 = point (n-1)/f of p shifted (d1 zscaled (0,l)){d1}
..{d2}point n/f of p shifted (d2 zscaled (0,l));
q2 = point n/f of p shifted (d3 zscaled (0,l)){d3}
..{d4}point (n+1)/f of p shifted (d4 zscaled (0,l));
(t1,t2) = q1 intersectiontimes q2;
d0 = 1/2[point t1 of q1, point t2 of q2];
)
{direction t1 of q1}d0{direction t2 of q2}
fi
endfor
..{direction (length p-epsilon) of p}
(point (length p) of p shifted offset(l) (length p-epsilon) of p)
endgroup
enddef;
% It seems convenient for most of these to be in whole pixels,
% but parameters for the crown are going to be magnified by
% crown_mag anyway so they might as well be exact numbers.
define_whole_pixels(circle_gap,outer_rad);
define_whole_pixels(buckle_diam,buckle_width,pin_length,bell_length,pin_width);
define_whole_pixels(wavy_length);
define_whole_blacker_pixels(wavy_width);
define_whole_pixels(belt_gap1,belt_gap2,beltf11,beltf12);
define_whole_pixels(fleur_depth,fleur_width,fleur_narrow);
define_whole_pixels(fleurf1,fleurf2,fleurf9,fleurf10);
define_whole_blacker_pixels(thick,thin);
define_whole_pixels(book_width,book_height,book_inset,book_wave);
define_whole_blacker_pixels(book_thick);
define_whole_pixels(seal_offset,seal_width,seal_diam);
define_pixels(crown_width_b,crown_width_t,crown_height,crown_band);
define_pixels(crownf1,crownf2,crown_pos3);
define_pixels(crownf4);
define_pixels(crown_gap);
pair centre; % centre of whole figure
centre=(hround(0.5size#*hppp),vround(0.5size#*hppp));
% The radii of the four outer circles (ra1-4), plus the baseline
% and centreline (ra5) for the outer lettering.
ra1 = outer_rad-eps;
ra2 = ra1-0.5[thin,thick]-circle_gap;
baseline = ra2-0.5thin-circle_gap-cap_height;
ra3 = baseline-circle_gap-0.5thin;
ra4 = ra3-0.5[thin,thick]-circle_gap;
ra5 = baseline+0.5cap_height;
% Save some pens for later
pickup pencircle scaled book_thick;
book.nib := savepen;
pickup pencircle scaled thick;
thick.nib := savepen;
pickup pencircle scaled thin;
thin.nib := savepen;
"The belted crest";
beginchar(0,size#,size#,fleur_depth#+beltf12#-1/2size#);
adjust_fit(0pt#,0pt#);
% All co-ordinates are relative to the centre
currenttransform := identity shifted centre
if known currenttransform: transformed currenttransform fi;
% The belt and associated devices are calculated first. They depend
% on things being drawn in the right order so that they overlap nicely.
message "(buckle,";
% Pin
pair d.pin[];
z.ptip1 = good.xy(ra5*dir belt_left_angle);
z.ptip2 = good.xy(ra5*dir (belt_left_angle+deg(pin_length/ra5)));
d.pin1 = 1/2pin_width*unitvector (z.ptip2-z.ptip1);
z.pcen1-z.ptip1 = d.pin1;
z.pcen2-z.ptip2 = -d.pin1;
d.pin2 = d.pin1 rotated 90;
z.pin1 = good.xy(z.pcen1+d.pin2);
z.pin2 = good.xy(z.pcen1-d.pin2);
z.pin3 = good.xy(z.pcen2-d.pin2);
z.pin4 = good.xy(z.pcen2+d.pin2);
labels(ptip1,ptip2,pin1,pin2,pin3,pin4);
% Arms of buckle
z.bcen0 = good.xy(0.38[z.pcen1,z.pcen2]);
pair d.b[];
d.b1 = dir (buckle_vert-90);
d.b2 = dir (2angle d.pin1 - (buckle_vert-90) + 3);
d.b3 = 1/2buckle_width*unitvector d.pin1;
buckle_length = (ra1-ra5)/(d.b1 dotprod -unitvector d.pin2);
path p.b[][];
z.bcen1 = good.xy(z.bcen0+buckle_length*d.b1);
z.bcen2 = good.xy(z.bcen0+(buckle_length-1/2thick)*d.b2);
for i=1,2:
p.b[i]1 = good.xy (z.bcen0-d.b3)--good.xy(z.bcen[i]-ff1*d.b3);
p.b[i]2 = good.xy (z.bcen0+d.b3)--good.xy(z.bcen[i]+ff1*d.b3);
p.b[i]3 = fullcircle scaled (buckle_diam-eps) shifted z.bcen[i];
t.b1[i] = xpart (p.b[i]3 intersectiontimes p.b[i]1);
t.b2[i] = xpart (p.b[i]3 intersectiontimes p.b[i]2);
endfor
labels(bcen0,bcen1,bcen2);
% Bell-shaped part
z.bel1 = z.bcen1-1/2thick*d.b1;
z.bel2 = z.bcen2-1/2thick*d.b2;
bell_angle = belt_left_angle + deg(bell_length/ra5);
z.bel3 = (ra1+0.6*buckle_diam)*dir (bell_angle+ff2);
z.bel4 = (ra4-0.4buckle_diam)*dir bell_angle;
path p.bel;
p.bel = z.bel1{z.bel1 rotated 90}..z.bel3--z.bel4..{z.bel2 rotated -90}z.bel2;
t1.bel = xpart (p.bel intersectiontimes p.b1 3);
t2.bel = xpart (p.bel intersectiontimes p.b2 3);
labels(bel1,bel2,bel3,bel4);
message " belt,";
% Horizontal belt - 4 paths, of which number 1 is the lowest.
pair d.hb[];
rb1 = ra2;
rb2 = rb1 - 1/2[thin,thick]-belt_gap1;
rb4 = ra3;
rb3 = rb4 + 1/2[thin,thick]+belt_gap1;
d.hb0 = dir (bell_angle+ff2);
for i=1 upto 4: z.hb[i]1 = rb[i]*d.hb0; endfor
d.hb1 = (z.bel2-z.bel1) rotated -90;
z.hb4 2 = ra1*dir belt_over_angle;
z.hb3 2 = z.hb4 2;
path p.hb[];
p.hb4 = z.hb4 1{d.hb1}..tension 1.5 and 1..(ra2*dir beltf1){dir beltf2}..{curl 1.5}z.hb4 2;
p.hb3 = subpath (0,ff3*length p.hb4) of (p.hb4 shifted (z.hb3 1-z.hb4 1))..{curl 1.5}z.hb3 2;
z.hb2 2 = point (angletime(p.hb3,beltf4)) of p.hb3;
p.hb2 = subpath (0,0.2*length p.hb3) of (p.hb3 shifted (z.hb2 1-z.hb3 1))..z.hb2 2;
z.hb1 2 = point (angletime(p.hb2,beltf3)) of p.hb2 shifted (thick*dir 45);
p.hb1 = subpath (0,ff3*length p.hb2) of (p.hb2 shifted (z.hb1 1-z.hb2 1))..z.hb1 2;
for i=1 upto 4: labels(z.hb[i]1,z.hb[i]2); endfor
% The two holes in the horizontal belt
save dot;
z.dot1 1 = point angletime(p.hb2,dot_angle1) of p.hb2;
z.dot1 2 = point angletime(p.hb3,dot_angle1) of p.hb3
- (0,1/2(thick-thin));
z.dot2 1 = point angletime(p.hb2,dot_angle2) of p.hb2;
z.dot2 2 = point angletime(p.hb3,dot_angle2) of p.hb3
- (0,1/2(thick-thin));
z.dot1 = good.xy (1/2[z.dot1 1,z.dot1 2]);
z.dot2 = good.xy (1/2[z.dot2 1,z.dot2 2]);
labels(dot1,dot2);
% The black wavy thing
path p.wavy; pair d.w[];
d.w0 = unitvector (z.bel3-z.bel4);
d.w1 = d.w0 rotated 90;
d.w2 = dir wavy_dir;
z.w0 = good.xy(fullcircle scaled (rb2+rb3-thin+thick)
intersectionpoint p.bel);
z.w1 = z.w0 - 1/2wavy_width*d.w0;
z.w2 = z.w0 + 1/2wavy_width*d.w0;
z.w3 = good.xy(z.w0 + 1/2wavy_width*d.w0 + wavy_length*d.w1);
z.w4 = 1/3wavy_length*dir wavy_dir;
p.wavy = z.w2---(z.w2+z.w4)..{curl 1}z.w3{curl 1}..
(z.w1+z.w4)---z.w1--cycle;
labels(w1,w2,w3);
% The upper vertical belt - four paths of which number 1 is on the right
% plus the top of the vertical belt (p.vb5) and the connection between
% the vertical belt and the bell-shaped part (p.vb6).
path p.vb[];
z.vb1 1 = point angletime(p.hb4,beltf8) of p.hb4;
z.vb1 2 = ra4*dir (belt_under_angle-beltf5);
z.vb1 3 = ra4*dir belt_under_angle;
p.vb1 = z.vb1 1..tension 1.5..z.vb1 2..z.vb1 3;
z.vb4 1 = point angletime(p.hb4,beltf7) of p.hb4;
z.vb4 2 = ra4*dir beltf6;
p.vb4 = z.vb4 1..tension 5 and 1..{direction 2 of p.vb1}z.vb4 2;
t.vb5 1 = xpart (fullcircle scaled 2ra4 intersectiontimes p.vb4);
t.vb5 2 = xpart (fullcircle scaled 2ra4 intersectiontimes p.vb1);
p.vb5 = subpath (t.vb5 2,t.vb5 1) of fullcircle scaled 2ra4;
z.vb6 1 = (fullcircle scaled 2ra4 intersectionpoint p.bel);
z.vb6 2 = (fullcircle scaled 2(ra4+thin) intersectionpoint p.vb4);
p.vb6 = z.vb6 2--z.vb6 1;
gap.vb = 1/2[thin,thick]+belt_gap2;
t.vb2 = xpart (p.vb1 shifted (-gap.vb,0) intersectiontimes p.vb5);
p.vb2 = subpath (0,t.vb2) of p.vb1 shifted (-gap.vb,0);
z.vb4 0 = direction 0 of p.vb4;
z.vb3 0 = point 0 of p.vb4 shifted (-thick*unitvector z.vb4 0);
p.vb3 = (z.vb3 0..p.vb4) shifted (gap.vb,0);
labels(vb1 1,vb1 2,vb1 3,vb4 1,vb4 2,vb6 1,vb6 2);
% left and right sections of the lower vertical belt
z.vb10 1 = point angletime(p.hb1,beltf9) of p.hb1;
z.vb10 2 = good.xy(0.5beltf11,-beltf12);
z.vb11 1 = point angletime(p.hb1,beltf10) of p.hb1;
z.vb11 2 = (-x.vb10 2,y.vb10 2);
p.vb10 = subpath (1,2) of (z.vb1 1..z.vb10 1..z.vb10 2);
p.vb11 = subpath (1,2) of (z.vb4 1..z.vb11 1..z.vb11 2);
labels(vb10 1,vb10 2,vb11 1,vb11 2);
% Fleur
z.tip = good.xy(0,-fleur_depth-beltf12);
y.tip = y.fl1-fleurf10 = y.fl2-fleurf9 =
y.fl3-fleurf2 = y.fl4;
y.fl5 = y.fl3; y.fl6 = y.fl2; y.fl7 = y.fl1;
-x.fl1 = x.fl7 = 0.5fleur_narrow;
-x.fl2 = x.fl6 = 0.5fleur_width;
-x.fl3 = x.fl5 = fleurf1;
-x.fl4 = x.fl4;
p.vb12 = z.vb11 2{dir fleurf3}..{down}z.fl1..
{dir (180-fleurf4)}z.fl2{dir -fleurf5}..
{dir -fleurf6}z.fl3{dir -fleurf7}..
{dir -fleurf8}z.fl4{dir fleurf8}..
{dir fleurf7}z.fl5{dir fleurf6}..
{dir fleurf5}z.fl6{dir (180+fleurf4)}..
z.fl7{up}..{dir -fleurf3}z.vb10 2;
labels(fl1,fl2,fl3,fl4,fl5,fl6,fl7);
% The lower vertical belt is built up of the three above sections.
% Two parallel paths are created (one being for the inside of the
% thick line, and the other for the thin line).
p.vb21 = p.vb11 & p.vb12 & reverse p.vb10;
p.vb22 = inner_path(p.vb21, thick-hair,2);
p.vb23 = inner_path(p.vb21, 1/2thin+thick+belt_gap2,1);
% The trapezoidal shape inside the lower belt
d.vb24 = 1.5fine+belt_gap2;
z1.vb24 = point 0.95 of p.vb23 shifted (d.vb24,0);
z2.vb24 = point ff9 of p.vb23 shifted (d.vb24,0);
y3.vb24 = y2.vb24;
y4.vb24 = y1.vb24;
x3.vb24 = -x2.vb24;
x4.vb24 = -x1.vb24;
z5.vb24 = direction ff9 of p.vb23;
z6.vb24 = direction (1+eps) of p.vb23;
p.vb24 = z1.vb24{z6.vb24}..{z5.vb24}z2.vb24--
z3.vb24{(xpart z5.vb24,-ypart z5.vb24)}..
{(xpart z6.vb24,-ypart z6.vb24)}z4.vb24--cycle;
% Since p.vb24 is a cycle, a small hack is required to get the
% inner path.
p.vb25 = inner_path(z4.vb24--p.vb24, 2.5fine, 1);
p.vb26 = (subpath (1,length p.vb25-1) of p.vb25)--cycle;
labels(1.vb24,2.vb24,3.vb24,4.vb24);
% The pentagonal shape inside the lower belt
d.vb27 = 1/2thin+2.5fine;
z1.vb27 = point 2 of p.vb23 shifted (d.vb27,0);
z2.vb27 = point 2.3 of p.vb23 shifted (d.vb27,0);
y3.vb27-y2.vb27 = y2.vb27-y1.vb27;
y4.vb27 = y2.vb27;
y5.vb27 = y1.vb27;
x5.vb27 = -x1.vb27;
x4.vb27 = -x2.vb27;
x3.vb27 = -x3.vb27;
p.vb27 = z1.vb27--z2.vb27--z3.vb27--z4.vb27--z5.vb27--cycle;
p.vb28 = inner_path(z5.vb27--p.vb27, 2.5fine, 1);
p.vb29 = (subpath (1,length p.vb28-1) of p.vb28)--cycle;
labels(1.vb27,2.vb27,3.vb27,4.vb27,5.vb27);
% This is where everything calculated above gets drawn in order, but first...
% Draw outer circles
pickup thick.nib;
t.circ1a = xpart (fullcircle scaled 2ra1 intersectiontimes p.b1 3);
t.circ1b = xpart (fullcircle scaled 2ra1 intersectiontimes p.hb3);
draw subpath (t.circ1b,t.circ1a+8) of fullcircle scaled 2ra1;
t.circ4a = xpart (fullcircle scaled 2ra4 intersectiontimes p.b2 3);
t.circ4b = xpart (fullcircle scaled 2ra4 intersectiontimes p.vb1);
draw subpath (t.circ4b,t.circ4a+8) of fullcircle scaled 2ra4;
pickup thin.nib;
t.circ2a = xpart (fullcircle scaled 2ra2 intersectiontimes p.b1 1);
t.circ2b = xpart (fullcircle scaled 2ra2 intersectiontimes p.hb4);
draw subpath (t.circ2b,t.circ2a+8) of fullcircle scaled 2ra2;
t.circ3a = xpart (fullcircle scaled 2ra3 intersectiontimes p.b2 1);
t.circ3b = xpart (fullcircle scaled 2ra3 intersectiontimes p.vb1);
draw subpath (t.circ3b,t.circ3a+8) of fullcircle scaled 2ra3;
% Draw vertical belt
pickup thick.nib;
for i=1,4: draw p.vb[i]; endfor
pickup thin.nib;
for i=2,3,5,6: draw p.vb[i]; endfor
pickup pencircle scaled hair;
filldraw p.vb21--reverse p.vb22--cycle;
pickup thin.nib; draw p.vb23;
pickup fine.nib;
draw p.vb24; draw p.vb26;
draw p.vb27; draw p.vb29;
% Draw horizontal belt
pickup thick.nib;draw p.hb1;
erase fill p.hb2--cycle;
pickup thin.nib;draw p.hb2;
erase fill p.hb3--reverse(p.hb4)--cycle;
draw p.hb4;
pickup thick.nib;draw p.hb3;
pickup pencircle scaled dot_size;
drawdot z.dot1; drawdot z.dot2;
fill p.wavy;
% Draw bell-shaped part
pickup thin.nib;
erase fill (subpath (t1.bel,t2.bel) of p.bel)--cycle;
draw subpath (t1.bel,t2.bel) of p.bel;
% Draw buckle arms
for i=1,2:
draw p.b[i]1;
draw p.b[i]2;
erase fill p.b[i]3;
endfor
draw subpath (t.b1 1,t.b2 1+8) of p.b1 3;
draw subpath (t.b2 2,t.b1 2+8) of p.b2 3;
% Draw pin
erase fill z.pin2{d.pin1}..{d.pin1}z.pin3..{d.pin2}z.ptip2..
z.pin4{-d.pin1}..{-d.pin1}z.pin1..{-d.pin2}z.ptip1..cycle;
draw z.ptip1{-d.pin2}..z.pin2{d.pin1}..{d.pin1}z.pin3..{d.pin2}z.ptip2;
pickup pencircle yscaled thin xscaled 2thin rotated angle d.pin2;
draw z.ptip2{d.pin2}..z.pin4{-d.pin1}..{-d.pin1}z.pin1..{-d.pin2}z.ptip1;
message " lettering,";
letterstart = belt_left_angle;
letterend = 0.3[belt_under_angle,belt_over_angle];
letterspace*26 + 224u#*hppp = baseline*rad(letterstart-letterend);
% 224u# is an estimate of the width of the letters in
% "UNIVERSITY OF OXFORD", so letterspace now contains an estimate of
% the amount of space between letters, leaving one space at the ends
% and two each side of each dot.
% "distance" is the distance around the circumference from the origin to
% the current letter.
numeric distance;
distance = rad(letterstart)*(baseline)-letterspace;
% "adjust_transform" is called for each letter to place it in the right position.
transform tfm; tfm:=currenttransform;
def adjust_transform =
save currenttransform; transform currenttransform;
currenttransform :=
identity rotated (deg((distance-0.5w)/baseline)-90)
shifted (baseline*dir deg((distance+xoffset)/baseline))
transformed tfm
enddef;
% Here the word "UNIVERSITY" is printed.
for letter = 0 upto 9:
distance := distance - letterspace -
hppp*scantokens("letter" & substring(letter,letter+1) of "UNIVERSITY");
endfor;
university = distance;
distance := rad(letterend)*(baseline)+letterspace;
% The word "OXFORD" will be printed in reverse starting from the end point.
def adjust_transform =
save currenttransform; transform currenttransform;
currenttransform :=
identity rotated (deg((distance+0.5w)/baseline)-90)
shifted (baseline*dir deg((distance+r-l)/baseline))
transformed tfm
enddef;
numeric wid[]; % save the widths of all the letters
for letter = 5 downto 0:
wid[letter] := hppp*scantokens("letter" & substring(letter,letter+1) of "OXFORD");
distance := distance + letterspace + wid[letter];
% CM Roman fonts have a small kern inside "OX" and "FO".
if (letter=3) or (letter=1): distance := distance - 0.5u; fi
endfor;
oxford = distance;
Of = wid2+wid0+3letterspace;
% At this point, university and oxford hold the end points of the two words,
% including one letterspace after the word, and Of holds the width of OF,
% including one letterspace at each side. The word OF can now be centred
% between the other two words and dots can be inserted.
4dotspace+Of = university-oxford;
distance := 1/2[oxford,university] - 1/2Of + letterspace;
distance := distance + letterspace + hppp*letterF;
distance := distance + letterspace + hppp*letterO;
pickup pencircle scaled dot_size;
drawdot good.xy(ra5*dir deg((oxford+dotspace)/baseline));
drawdot good.xy(ra5*dir deg((university-dotspace)/baseline));
message " crowns,";
% The "leaves" of the crown are "almost" pointed and slightly curved.
% A tension of 3 seems to do it, so a short-cut is in order.
def -+- = ..tension 3.. enddef;
% This function draws a crown at point zc with magnification factor mag,
% and labels all the points with suffix s. This may be dependent on the
% line width and other factors, so doesn't work at just any magnification.
def crown(expr zc,mag)(suffix s) =
cgap.s = round(crown_gap*mag); % this number is used quite a lot
% the band
path p.cr[]s;
z.cr0s=good.xy zc; % bottom
z.cr1s=z.cr0s+round(0,mag*crownf1); % centre of bottom
z.cr2s=z.cr1s+round(-mag*1/2crown_width_b,0);
y.cr3s=y.cr2s; x.cr3s-x.cr1s=x.cr1s-x.cr2s;
z.cr4s=z.cr1s+round(0,mag*crownf2);
z.ba1s=round (z.cr2s+(-1/2cgap.s,mag*crown_band));
z.ba2s=z.cr4s+round(0,mag*crown_band);
y.ba3s=y.ba1s;
x.ba3s-x.ba2s=x.ba2s-x.ba1s;
pickup thin.nib;
draw halfcircle xscaled (x.cr3s-x.cr2s) yscaled (2round(y.cr0s-y.cr1s)+eps)
shifted z.cr1s;
p.cr1s=halfcircle xscaled (x.cr3s-x.cr2s) yscaled (2round(y.cr4s-y.cr1s)-eps)
shifted (z.cr1s+(0,cgap.s));
draw p.cr1s; draw p.cr1s shifted (0,-cgap.s);
draw (z.cr0s+(-2cgap.s,cgap.s)){dir(180-ff6)}..{curl 5}(z.cr2s+(2cgap.s,0))..
(good.xy z.cr4s-(0,cgap.s+eps))..(z.cr3s-(2cgap.s,0)){curl5}..
{dir(180+ff6)}(z.cr0s+(2cgap.s,cgap.s));
p.cr2s=halfcircle xscaled (x.ba3s-x.ba1s) yscaled (2round(y.cr4s-y.cr1s)-eps)
shifted good.xy (z.cr1s+(0,y.ba1s-y.cr2s));
p.cr3s=p.cr2s shifted (0,cgap.s);
draw p.cr2s; draw p.cr3s;
for p = z.ba3s,z.ba1s,z.cr2s,z.cr3s:
draw p--(p shifted (0,cgap.s));
endfor
draw z.ba1s--(p.cr1s intersectionpoint (z.ba1s--
(z.ba1s+(1/2(crown_width_t-crown_width_b),-crown_height))));
draw z.ba3s--(p.cr1s intersectionpoint (z.ba3s--
(z.ba3s-(1/2(crown_width_t-crown_width_b),crown_height))));
labels(cr0s,cr1s,cr2s,cr3s,cr4s,ba1s,ba2s,ba3s);
% These two functions determine where the top and bottom of the jewels go
% with respect to the edge of the band.
vardef band_bot primary p = (xpart p,ypart p-0.9cgap.s) enddef;
vardef band_top primary p = (xpart p,ypart p+0.9cgap.s) enddef;
z.cir1s = 0.46[z.cr1s,z.cr2s];
band_bot z.cir1a.s = p.cr1s intersectionpoint (z.cir1s--(z.cir1s+(0,mag*crown_height)));
band_top z.cir1b.s = p.cr2s intersectionpoint (z.cir1s--(z.cir1s+(0,mag*crown_height)));
diam.s = round (length(z.cir1b.s-z.cir1a.s)) - eps;
z.cir1c.s = 1/2[z.cir1b.s,z.cir1a.s];
draw fullcircle scaled diam.s shifted good.xy z.cir1c.s;
z.cir2s = 0.46[z.cr1s,z.cr3s];
band_bot z.cir2a.s = p.cr1s intersectionpoint (z.cir2s--(z.cir2s+(0,mag*crown_height)));
band_top z.cir2b.s = p.cr2s intersectionpoint (z.cir2s--(z.cir2s+(0,mag*crown_height)));
z.cir2c.s = 1/2[z.cir2b.s,z.cir2a.s];
draw fullcircle scaled diam.s shifted good.xy z.cir2c.s;
labels(cir1c.s,cir2c.s);
z.dia1s.a = ff4[z.cr1s,z.cr2s];
z.dia1s.b = z.dia1s.a+(-1/2(crown_width_t-crown_width_b),crown_height);
band_bot z.dia1s1 = p.cr1s intersectionpoint (z.dia1s.a--z.dia1s.b);
band_top z.dia3s1 = p.cr2s intersectionpoint (z.dia1s.a--z.dia1s.b);
z.dia2s.a = ff4[z.cr1s,z.cr3s];
z.dia2s.b = z.dia2s.a+(1/2(crown_width_t-crown_width_b),crown_height);
band_bot z.dia1s2 = p.cr1s intersectionpoint (z.dia2s.a--z.dia2s.b);
band_top z.dia3s2 = p.cr2s intersectionpoint (z.dia2s.a--z.dia2s.b);
band_bot z.dia1s3 = good.xy z.cr4s+(0,cgap.s);
band_top z.dia3s3 = good.xy z.ba2s;
for i=1,2,3:
z.dia0s[i] = good.xy (1/2[z.dia1s[i],z.dia3s[i]]);
z.dia2s[i] = good.xy (z.dia0s[i] + (z.dia1s[i]-z.dia3s[i]) zscaled (0,-1.1));
z.dia4s[i]-z.dia0s[i] = z.dia0s[i]-z.dia2s[i];
erase fill good.xy z.dia1s[i]--z.dia2s[i]--good.xy z.dia3s[i]--z.dia4s[i]--cycle;
draw good.xy z.dia1s[i]--z.dia2s[i]--good.xy z.dia3s[i]--z.dia4s[i]--cycle;
labels(dia0s[i],dia1s[i],dia2s[i],dia3s[i],dia4s[i]);
endfor
% Calculate points for the centre "leaf" (right-hand half only).
% It is based on an equilateral triangle, raised slightly from the
% base of the crown. The side of the triangle is divided equally into 4.
z.tip.s = good.xy (z.cr0s+(0,mag*crown_height));
hgt.s = length(z.tip.s-z.ba2s)-cgap.s;
y.tip.s - y.tri.s = trihgt.s = round(ff5*hgt.s);
z.tri.s - z.tip.s = whatever*dir-60;
z.circ.s = z.tip.s-2/3(0,trihgt.s);
draw fullcircle scaled diam.s shifted z.circ.s;
gap.s = round(0.7*(cgap.s+thin));
draw (z.tip.s-(0,gap.s))--(z.circ.s+(0,gap.s+1/2diam.s));
for j=1,2,3: z.tri[j]s = (j/4)[z.tip.s,z.tri.s]; endfor;
for j=1,2:
z.pt[j]s = 1/2[z.tri[j]s,z.tri[j+1]s] + mag*crownf4*dir30;
endfor
z.pt3s = z.tip.s+whatever*dir(-90+1/2crownf3);
z.pt3s = z.tri1s+whatever*dir30;
z.pt4s = z.tri.s+whatever*dir(150-1/2crownf3);
z.pt4s = z.tri3s+whatever*dir30;
z.pt5s = 1/2[z.pt3s,z.pt4s];
z.pt6s = z.pt3s+1/2mag*crownf4*dir225;
z.pt7s = z.pt4s+1/2mag*crownf4*left;
z.pt8s = (1/2diam.s+gap.s)*dir 36 + z.circ.s;
z.pt9s = z.tri.s+whatever*dir(150+1/2crownf3);
x.pt9s = ff7[x.tip.s,x.tri.s];
z.pt10s = z.pt9s+1/2mag*crownf4*dir135;
bot y.pt11s = y.ba2s+cgap.s;
x.pt11s = 1/2[x.tip.s,x.pt9s];
x.pt12s = x.pt13s = x.tip.s;
y.pt12s = y.pt11s+mag*0.6crownf4;
y.pt13s = y.circ.s-1/2diam.s-gap.s;
x.pt14s = x.pt9s;
y.pt14s = y.pt9s - ff8*mag*crownf4;
labels(tip.s,tri.s,circ.s,pt1s,pt2s,pt3s,pt4s,pt5s,pt6s,pt7s,pt8s,pt9s,
pt10s,pt11s,pt12s,pt13s,pt14s);
% Calculate points for the right-hand "leaf", a kind of rotated
% version of the centre one.
z.tipr.s = z.cr0s + round(1/2mag*crown_width_t,mag*0.85crown_height);
z.botr.s = good.xy (ff5[z.tipr.s,z.ba3s+(-cgap.s,cgap.s)]);
z.dirr1s = unitvector (z.tipr.s-z.botr.s);
z.dirr2s = z.dirr1s zscaled (0,1);
z.trir.s-z.botr.s = (z.tipr.s-z.botr.s) scaled 1/2 rotated 95;
z.cirr.s = good.xy (1/3[z.botr.s,z.tipr.s]);
path p.cir.s;
p.cir.s = fullcircle xscaled diam.s yscaled 1/2diam.s zscaled z.dirr1s
shifted z.cirr.s;
z.tipr1s = z.tipr.s - 1/2mag*crownf4*z.dirr2s;
z.tipr2s = z.tipr.s - mag*crownf4*z.dirr1s;
z.tipr3s = z.tipr.s+mag*0.7crownf4*z.dirr2s;
for j=1,2,3:
z.trir[j]s = (j/4)[z.tipr3.s,z.trir.s];
endfor
for j=1,2:
z.ptr[j]s = 1/2[z.trir[j]s,z.trir[j+1]s] + mag*crownf4*unitvector
((z.tipr3s-z.trir.s)rotated 85);
endfor
z.ptr4s = z.trir.s+whatever*(dir(1/2crownf3) zscaled unitvector
(z.cirr.s-z.trir.s));
z.ptr4s = z.trir3s+whatever*z.dirr2s;
z.ptr3s = z.ptr4s+whatever*(z.tipr.s-z.trir.s);
z.ptr3s = z.trir1s+whatever*z.dirr2s;
z.ptr5s = 1/2[z.ptr3s,z.ptr4s];
z.ptr6s = z.ptr3s+1/3mag*crownf4*dir-65;
z.ptr7s = z.ptr4s+1/2mag*crownf4*dir-30;
z.ptr8s = z.ptr5s+2/3mag*crownf4*dir-40;
z.ptr9s = z.trir.s+whatever*(dir(-1/2crownf3) zscaled unitvector
(z.cirr.s-z.trir.s));
x.ptr9s = ff7[x.botr.s,x.trir.s];
z.ptr10s = z.ptr9s + 1/2mag*crownf4*dir45;
z.ptr12s = z.botr.s - mag*0.4crownf4*z.dirr1s;
z.ptr13s = z.ptr9s - (0,ff8*mag*crownf4);
z.ptr11s = 0.4[z.ptr13s,z.botr.s] - mag*0.4crownf4*z.dirr1s;
labels(tipr.s,botr.s,trir.s,cirr.s,tipr1s,tipr2s,tipr3s,
ptr1s,ptr2s,ptr3s,ptr4s,ptr5s,ptr6s,ptr7s,ptr8s,ptr9s,ptr10s,
ptr11s,ptr12s,ptr13s);
% Underneath the right-hand "leaf" appears to be a filled blob to
% fill the space between the "leaf" and the base of the crown.
path p.bl[]s;
p.bl1s = z.ba3s--(x.ba3s,y.tip.s);
p.bl2s = p.bl1s shifted round(x.ptr11s-x.ba3s,0);
p.bl3s = good.xy z.ptr13s-+-good.xy z.ptr11s-+-good.xy z.ptr12s---z.botr.s;
p.bl4s = good.xy(p.bl1s intersectionpoint p.bl3s)--
good.xy(p.bl1s intersectionpoint p.cr3s)--
good.xy(p.bl2s intersectionpoint p.cr3s)--
good.xy(p.bl2s intersectionpoint p.bl3s)--cycle;
% The bits in between the "leaves".
z.c0s = 0.5[z.circ.s,z.cirr.s];
z.c1s = good.xy (z.cir2c.s + (y.circ.s-1/2[y.dia1s3,y.dia3s3])*unitvector(z.c0s-z.cir2c.s));
z.c2s = (z.c1s--z.cir2c.s) intersectionpoint p.cr3s;
for i=1,2: z.c[i]a.s=z.c[i]s+(1/4diam.s,0);z.c[i]b.s=z.c[i]s-(1/4diam.s,0); endfor
forsuffixes i=a,b: z.c3i.s=0.6[z.c1i.s,z.c2i.s]; endfor
t.c1s = xpart (p.cr3s intersectiontimes ((z.c1s--z.cir2c.s) shifted (-diam.s,0)));
t.c2s = xpart (p.cr3s intersectiontimes ((z.c1s--z.cir2c.s) shifted (diam.s,0)));
z.c4s = z.c2s+1/2mag*crownf4*unitvector (z.c1s-z.cir2c.s);
labels(c0s,c1s,c2s,c4s,c1a.s,c1b.s,c2a.s,c2b.s,c3a.s,c3b.s);
% Now everything is drawn twice - once for the right and once for the left.
forsuffixes i=r,l:
draw (z.tri.s+gap.s*dir 150)--(z.circ.s-(gap.s+1/2diam.s)*dir 150);
draw z.tip.s{right}-+-good.xy z.pt3s-+-good.xy z.pt6s--good.xy z.pt3s-+-
good.xy z.pt1s-+-good.xy z.pt5s-+-good.xy z.pt8s--good.xy z.pt5s-+-
good.xy z.pt2s-+-good.xy z.pt4s-+-good.xy z.pt7s--good.xy z.pt4s-+-
{dir210}good.xy z.tri.s-+-good.xy z.pt9s-+-good.xy z.pt10s--
good.xy z.pt9s-+-good.xy z.pt14s-+-good.xy z.pt11s-+-good.xy z.pt12s---
good.xy z.pt13s;
draw z.botr.s---z.tipr2s..z.tipr1s;
erase fill p.cir.s; draw p.cir.s;
draw good.xy (z.trir.s+gap.s*dir10)--good.xy (z.cirr.s-(gap.s+0.3diam.s)*dir10);
draw good.xy z.tipr1s---good.xy z.tipr.s..good.xy z.ptr3s-+-good.xy z.ptr6s--
good.xy z.ptr3s-+-good.xy z.ptr1s-+-good.xy z.ptr5s-+-good.xy z.ptr8s--
good.xy z.ptr5s-+-good.xy z.ptr2s-+-good.xy z.ptr4s-+-good.xy z.ptr7s--
good.xy z.ptr4s-+-good.xy z.trir.s-+-good.xy z.ptr9s-+-good.xy z.ptr10s--
good.xy z.ptr9s-+-good.xy z.ptr13s-+-good.xy z.ptr11s-+-
good.xy z.ptr12s-+-good.xy z.botr.s;
fill p.bl4s;
draw z.c1b.s---z.c3b.s..tension 1 and 2..good.xy z.pt14s;
draw z.c1a.s---z.c3a.s..tension 1 and 2..good.xy z.ptr13s;
erase fill fullcircle scaled diam.s shifted z.c1s;
draw fullcircle scaled (diam.s-eps) shifted z.c1s;
draw (point t.c1s of p.cr3s){-direction t.c1s of p.cr3s}..z.c4s &
z.c4s..{-direction t.c2s of p.cr3s}(point t.c2s of p.cr3s);
drawdot point 2 of p.cr3s shifted (0,1/2thin);
currenttransform := identity reflectedabout (z.cr0s,z.tip.s) transformed
currenttransform;
endfor
enddef;
% Place the crowns
begingroup
interim proofing:=0; % no labels (instead a separate crown - see below)
-x.pos1 = x.pos2 = round 1/2(ra4*cosd crown_pos-crownf4);
y.pos1 = y.pos2 = round (ra4*sind crown_pos-0.85crown_height);
crown(z.pos1,1,a)
crown(z.pos2,1,b)
crown((0,-ra4+crown_pos3),crown_mag,c)
endgroup;
message " book,";
% Book outline (left-hand half)
pickup pencircle scaled book_thick;
z.bk1l = good.xy (-1/2book_width,book_pos*book_height);
y.bk1l = y.bk0l = y.bk5l+book_wave = y.bk6l-book_wave = y.bk7l;
y.bk2l = y.bk3l = y.bk4l-2/3book_inset = y.bk1l-book_height;
x.bk1l = x.bk2l = x.bk0l - book_inset;
x.bk3l+0.85book_inset = x.bk4l = x.bk5l = 0;
x.bk6l = hround (0.33[x.bk5l,x.bk0l]);
x.bk7l = hround (0.67[x.bk5l,x.bk0l]);
z.bk0'l = z.bk0l - (book_thick,book_thick);
z.bk1'l = z.bk1l - (0,book_thick);
z.bk3'l = z.bk3l + 1/4(book_inset,book_inset);
z.bk3''l = z.bk3'l + (2/3book_thick,-1/3book_thick);
% The left-hand points are mirrored to form the right-hand points.
% A few of these suffixes are used below.
forsuffixes i=0,1,2,3,4,5,6,7,0',1',3',3'',9,10,11:
y.bk.i.r=y.bk.i.l; x.bk.i.r=-x.bk.i.l;
endfor;
% Draw outline.
forsuffixes i=l,r:
cutdraw good.xy z.bk0'i--good.xy z.bk1'i--good.xy z.bk2i---
good.xy z.bk3i..z.bk3'i;
endfor
labels(bk1l,bk2l,bk3l,bk4l,bk5l,bk6l,bk7l,bk3''l,bk0'r,bk1'r,bk3'r);
% Spine
pickup pencircle scaled book_thick;
vround y.bk3''l-y.bk9l = x.bk9l-hround x.bk3''l =
round (y.bk3'l-y.bk3l+1/2book_thick);
draw z.bk3''l..z.bk9l---z.bk9r..z.bk3''r;
pickup pencircle xscaled fine yscaled book_thick;
z.bk10l = 0.45[z.bk3''l,z.bk4l];
z.bk12 = 1/2[z.bk3l,z.bk3r] + (0,1/3book_thick);
x.bk11l = x.bk10l;
y.bk11l = 1/2[y.bk10l,y.bk12];
draw z.bk10l--z.bk11l{dir10}..{curl 5}z.bk12{curl5}..{dir-10}z.bk11r--z.bk10r;
labels(bk10l,bk11l,bk12);
% Page outline
pickup thin.nib;
forsuffixes i=l,r:
draw z.bk3''i--z.bk4i--z.bk5i{curl 1}..z.bk6i..z.bk7i..z.bk0i;
endfor
% The individual pages (left and right)
forsuffixes i=l,r:
pg := book_inset/5.5;
% One diagram of the crest has uneven pages on the left-hand side. If that
% were desired the next line might read
% for p = if str i="l": 0,0.9,2,2.8,4 else: 0,1,2,3,4 fi:
% and that's why z.pg[] is calculated twice even though the left ones and
% the right ones are the same in this case.
for p = 0,1,2,3,4:
z.pg0[p]i = z.bk0l;
z.pg1[p]i = z.pg0[p]i-(p*pg,p*0.7pg);
x.pg2[p]i = x.pg1[p]i;
y.pg2[p]i = y.bk2l+book_inset-p*pg;
z.pg3[p]i = (p/4)[z.bk4l,z.bk3''l];
x.pg4[p]i = 0.33[x.pg2[p]i,x.pg3[p]i];
x.pg5[p]i = 0.67[x.pg2[p]i,x.pg3[p]i];
y.pg2[p]i = y.pg4[p]i = y.pg5[p]i-1/2book_wave;
draw z.pg0[p]i--z.pg1[p]i--z.pg2[p]i{curl1}..z.pg4[p]i..good.xy z.pg5[p]i..
good.xy z.pg3[p]i;
endfor
currenttransform := identity xscaled -1 transformed currenttransform;
endfor
for i=0 upto 5:labels(pg[i]1l); endfor
% The seven seals
seal_gap = round(seal_diam+1.5thin);
x.s0 = good.x(x.bk1l-seal_offset);
y.s0 = good.y(y.bk1l-1/2book_height+4seal_gap);
for i = 1 upto 7:
z.s[i] = z.s[i-1]-(0,seal_gap) if i=7: + round(0.15*seal_offset,0) fi;
z.s0[i] = z.bk1l-(0,(i-1/2)*1/7book_height);
z.s1[i] = z.s0[i]+(0,1/2seal_width);
z.s2[i] = z.s[i]+(0.35seal_diam,((i-1)/6)[0.35seal_diam,seal_width-0.35seal_diam]);
draw z.s1[i]--z.s2[i];
draw (z.s1[i]--z.s2[i]) shifted (0,-seal_width);
erase fill fullcircle scaled seal_diam shifted z.s[i];
draw fullcircle scaled (seal_diam-eps) shifted z.s[i];
labels(s[i],s0[i],s1[i],s2[i]);
endfor
message " book lettering)";
% The letters in the book will be based on cmbx5, but smaller, bolder and
% with smaller serifs. They are made relatively taller and thinner.
% Such modifications look OK in the book but would probably not bear
% close inspection in general.
input cmbx5;
cap_height# := 1.5cap_height#;
u# := 0.93u#;
cap_stem# := 1.3cap_stem#;
cap_ess# := 1.4cap_ess#;
cap_curve# := 1.3cap_curve#;
hair#:=1.1hair#;
cap_jut# := 0.8cap_jut#;
% The following hack makes the letters 2/3 of their real size.
old_hppp := hppp;
old_vppp := vppp;
hppp := 2/3hppp;
vppp := 2/3vppp;
font_setup;
hppp := old_hppp;
vppp := old_vppp;
forsuffixes i = u,cap_height,cap_serif_fit,width_adj:
i# := 2/3i#;
endfor
def t_ = transformed currenttransform enddef;
currenttransform := tfm;
let letterN = smallN; % Use the variant forms of these letters
let letterV = smallV;
% When printing the letters the transform will be adjusted by
% the current value of xoffset. tfm holds the position of each
% letter.
def adjust_transform =
save currenttransform; transform currenttransform;
currenttransform := tfm shifted (xoffset,0)
enddef;
string lett;
% Print letters. The special letter k inserts a kern. Some of the
% letters appear to need adjusting to make the spacing come out right.
% The letters are moved closer together by 1/2u.
def print_line (expr x,y,t) =
tfm := identity shifted round (x,y) transformed currenttransform;
for letter = 0 upto length(t)-1:
lett := substring(letter,letter+1) of t;
if lett = "A": tfm := tfm shifted (-hround 1.5u,0);
elseif lett="S" : tfm := tfm shifted (-hround u,0); fi
if lett = "k": tfm := tfm shifted (-hround 1.5u,0);
else:
wid := hppp*scantokens("letter" & lett) - 1/2u;
tfm := tfm shifted (hround wid,0);
fi
if (lett = "O") or (lett = "D") : tfm := tfm shifted (-hround u,0); fi
endfor
enddef;
% Do the printing.
save baseline;
4baseline-cap_height = book_height-book_inset;
print_line(x.bk0l+4u,y.bk0l-baseline,"DOkMI");
print_line(x.bk0l+12u,y.bk0l-2baseline,"NVS");
print_line(x.bk0l+7u,y.bk0l-3baseline,"ILLkkV");
print_line(x.bk5l+3u,y.bk0l-baseline,"MINA");
print_line(x.bk5l+13u,y.bk0l-2baseline,"TIO");
print_line(x.bk5l+9u,y.bk0l-3baseline,"MEA");
% These assignments make MF put a suitable box round the character in the display.
currenttransform:=identity; body_height:=h; asc_height:=h/2; x_height:=3/4h; bar_height:=h/4;
desc_depth:=body_depth:=0; u:=w/4;
endchar;
if displaying>0: stop "Press RETURN to continue"; fi % display the crest
if proofing>0: % Draw a big crown to help with the proofing
factor=3.6;
wid# = factor*crown_width_t#;
hgt# = factor*crown_height#;
"A large crown";
beginchar(1,wid#,hgt#,0);
thin# := 2thin#;
define_whole_blacker_pixels(thin);
pickup pencircle scaled thin;thin.nib:=savepen;
adjust_fit(0pt#,0pt#);
crown((w/2,0),factor,s);
body_height:=h; asc_height:=h/2; x_height:=3/4h;
desc_depth:=body_depth:=0; u:=w/4;
endchar;
if displaying>0: stop "Press RETURN to continue"; fi % display the crown
fi
end

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,668 @@
% Definitions of letters for the "belted" crest, adapted from
% romanu.mf from the Computer Modern typeface. Many of the
% letters appear unchanged; some have been adapted where noted.
% The extra instruction adjust_transform has been inserted
% into each letter to place it in the correct position.
% Instead of "beginchar" we use "beginletter", which provides
% a similar environment allowing the character to be used
% within another character. Labels are disabled; otherwise
% the many letters in the crest produce too many for gftodvi.
def beginletter(expr letter,w_sharp,h_sharp,d_sharp) =
begingroup
interim proofing:=0;
interim charwd:=w_sharp;
interim charht:=h_sharp;
interim chardp:=d_sharp;
interim charic:=0;
save w;w:=hround(charwd*hppp);
save h;h:=vround(charht*hppp);
save d;d:=vround(chardp*hppp);
save l,r,x,y
enddef;
% And to end "beginletter" there is "endletter". It makes each
% letter evaluate to its character width.
def endletter =
scantokens extra_endchar;
charwd
endgroup
enddef;
%def letterA =
% beginletter("A",13u#,cap_height#,0);
% adjust_fit(cap_serif_fit#,cap_serif_fit#);
% adjust_transform;
% numeric left_stem,right_stem,outer_jut,alpha;
% right_stem=cap_stem-stem_corr;
% left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
% outer_jut=.8cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
% x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
% alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
% penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
% penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
% z0=whatever[z1r,z2r]=whatever[z3l,z4l];
% if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
% fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
% --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
% ...{up}z0+.5left--cycle; % left and right diagonals
% else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
% --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
% penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
% penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
% if hefty: y5r else: y5 fi =5/12y0;
% y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
% if serifs: numeric inner_jut; pickup tiny.nib;
% prime_points_inside(1,2); prime_points_inside(4,3);
% if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
% else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
% dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark); % left serif
% dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); fi % right serif
% penlabels(0,1,2,3,4,5,6);
% endletter
%enddef;
% The letter A for use in the book has a higher bar and the left-hand
% stem sticks out a bit at the top. It is slightly wider.
def letterA =
beginletter("A",14u#,cap_height#,0);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric left_stem,right_stem,outer_jut,alpha;
right_stem=cap_stem-stem_corr;
left_stem=min(cap_hair if hefty: -3stem_corr fi,right_stem);
outer_jut=.8cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
x2-x1=x4-x3; x3r=x2r+1/2apex_corr; y2=y3=h+apex_o+apex_oo;
alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
fill diag_end(3l,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,3l,4l)--cycle;
fill diag_end(2r,1r,1,1,1l,2l)--diag_end(1l,2l,1,1,2r,1r)--cycle;
penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
if hefty: y5r else: y5 fi =7/12y0;
y5r-y5l=y6r-y6l=cap_band; penstroke z5e--z6e; % bar line
if serifs: numeric inner_jut; pickup tiny.nib;
prime_points_inside(1,2); prime_points_inside(4,3);
if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark); % left serif
dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); fi % right serif
penlabels(0,1,2,3,4,5,6);
endletter
enddef;
def letterD =
beginletter("D",13.5u#,cap_height#,0);
italcorr .7cap_height#*slant-.5u#;
adjust_fit(cap_serif_fit#,0);
adjust_transform;
pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
penpos3(cap_band,90); penpos4(cap_band,90);
penpos5(cap_curve-stem_corr,0);
penpos6(cap_band,-90); penpos7(cap_band,-90);
z3r=top z1; y4=y3; y5=.51[y4,y6]; y6=y7;
z7r=bot z2; x4=x6=.5w+.25u; x5r=hround(w-u);
x4l:=x6l:=x4-.25cap_curve;
fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
math_fit(0,ic#-.5u#); penlabels(1,2,3,4,5,6,7);
endletter
enddef;
def letterE =
beginletter("E",12u#-width_adj#,cap_height#,0);
italcorr cap_height#*slant-beak_jut#-.5u#;
adjust_fit(cap_serif_fit#,0);
adjust_transform;
h:=vround(h-stem_corr);
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
pickup crisp.nib; pos3(slab,90); pos4(hair,0);
top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-beak)-eps;
arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
pos5(cap_bar,-90); pos6(hair,0);
top y5l=vround(.52[y2,y1]+.5cap_bar); x5=x1;
pos0(cap_bar,90); pos7(hair,0);
z0=z5; x6=x7; y6-y5l=y0l-y7;
if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.6beak)+eps;
rt x9r=hround(w-.5u);
else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
bot y8r=0; x8=x2; y9=good.y(y8l+7/6beak)+eps;
arm(8,9,h,beak_darkness,1.5beak_jut); % lower arm and beak
if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9);
endletter
enddef;
def letterF =
beginletter("F",11.5u#-width_adj#,cap_height#,0);
italcorr cap_height#*slant-beak_jut#-.25u#;
adjust_fit(cap_serif_fit#,0);
adjust_transform;
h:=vround(h-stem_corr);
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
pickup crisp.nib; pos3(slab,90); pos4(hair,0);
top y3r=h; x3=x1; rt x4r=hround(w-.75u); y4=good.y(y3l-beak)-eps;
arm(3,4,e,beak_darkness,beak_jut); % upper arm and beak
pos5(cap_bar,-90); pos6(hair,0);
top y5l=vround(.5[y2,y1]+.5cap_bar); x5=x1;
pos0(cap_bar,90); pos7(hair,0);
z0=z5; x6=x7; y6-y5l=y0l-y7;
if serifs: rt x6r=hround(w-4u+.5hair); y6=good.y(y5l+.6beak)+eps;
rt x9r=hround(w-.5u);
else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0); % middle arm and serif
if serifs: nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
dish_serif(2,1,c,1/3,cap_jut,d,1/3,1.25cap_jut); fi % lower serif
math_fit(0,ic#-2.5u#);penlabels(0,1,2,3,4,5,6,7,8,9);
endletter
enddef;
def letterI =
beginletter("I",max(6u#,4u#+cap_stem#),cap_height#,0);
italcorr cap_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
if serifs: dish_serif(1,2,a,1/3,1.05cap_jut,b,1/3,1.05cap_jut); % upper serif
dish_serif(2,1,c,1/3,1.05cap_jut,d,1/3,1.05cap_jut); fi % lower serif
math_fit(0,.5ic#); penlabels(1,2);
endletter
enddef;
% The L has been made a bit wider.
def letterL =
beginletter("L",13u#-width_adj#,cap_height#,0);
adjust_fit(cap_serif_fit#,0);
adjust_transform;
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
lft x1l=lft x2l=hround max(2u,3u-.5cap_stem); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
pickup crisp.nib; pos3(slab,-90); pos4(hair,0);
bot y3r=0; x3=x2; y4=y3l+7/6beak+eps; rt x4r=hround(w-.75u);
arm(3,4,e,1.2beak_darkness,beak_jut); % lower arm and beak
if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,1.25cap_jut); % upper serif
nodish_serif(2,1,c,1/3,cap_jut,d,1/3,.5cap_jut); fi % lower serif
math_fit(0,u#); penlabels(1,2,3,4);
endletter
enddef;
%def letterM =
% beginletter("M",16u#+width_adj#,cap_height#,0);
% italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
% adjust_fit(cap_serif_fit#,cap_serif_fit#);
% adjust_transform;
% numeric stem[]; % thicknesses of the four strokes
% stem1=hround(fudged.hair+stem_corr);
% stem2=hround(fudged.cap_stem-4stem_corr);
% stem3=hround(fudged.hair-stem_corr);
% stem4=hround(fudged.cap_stem-3stem_corr);
% if stem4<stem1: stem4:=stem1; fi
% pickup tiny.nib; pos1(stem1,0); pos2(stem1,0);
% pos3(stem4,0); pos4(stem4,0);
% x1=x2; x3=x4; x1l=w-x3r; rt x3r=hround min(w-2u,w-3u+.5stem4);
% top y1=top y3=h; bot y2=bot y4=0;
% filldraw stroke z1e--z2e; % left stem
% filldraw stroke z3e--z4e; % right stem
% penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
% x5l=x1; x6l=x7l; x8=lft x3l; x6-x5=x8-x7; y5=y8=h; y6=y7;
% if hefty: y6=if monospace: vround 1/3h else: o fi;
% numeric upper_notch,lower_notch;
% upper_notch=h-cap_notch_cut; lower_notch=y6+cap_notch_cut;
% x1'=rt x1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
% z0=whatever[z5r,z6r]=whatever[z7l,z8l];
% fill z5l..
% if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
% {z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
% if y3'<upper_notch: ...{up}(x3'-1,upper_notch){right} fi
% ..z8r--diag_out(8r,1,8l,7l){z7-z8}
% if y0<=lower_notch: ..{z7-z8}z0{z5-z6}..
% else: ...{down}(x0+.5,lower_notch)--(x0-.5,lower_notch){up}... fi
% {z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonals
% else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
% fill z5l..{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
% ..z8r--diag_out(8r,1,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
% ..{z5-z6}diag_in(6r,5r,1,5l)--cycle; fi % diagonals
% if serifs: serif(1,2,a,1/3,-cap_jut); % upper left serif
% dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
% serif(3,4,d,1/3,cap_jut); % upper right serif
% dish_serif(4,3,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower right serif
% math_fit(0,max(.5ic#-.5u#,0));
% penlabels(0,1,1',2,3,3',4,5,6,7,8);
% endletter
%enddef;
% The letter M for the book has sloping sides.
def letterM =
beginletter("M",18u#+width_adj#,cap_height#,0);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric stem[]; % thicknesses of the four strokes
stem1=hround(fudged.hair-0stem_corr);
stem2=hround(fudged.cap_stem-1stem_corr);
stem3=hround(fudged.hair-0stem_corr);
stem4=hround(fudged.cap_stem-1stem_corr);
if stem4<stem1: stem4:=stem1; fi
pickup tiny.nib; pos1(stem1,0); pos2(stem1,0);
pos3(stem4,0); pos4(stem4,0);
x2l=w-x4r; rt x4r=hround min(w-2u,w-3u+.5stem4);
x1-x2 = x4-x3 = hround (0.2(x4-x2));
top y1=top y3=h; bot y2=bot y4=0;
filldraw stroke z1e--z2e; % left stem
filldraw stroke z3e--z4e; % right stem
penpos5(stem2,0); penpos6(stem2,0); penpos7(stem3,0); penpos8(stem3,0);
lft x5=rt x1; x6l=x7r; rt x8=lft x3; x6-x5=x8-x7; y5=y8=h; y6=y7;
if hefty: y6=if monospace: vround 1/3h else: o fi;
numeric upper_notch,lower_notch;
upper_notch=h-cap_notch_cut; lower_notch=y6+cap_notch_cut;
x1'=rt x1r; z1'=whatever[z5l,z6l]; x3'=lft x3l; z3'=whatever[z7r,z8r];
z0=whatever[z5r,z6r]=whatever[z7l,z8l];
fill z5l..
if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
if y3'<upper_notch: ...{up}(x3'-1,upper_notch){right} fi
..z8r--diag_out(8r,1,8l,7l){z7-z8}
if y0<=lower_notch: ..{z7-z8}z0{z5-z6}..
else: ...{down}(x0+.5,lower_notch)--(x0-.5,lower_notch){up}... fi
{z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonals
else: y6=0; z0=whatever[z5r,z6r]=whatever[z7l,z8l];
fill z5l..{z6-z5}diag_in(5l,6l,1,6r)..diag_out(7l,1,7r,8r){z8-z7}
..z8r--diag_out(8r,1,8l,7l){z7-z8}..{z7-z8}z0{z5-z6}
..{z5-z6}diag_in(6r,5r,1,5l)--cycle; fi % diagonals
if serifs: serif(1,2,a,1/3,-cap_jut); % upper left serif
dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
serif(3,4,d,1/3,cap_jut); % upper right serif
dish_serif(4,3,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower right serif
math_fit(0,max(.5ic#-.5u#,0));
penlabels(0,1,1',2,3,3',4,5,6,7,8);
endletter
enddef;
def letterN =
beginletter("N",13u#+width_adj#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
pickup tiny.nib; pos1(thin_stem,0); pos2(thin_stem,0);
pos3(thin_stem,0); pos4(thin_stem,0);
pickup tiny.nib; top y1=top y3=h; bot y2=bot y4=0;
x1=x2; x3=x4; x1l=w-x3r;
rt x3r=hround min(w-2u,w-3u+.5fudged.cap_stem);
filldraw stroke z1e--z2e; % left stem
filldraw stroke z3e--z4e; % right stem
if hefty: penpos5(fudged.cap_stem,0); penpos6(fudged.cap_stem,0);
x5l=x1; x6r=x4; y5=h; y6=0;
numeric upper_notch,lower_notch;
upper_notch=h-cap_notch_cut; lower_notch=cap_notch_cut;
x1'=rt x1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
fill z5l..
if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
{z6-z5}diag_in(5l,6l,1,6r)--z6r..
if y4'>lower_notch: {left}(x4'-1,lower_notch){up}... fi
{z5-z6}diag_in(6r,5r,1,5l)--cycle; % diagonal
else: penpos5(whatever,0); penpos6(whatever,90);
z5l=z1l; z6l=z4l;
z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
filldraw stroke z5e..z6e; fi % diagonal
if serifs: if hefty: serif(1,2,a,1/3,-cap_jut); % upper left serif
else: serif(5,6,a,1/3,-cap_jut); fi % upper left serif
dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
dish_serif(3,4,e,1/2,cap_jut,f,1/2,cap_jut)(dark); fi % upper right serif
math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7);
endletter
enddef;
% The letter N for the book has a sharper point at the bottom right
% and the diagonal protrudes slightly at the top left.
def smallN =
beginletter("N",13u#+width_adj#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
pickup tiny.nib; pos1(thin_stem,0); pos2(thin_stem,0);
pos3(thin_stem,0); pos4(thin_stem,0);
pickup tiny.nib; top y1=top y3=h; bot y2=bot y4=0;
x1=x2; x3=x4; x1l=w-x3r;
rt x3r=hround min(w-2u,w-3u+.5fudged.cap_stem);
penpos5(whatever,0); penpos6(whatever,90);
z1l-z5l=(2/3cap_jut,0); z6l=z4r;
z7=z6l+(max(eps,cap_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
filldraw stroke z1e--z2e; % left stem
pos4'(thin_stem,0); x4'=x4; y4'=y6;
filldraw stroke z3e--z4'e; % right stem
filldraw stroke z5e..z6e; % diagonal
if serifs:
serif(1,2,a,1/3,-cap_jut); % upper left serif
dish_serif(2,1,b,1/2,cap_jut,c,1/2,cap_jut)(dark); % lower left serif
dish_serif(3,4,e,1/2,cap_jut,f,1/2,cap_jut)(dark); fi % upper right serif
math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7);
endletter
enddef;
def letterO =
beginletter("O",14u#-width_adj#,cap_height#,0);
italcorr .7cap_height#*slant-.5u#;
adjust_fit(0,0);
adjust_transform;
penpos1(vair',90); penpos3(vround(vair+1.5vair_corr),-90);
penpos2(cap_curve,180); penpos4(cap_curve,0);
if monospace: x2r=hround 1.5u;
interim superness:=sqrt superness; % make |"O"|, not |"0"|
else: x2r=hround u; fi
x4r=w-x2r; x1=x3=.5w; y1r=h+o; y3r=-o;
y2=y4=.5h-vair_corr; y2l:=y4l:=.52h;
penstroke pulled_super_arc.e(1,2)(.5superpull)
& pulled_super_arc.e(2,3)(.5superpull)
& pulled_super_arc.e(3,4)(.5superpull)
& pulled_super_arc.e(4,1)(.5superpull) & cycle; % bowl
math_fit(-.3cap_height#*slant-.5u#,ic#-.5u#); penlabels(1,2,3,4);
endletter
enddef;
%def letterR =
% beginletter("R",if serifs: 12u#+.5max(2u#,cap_curve#)
% else:12.5u#-.5width_adj# fi,cap_height#,0);
% italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
% adjust_fit(cap_serif_fit#,0);
% adjust_transform;
% pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
% lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
% filldraw stroke z1e--z2e; % stem
% penpos3(cap_band,90); penpos4(cap_band,90);
% penpos5(cap_curve if hefty:-3stem_corr fi,0);
% penpos6(vair,-90); penpos7(vair,-90);
% z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
% x7=x2; y7l=vround(.5h+.5vair); x4=x6;
% if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
% else: x4=.5w+.5u; x5r=hround(w-u); fi
% x4l:=x6l:=x4-.125cap_curve;
% fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
% if serifs: pos6'(vair,-90); pos0(cap_stem,180);
% pos8(cap_curve,180); pos9(vair,-90); pos10(hair,0);
% z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5cap_curve);
% y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
% bot y9r=-o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
% filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up}; % tail
% nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
% dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut); % lower serif
% else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
% x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
% fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi % tail
% math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10);
% endletter
%enddef;
% This modified letter R has a straight tail instead of a curly one.
def letterR =
beginletter("R",if serifs: 12u#+.5max(2u#,cap_curve#)
else:12.5u#-.5width_adj# fi,cap_height#,0);
italcorr .75cap_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
pickup tiny.nib; pos1(cap_stem',0); pos2(cap_stem',0);
lft x1l=lft x2l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
penpos3(cap_band,90); penpos4(cap_band,90);
penpos5(cap_curve if hefty:-3stem_corr fi,0);
penpos6(vair,-90); penpos7(vair,-90);
z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
x7=x2; y7l=vround(.5h+.5vair); x4=x6;
if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
else: x4=.5w+.5u; x5r=hround(w-u); fi
x4l:=x6l:=x4-.125cap_curve;
fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe
if serifs:
pos8(cap_stem+stem_corr,0); pos9(cap_stem+stem_corr,0);
x8=x6+.5u; y8=y6; x9=hround(x5r); bot y9=0;
filldraw z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; % tail
serif(9,8,e,1/3,0.5cap_jut); % tail serif
nodish_serif(1,2,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif
dish_serif(2,1,c,1/3,cap_jut,d,1/3,cap_jut); % lower serif
else: penpos8(cap_stem-2stem_corr,0); penpos9(cap_stem,0);
x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi % tail
math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10);
endletter
enddef;
def letterS =
beginletter("S",10u#,cap_height#,0);
italcorr cap_height#*slant-u#;
adjust_fit(0,0);
adjust_transform;
numeric theta; theta=90-angle(50u,h); slope:=-h/50u; % angle at middle
numeric s_slab; s_slab=if serifs:slab else:vround .2[slab,cap_stem] fi;
numeric ess'; ess'=max(fine.breadth,cap_ess);
pickup fine.nib; pos2(max(fine.breadth,s_slab-vround vair_corr),-90);
pos0(ess',theta); pos7(s_slab,-90);
x2+x7=2x0=w; x7-x2=if serifs: u else: 0 fi; top y2l=h+o; bot y7r=-o;
y0=.52h; lft x3l=hround u; rt x6r=hround(w-u);
x3r-x3l=x6r-x6l=hround .5[s_slab,ess']-fine;
ellipse_set(2l,3l,4l,0l); ellipse_set(2r,3r,4r,0r); y3=y3r;
ellipse_set(7l,6l,5l,0l); ellipse_set(7r,6r,5r,0r); y6=y6r;
filldraw stroke super_arc.e(2,3) & z3e{down}
..z4e---z5e..z6e{down} & super_arc.e(6,7); % main stroke
if serifs: pos1(hair,180); pos8(hair,180);
rt x1l=hround(w-1.5u); lft x8r=hround u;
bot y1=vround 2/3h+1; top y8=vround 1/3h-1;
filldraw stroke z1e{x2-x1,10(y2-y1)}....{left}z2e; % upper arc
filldraw stroke z7e{left}....{up}z8e; % lower arc
path upper_arc, lower_arc;
upper_arc=z1{x2-x1,10(y2-y1)}....{left}z2;
lower_arc=z7{left}....{up}z8;
pos10(.3[fine.breadth,cap_hair],0); pos9(.3[fine.breadth,cap_hair],0);
x10r=x1l; top y10=top y2l; x9l=x8r; bot y9=bot y7r;
x1l-x1'=x8'-x8r=1.6cap_curve-fine; y1'=y1; y8'=y8;
numeric t; t=xpart(upper_arc intersectiontimes(z10l--z1'));
filldraw z1l--z10r--z10l--subpath(t,0) of upper_arc--cycle; % upper barb
t:=xpart(lower_arc intersectiontimes(z9r--z8'));
filldraw z8r--z9l--z9r--subpath(t,1) of lower_arc--cycle; % lower barb
else: pos1(1.2flare,-100); pos8(1.2flare,-100);
x1l=good.x(x1l+w-1.75u-rt x1); lft x8r=hround .8u;
top y1l=vround .93h+o; bot y8r=vround .1h-o;
filldraw stroke term.e(2,1,right,.9,4); % upper arc and terminal
filldraw stroke term.e(7,8,left,1,4); fi % lower arc and terminal
math_fit(0,.5ic#); penlabels(0,1,1',2,3,4,5,6,7,8,8',9,10);
endletter
enddef;
def letterT =
beginletter("T",13u#-width_adj#,cap_height#,0);
italcorr cap_height#*slant-beak_jut#-.25u#;
adjust_fit(0,0);
adjust_transform;
h:=vround(h-2stem_corr);
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
lft x1l=lft x2l=hround(.5w-.5cap_stem); top y1=h; bot y2=0;
filldraw stroke z1e--z2e; % stem
pickup crisp.nib; pos3(slab,90); pos4(hair,0);
top y3r=h; x3=x1; rt x4r=hround(w-.65u); y4=good.y(y3l-beak)-eps;
arm(3,4,e,beak_darkness,.7beak_jut); % right arm and beak
pos5(hair,180); x5=w-x4; y5=y4;
arm(3,5,f,beak_darkness,-.7beak_jut); % left arm and beak
if serifs: dish_serif(2,1,c,1/3,1.414cap_jut,d,1/3,1.414cap_jut); % lower serif
nodish_serif(1,2,a,1/3,.5cap_jut,b,1/3,.5cap_jut); fi % upper bracketing
math_fit(-.75cap_height#*slant,ic#-2.5u#); penlabels(1,2,3,4,5,6);
endletter
enddef;
def letterU =
beginletter("U",13u#+.5width_adj#,cap_height#,0);
italcorr cap_height#*slant-cap_serif_fit#+cap_jut#-2.5u#+min(.5cap_stem#,u#);
if monospace: adjust_fit(cap_serif_fit#-.5u#,cap_serif_fit#-.5u#)
else: adjust_fit(cap_serif_fit#,cap_serif_fit#) fi;
adjust_transform;
pickup tiny.nib; pos1(cap_stem,0); pos2(cap_stem,0);
pos2'(cap_stem,180); z2'=z2;
pos3(cap_band,-90);
pos4(cap_hair,0); pos5(cap_hair,0);
x1=x2; x3=.5[x1,x5]; x4=x5; x1l=w-x5r;
top y1=top y5=h; y2=y4=1/3h; bot y3r=-o;
lft x1l=hround max(2u,3u-.5cap_stem);
filldraw stroke z1e--z2e; % left stem
filldraw stroke pulled_arc.e(2',3)
& pulled_arc.e(3,4)&z4e--z5e; % arc and right stem
if serifs: dish_serif(1,2,a,1/3,cap_jut,b,1/3,cap_jut); % left serif
dish_serif(5,4,c,1/2,cap_jut,d,1/2,cap_jut)(dark); fi % right serif
math_fit(-cap_serif_fit#-.3cap_height#*slant-min(cap_height#*slant,u#),
max(.5ic#-.5u#,0)); penlabels(1,2,3,4,5);
endletter
enddef;
def letterV =
beginletter("V",13u#,cap_height#,0);
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric left_stem,right_stem,outer_jut,alpha;
left_stem=cap_stem-stem_corr;
right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4=h;
x2-x1=x4-x3; x2l+apex_corr=x3l; y2=y3=-apex_o;
alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
if y0>cap_notch_cut: y0:=cap_notch_cut;
fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
--diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
...{down}z0+.5left--cycle; % left and right diagonals
else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
--diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
if serifs: numeric inner_jut; pickup tiny.nib;
prime_points_inside(1,2); prime_points_inside(4,3);
if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % left serif
dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); fi % right serif
math_fit(.75u#-cap_height#*slant,ic#-4u#); penlabels(0,1,2,3,4);
endletter
enddef;
% The V in the book has a sharper point.
def smallV =
beginletter("V",13u#,cap_height#,0);
italcorr cap_height#*slant+.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric left_stem,right_stem,outer_jut,alpha;
left_stem=cap_stem-stem_corr;
right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4=h;
x2-x1=x4-x3;
x2l=x3r; y2=y3=0;
alpha=diag_ratio(2,right_stem,y1-y2,x4r-x1l-apex_corr);
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
if y0>cap_notch_cut: y0:=cap_notch_cut;
fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
--diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
...{down}z0+.5left--cycle; % left and right diagonals
else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
--diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
if serifs: numeric inner_jut; pickup tiny.nib;
prime_points_inside(1,2); prime_points_inside(4,3);
if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % left serif
dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); fi % right serif
math_fit(.75u#-cap_height#*slant,ic#-4u#); penlabels(0,1,2,3,4);
endletter
enddef;
def letterX =
beginletter("X",13u#,cap_height#,0);
italcorr cap_height#*slant-.25u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric stem[],outer_jut,xjut,alpha[];
stem1=cap_stem-2stem_corr; stem2=min(cap_hair,stem1);
outer_jut=.75cap_jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi;
x1l=l+letter_fit+.5u+outer_jut; x2r=r-letter_fit-u-outer_jut-xjut;
x3l=l+letter_fit+.25u+outer_jut+xjut; x4r=r-letter_fit-.25u-outer_jut;
y1=y2=h; y3=y4=0;
alpha1=diag_ratio(1,stem1,h,x4r-x1l);
alpha2=diag_ratio(1,stem2,h,x2r-x3l);
penpos1(alpha1*stem1,0); penpos2(alpha2*stem2,0);
penpos3(alpha2*stem2,0); penpos4(alpha1*stem1,0);
if hefty: z0=whatever[z1,z4]=whatever[z2,z3];
x12=x34=x0; y13=y24=y0;
z12=whatever[z2l,z3l]; z13=whatever[z2l,z3l];
z24=whatever[z2r,z3r]; z34=whatever[z2r,z3r];
forsuffixes $=13,24,34: z$'=.1[z$,z0]; endfor
fill diag_end(12,1r,.5,1,1l,13')--z13'--diag_end(13',3l,1,.5,3r,34')--z34'
--diag_end(34',4l,.5,1,4r,24')--z24'
--diag_end(24',2r,1,.5,2l,12)--z12--cycle; % diagonals
else: fill diag_end(4r,1r,.5,1,1l,4l)
--diag_end(1l,4l,.5,1,4r,1r)--cycle; % left diagonal
fill diag_end(2l,3l,.5,1,3r,2r)
--diag_end(3r,2r,.5,1,2l,3l)--cycle; fi % right diagonal
if serifs: numeric inner_jut[]; pickup tiny.nib;
prime_points_inside(1,4); prime_points_inside(2,3);
prime_points_inside(3,2); prime_points_inside(4,1);
if rt x1'r+cap_jut+.5u+1<=lft x2'l-cap_jut-xjut: inner_jut1=cap_jut;
else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi
if rt x3'r+cap_jut+.5u+1<=lft x4'l-cap_jut-xjut: inner_jut2=cap_jut;
else: rt x3'r+inner_jut2+.5u+1=lft x4'l-inner_jut2-xjut; fi
dish_serif(1',4,a,1/3,outer_jut,b,2/3,inner_jut1); % upper left serif
dish_serif(4',1,c,2/3,inner_jut2,d,1/3,outer_jut); % lower right serif
dish_serif(2',3,e,2/3,inner_jut1+xjut,
f,1/2,outer_jut+xjut)(dark); % upper right serif
dish_serif(3',2,g,1/2,outer_jut+xjut,
h,2/3,inner_jut2+xjut)(dark); fi % lower left serif
math_fit(0,.5ic#); penlabels(0,1,2,3,4,12,13,24,34);
endletter
enddef;
def letterY =
beginletter("Y",13u#,cap_height#,0);
italcorr cap_height#*slant+.45u#;
adjust_fit(cap_serif_fit#,cap_serif_fit#);
adjust_transform;
numeric left_stem,right_stem,outer_jut,dy,alpha;
left_stem=cap_stem-stem_corr;
right_stem=min(cap_hair if hefty:-2stem_corr fi,left_stem);
outer_jut=.75cap_jut; x1l=w-x4r=l+letter_fit+outer_jut+.05u;
x2l=x5l=hround(.5w-.5left_stem); x3r=x5r; y1=y4=h; y2=y3=y5=.4h;
dy=y1-y2; alpha=((x2l-x1l)++dy)/dy;
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
penpos5(left_stem,0); penpos6(left_stem,0); x5=x6; y6=0;
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
if y0>y2+cap_notch_cut: y0:=y2+cap_notch_cut;
fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z5r
--diag_end(5r,6r,1,1,6l,5l)--z5l--diag_end(2l,1l,1,1,1r,2r){z2-z1}
...{down}z0+.5left--cycle; % diagonals and stem
else: fill z0--diag_end(0,4l,1,1,4r,3r)--z5r
--diag_end(5r,6r,1,1,6l,5l)--z5l
--diag_end(2l,1l,1,1,1r,0)--cycle; fi % diagonals and stem
if serifs: numeric inner_jut; pickup tiny.nib;
prime_points_inside(1,2); prime_points_inside(4,3); prime_points_inside(6,5);
if rt x1'r+cap_jut+.5u+1<=lft x4'l-cap_jut: inner_jut=cap_jut;
else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut); % upper left serif
dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark); % upper right serif
dish_serif(6',5,e,1/3,cap_jut,f,1/3,cap_jut); fi % lower serif
math_fit(.5u#-cap_height#*slant,ic#-4u#);
penlabels(0,1,2,3,4,5,6);
endletter
enddef;

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,307 @@
% METAFONT program to draw Oxford University crest.
mode_setup;
def crown(suffix $) =
def spear (suffix i) =
z.i.c = z.i + (0, 2.5u);
z.i.a = z.i + (-0.25u, 0); z.i.e = z.i.a reflectedabout (z.i, z.i.c);
z.i.b = z.i + (-0.6u, u); z.i.d = z.i.b reflectedabout (z.i, z.i.c);
enddef;
def spearpath (suffix i)(expr theta) =
(z.i.a{up}...{left}z.i.b--z.i.c--z.i.d{left}...{down}z.i.e)
rotatedaround (z.i,theta)
enddef;
def axis =
(z1$, z9$)
enddef;
z1$ = (7.5u, 0);
z2$ = (3.5u, u);
z3$ = (0, 7.5u);
z4$ = (1.75u, 6.5u);
z5$ = (2.5u, 5.5u);
z5$.a = (2u, 5.5u);
z6$ = (4.25u, 5.5u); spear(6$);
z7$ = (5.5u, 6u);
z7$.a = (6u, 6.5u);
z8$ = (7u, 7u);
z9$ = (7.5u, 9.5u);
path p;
p = z1${left}..z2${dir 135}..{dir 135}z3$ &
z3${dir 20}..{down}z4$ &
z4${dir 45}..{-dir 45}z5$ &
z5${up}..z5$.a{down}..spearpath(6$,15)..{left}z7$.a..{down}z7$ &
z7${dir 135}..{-dir 135}z8$ &
z8${dir 120}..z9$;
pickup pencircle scaled .01pt;
fill (p -- (reverse p reflectedabout axis) -- cycle);
penpos10$(.5u, -70); z10$l = (3u, 3.5u);
z11$l = z10$l reflectedabout axis;
z11$r = z10$r reflectedabout axis;
unfill z10$l{dir 20}..{dir -20}z11$l--z11$r{dir 160}..{dir 200}z10$r--cycle;
unfill unitsquare shifted (-.5,-.5) rotated -45 xscaled .75u yscaled u
shifted (7.5u, 3u);
path ellipticaljewel;
ellipticaljewel = fullcircle xscaled .75u yscaled u rotated 15
shifted (5.5u, 2.75u);
unfill ellipticaljewel;
unfill ellipticaljewel reflectedabout axis;
path diamondjewel;
diamondjewel = unitsquare shifted (-.5,-.5) rotated -45
xscaled .5u yscaled .75u rotated 20 shifted (4u, 2.4u);
unfill diamondjewel;
unfill diamondjewel reflectedabout axis;
unfill fullcircle xscaled 6u yscaled 1.5u shifted (7.5u, u);
fill fullcircle xscaled 4.5u yscaled u shifted (7.5u, .85u);
enddef;
def shield(suffix $) =
z1$ = (.5w, 0);
def axis = (z1$, z1$ + (0,1)) enddef;
z2$ = (0, 40u);
z3$ = z2$ reflectedabout axis;
pickup pencircle scaled u;
draw z1${dir 160}..{dir 80}z2$---z3${dir -80}..{dir -160}z1$;
enddef;
def book(suffix $) =
z1$ = (12.5u, 0);
roundness := u;
thick := .4u;
thin := .25u;
def axis = (z1$, z1$ + (0,1)) enddef;
z2$ = z1$ + (-2u, 2u);
z3$ = z2$ + 2u*down; z3$a = z3$+roundness*up; z3$b = z3$+roundness*left;
z4$ = (0,0); z4$a = z4$+roundness*right; z4$b = z4$+roundness*up;
z5$ = (0, 13u); z5$a = z5$+roundness*down; z5$b = z5$+roundness*right;
z6$ = (2u, 12u);
path p;
p = z1${left}..z2${up} &
z2${down}..z3$a..z3$b---z4$a..z4$b---z5$a..z5$b..{dir -45}z6$;
pickup pencircle scaled thick;
draw p;
draw (p reflectedabout axis);
z7$ = z1$ + 2u*up;
z8$ = (3u, 3u);
path pageedge;
pageedge = z7${dir 135}..z8${dir 150};
path page;
page = pageedge --- (reverse pageedge shifted (10u*up)) --- cycle;
pickup pencircle scaled thin;
draw page;
draw page reflectedabout axis;
z9$ = z1$ + (-3u, 1.5u);
z10$ = (1.5u, 1.5u);
z11$ = z10$ + 10u*up;
draw z10$--z8$;
draw z11$--(z8$ shifted (10u*up));
draw z10$--(z10$ + .5u*up);
draw (z8$--z10$--z11$--(z8$ shifted (10u*up))) reflectedabout axis;
draw ((z10$+(.5u, .5u))--(z11$+(.5u, .5u))) reflectedabout axis;
draw ((z10$+(u, u))--(z11$+(u, u))) reflectedabout axis;
path pages;
pages=(z9$..(z9$+.8u*up){left}..(z10$+(.8u, .8u)){dir 150}---z10$--- cycle)
shifted (.5thin * down);
fill pages;
fill pages reflectedabout axis;
fill (halfcircle--cycle) xscaled 2u yscaled u shifted z7$;
fill (halfcircle--cycle) rotated 180 xscaled 2u yscaled 1.5u shifted z7$;
def blob(expr z) =
fill fullcircle scaled 1.5u shifted z;
enddef;
def dangle(suffix i) =
draw (z.i + .5u*right)--(z.i + 1.5u*left);
blob (z.i + 1.5u*left)
enddef;
z12$ = z10$ + (0, u); dangle (12$);
blob (z12$ +1.5u*up);
z13$ = z12$ + (0, 3u); dangle (13$);
blob (z13$ +1.5u*up);
z14$ = z13$ + (0, 3u); dangle (14$);
blob (z14$ +1.5u*up);
z15$ = z14$ + (0, 3u); dangle (15$);
lht := 2u;
def letterD ( expr p ) =
pair d.a, d.b;
d.a = p + lht*up;
d.b = p + (5/8lht, 1/2lht);
draw p--d.a{right}..d.b..{left}p;
enddef;
def letterO ( expr p) =
draw fullcircle xscaled 3/4lht yscaled lht shifted (p + (3/8lht,1/2lht));
enddef;
def letterM ( expr p ) =
pair m.a, m.b, m.c, m.d;
m.a = p + lht*up;
m.c = m.a + lht*right;
m.d = p + lht*right;
m.b = .5[p, m.d];
draw p--m.a--m.b--m.c--m.d;
enddef;
def letterI ( expr p ) =
draw p--(p+lht*up);
enddef;
def letterN ( expr p ) =
pair m.a, m.b, m.c;
m.a = p + lht*up;
m.b = p + 3/4lht*right;
m.c = m.b + lht*up;
draw p--m.a--m.b--m.c;
enddef;
def letterU ( expr p ) =
pair u.a, u.b, u.c;
u.a = p + lht*up;
u.c = u.a + 3/4lht*right;
u.b = p + 3/8lht*right;
draw u.a--u.b--u.c;
enddef;
def letterS ( expr p ) =
pair s.a, s.b, s.c, s.d, s.e, s.f, s.g;
s.a = p + 1/4lht*up;
ypart s.b = ypart p; xpart s.b = .5[xpart s.a, xpart s.d];
ypart s.c = ypart p + lht; xpart s.c = xpart s.b;
s.d = p + 3/4lht*up + 3/4lht*right;
xpart s.f = xpart s.a; ypart s.f = ypart s.d;
s.e = .5[s.b, s.c];
s.g = s.f rotatedabout(s.e,180);
draw s.a..{right}s.b..s.g..{dir 160}s.e..s.f..{right}s.c..s.d;
enddef;
def letterL ( expr p ) =
pair l.a, l.b;
l.a = p + lht*up;
l.b = p + 5/8lht*right;
draw l.a--p--l.b;
enddef;
def letterA ( expr p ) =
pair a.b, a.c;
a.c = p + 7/8lht*right;
xpart a.b = .5[xpart p, xpart a.c]; ypart a.b = ypart p + lht;
draw p--a.b--a.c;
draw .4[p,a.b]--.4[a.c,a.b];
enddef;
def letterT ( expr p ) =
pair t.a, t.b, t.c;
t.a = p + lht*up;
t.b = t.a + 3/4lht*right;
t.c = p + 3/8lht*right;
draw t.a--t.b;
draw (.5[t.a,t.b])--t.c;
enddef;
def letterE ( expr p ) =
pair e.a, e.b, e.c, e.d;
e.a = p + lht*up;
e.b = e.a+3/4lht*right;
e.d = p +3/4lht*right;
e.c = .5[p,e.a] + 1/2lht*right;
draw e.b--e.a--p--e.d;
draw .5[p,e.a]--e.c;
enddef;
z16$ = (4.5u, 9.5u);
letterD ( z16$ );
letterO ( z16$ + 7/8lht*right);
letterM ( z16$ + 15/8lht*right);
letterI ( z16$ + 26/8lht*right);
z17$ = z16$ + 1.4lht*down+1/4lht*left;
letterN ( z17$ + 1/2lht*right);
letterU ( z17$ + 3/2lht*right);
letterS ( z17$ + 21/8lht*right);
z18$ = z16$ + 2.8lht*down;
letterI ( z18$ + 1/4lht*right);
letterL ( z18$ + 5/8lht*right);
letterL ( z18$ + 12/8lht*right);
letterU ( z18$ + 19/8lht*right);
z19$ = z16$ + 9.5u*right;
letterM ( z19$ - 1/8lht*right);
letterI ( z19$ + 10/8lht*right);
letterN ( z19$ + 13/8lht*right);
letterA ( z19$ + 21/8lht*right);
z20$ = z19$ + 1.4lht*down + 1/4lht*right;
letterT ( z20$ + 1/4lht*right);
letterI ( z20$ + 11/8lht*right);
letterO ( z20$ + 14/8lht*right);
z21$ = z19$ + 2.8lht*down;
letterM ( z21$);
letterE ( z21$ + 11/8lht*right);
letterA ( z21$ + 19/8lht*right);
enddef;
beginchar(1, 35pt#, 40pt#, 0); "Crown";
u := pt;
transform tfm;
tfm := currenttransform;
currenttransform := tfm shifted (round 2u, round 29u);
crown(a);
currenttransform := tfm shifted (round 18u, round 29u);
crown(b);
currenttransform := tfm shifted (round 10u, round 4u);
crown(c);
currenttransform := tfm shifted (5u, 15u);
book(d);
currenttransform := tfm;
shield(e);
endchar;
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.