diff options
Diffstat (limited to 'fonts/malvern/source/maglcaps.mf')
-rw-r--r-- | fonts/malvern/source/maglcaps.mf | 293 |
1 files changed, 293 insertions, 0 deletions
diff --git a/fonts/malvern/source/maglcaps.mf b/fonts/malvern/source/maglcaps.mf new file mode 100644 index 0000000000..5e403264a0 --- /dev/null +++ b/fonts/malvern/source/maglcaps.mf @@ -0,0 +1,293 @@ +% maglcaps.mf 1.2.0 94/10/11 -- caps common to Greek and Latin +% Copyright 1992-4 P. Damian Cugley. + +%%% @METAFONT-file { +%%% filename = "maglcaps.mf", +%%% version = "1.2.0", +%%% date = "1994/10/11", +%%% package = "Malvern 1.2", +%%% author = "P. Damian Cugley", +%%% email = "damian.cugley@comlab.ox.ac.uk", +%%% address = "Oxford University Computing Laboratory, +%%% Parks Road, Oxford OX1 3QD, UK", +%%% codetable = "USASCII", +%%% keywords = "Malvern, METAFONT, font, typefont, TeX", +%%% supported = "Maybe", +%%% abstract = "Greek/Latin cap. character programs for the Malvern +%%% font family.", +%%% dependencies = "other program files", +%%% } + +% See the Malvern Handbook (maman.tex) for more info about Malvern. +% This software is available freely but without warranty. +% See the file COPYING for details. + +%{{{ maglcaps.mf + +set_cap_widths; + +if capmode = 1: + vardef subst@# suffix $ = + if unknown code.cap$: code.cap$ := code.gr.cap@#; fi + enddef; + + subst alpha (a); + subst beta (b); + subst chi (x); + subst epsilon (e); + subst eta (h); + subst iota (i); + subst kappa (k); + subst mu (m); + subst nu (n); + subst omicron (o); + subst rho (p); + subst tau (t); + subst zeta (z); +fi + +if testing: endinput fi + +%{{{ N + +iff known capcode.n: "Capital Nu"; +ma_cap(capcode.n, medium_wd# + 2pn_adj#)(1,1); + box_points; set_ic_tr; + y1 = y.t + o - (x.r - x.l); + if y1 < y.b: y1 := y.b; fi + draw_box_l_o; draw_box_r_o; + draw (x.l, y.t + o) -- (x.r, y1); +if not no_co: +remember; + some_cap_marks(0.5[l,r]) N; +fi +endchar; + +%}}} +%{{{ H + +iff known capcode.h: "Capital Eta"; +ma_cap(capcode.h, medium_wd# + 2pn_adj#)(1,1); + box_points; draw_box_l_o; draw_box_r_o; draw_box_m; set_ic_tr; +if not no_co: +remember; + some_cap_marks(0.5[l,r]) H; +fi +endchar; + +%}}} +%{{{ Z + +iff known capcode.z: "Capital Zeta"; +ma_cap(capcode.z, medium_wd# + 2pn_adj#)(1/2,1/2); + box_points; set_ic_tr; + draw (good.x 1/24[x.l, x.r], y.t) + -- (good.x 1/24[x.r, x.l], y.t) -- (x.l, y.b) -- (x.r, y.b); +if not no_co: +remember; + some_cap_marks(0.5[l,r]) Z; +similarly(code.co.Z.dot); "Cap. Z with dot above"; + charht := mark_t#; + draw_dot_mark.dot(0.5[l,r], mark_b, dot_wd, mark_ht); +wug; +fi +endchar; + +%}}} +%{{{ E + +iff known capcode.e: "Capital Epsilon"; +ma_cap(capcode.e, narrow_wd# + pn_adj#)(1, 1/2); + rt x1 = rt x4 = r; lft x2 = lft x3 = lft x1bar = l; + top y1 = top y2 = h; bot y3 = bot y4 = 0; + y1bar = y2bar = 0.52h; x2bar = 4/5[l,r]; + draw z1 -- z2 -- z3 -- z4; + draw z1bar -- z2bar; + labels(1,2,3,4, 1bar, 2bar); + set_ic_tr; +remember; +some_cap_marks(0.475[l,r]) E; +endchar; + +%}}} +%{{{ A + +iff known capcode.a: "Capital Alpha"; +ma_cap(capcode.a, wide_wd# + 3pn_adj#)(1/3,1/3); + A_body(true, false); +remember; +if not no_co: + some_cap_marks(0.5[l,r]) A; +similarly(code.cap.a.ring); "Cap. A with ring"; + if cap_mark_t - h > 4v: + draw_clear_ring.ring(1/2[l,r], 1/2[h, cap_mark_t] - 3/2v - eps, 3u, 3v); + elseif cap_mark_t - h > 3.5v: + draw_clear_ring.ring(1/2[l,r], h + 1/2v, 3u, 3v); + else: + draw_joined_ring.ring(1/2[l,r], h, 3u, min(3v, cap_mark_t - h + pn.ht - o)); + fi + charht := cap_mark_t#; +wug; +fi +endchar; + +%}}} +%{{{ T + +iff known capcode.t: "Capital Tau"; +ma_cap(capcode.t,medium_wd# + 2pn_adj#)(0,0); + if 1/2w <> good.x 1/2w: change_width; fi + lft x1 = w - rt x2 = l - eps; x3 = x4 = 1/2[x1,x2]; + top y1 = top y2 = top y3 = h; bot y4 = -d - o; + draw z1 -- z2; draw z3 -- z4; + labels(1,2,3,4); set_ic_tr; +remember; +if not no_co: + some_cap_marks(0.5[l,r]) T; +fi +similarly(code.cap.t.cedilla); "cap T with cedilla"; + chardp := Cedilla_ht#; charht := cap_ht#; + draw_cedilla.cedilla(1/2[l,r], 0, Cedilla_wd, Cedilla_ht); +wug; +endchar; + +%}}} +%{{{ O + +iff known capcode.o: "Captial Omicron (O)"; +ma_char(capcode.o, O_wd#, height#, 0v#)(O_sp, O_sp); + draw_O; set_ic_O; +if not no_co: +remember; + some_cap_marks(0.5[l,r]) O; +fi +endchar; + +%}}} +%{{{ I + +iff known capcode.i: "Capital Iota (I)"; +ma_char(capcode.i, pn.wd#, height#, 0pt#)(1,1); + if 1/2w <> good.x (1/2w): change_width; fi + draw (1/2w, bot h + o) -- (1/2w, top -d - o); set_ic_tr; +endchar; + +if not no_co: +%{{{ composite letters based on I + +def do_marked_I(expr code, mark_width_sharp)(text MARK_PROC) text CODA = + iff known code: + ma_char(code, max(pn.wd#, mark_width_sharp - sp#), mark_t#, 0v#)(1,1); + if good.x (1/2[l,r]) <> 1/2[l,r]: change_width; fi + draw (1/2[l,r], bot (vround height#*vppp)) -- (1/2[l,r], top (0 - o)); + MARK_PROC(1/2[l,r], mark_b, + mark_width_sharp * hppp, mark_ht) CODA; + set_ic_tr; + endchar; +enddef; + +do_marked_I(code.cap.i.acute, max(2pn.wd#, (mark_t# - mark_b#)*hratio)) + (draw_acute_grave) false; +do_marked_I(code.cap.i.grave, max(2pn.wd#, (mark_t# - mark_b#)*hratio)) + (draw_acute_grave) true; +do_marked_I(code.cap.i.twodots, 2dot_wd# + sp#) + (draw_twodots); +do_marked_I(code.cap.i.circumflex, + max(3pn.wd#, (mark_t# - mark_b#)*hratio - pn.wd#)) + (draw_circumflex) false; +do_marked_I(code.cap.i.breve, + max(3pn.wd#, (mark_t# - mark_b#)*hratio - pn.wd#)) + (draw_breve); +do_marked_I(code.cap.i.dot, dot_wd#)(draw_dot_mark); + +%}}} composite letters based on I +fi + +%}}} + +if co_only: endinput; fi + +%{{{ B, P + +iff known capcode.b: "Capital Beta"; +ma_cap(capcode.b,max(2pn_wd# + 3u#, narrow_wd# + pn_adj#))(1,0.6); + numeric mid; mid = good.y (0.55[-d, h]); + D_stem; + D_bowl.top(h, bot mid, hround 0.9[l,r]); + D_bowl.bot(top mid, -d, r); + set_ic 0.9h#; charic := max(0, charic - 0.1(r# - l#)); +endchar; + +iff known capcode.p: "Capital Rho"; +ma_cap(capcode.p, max(2pn_wd# + 3u#, narrow_wd# + pn_adj#))(1,1/2); + P_stem; D_bowl.bowl(h, hround bot 0.45[-d, h], r); set_ic 0.9h#; +endchar; + +%}}} +%{{{ K + +iff known capcode.k: "Capital Kappa"; +ma_cap(capcode.k, medium_wd# + pn_adj#)(1,1/2); + box_points; + z1top = (1/18[x.r, x.l],y.t + o); + z2top = z1top + whatever*(hratio, 1); x2top = x.l; + z1bot = (x.r, y.b - o); + z2bot = whatever[z1top, z2top] = z1bot + whatever*(-hratio, 1); + draw_box_l_o; draw z1top -- z2top; draw z1bot -- z2bot; + labels(1top, 2top, 1bot, 2bot); set_ic_tr; +endchar; +%}}} +%{{{ M + +if known capcode.m: + +def do_variant_M(expr code) = + ma_cap(code, wide_wd# + 3pn_adj#)(1,1); + if 1/2w <> hround 1/2w: change_width; fi + box_points; + z1 = (x.l, y.t + o); z3 = (x.r, y.t + o); + x2 = 1/2[x1, x3]; y2 = 1/2[-d, h]; + draw z1 -- z2 -- z3; draw_box_l_o; draw_box_r_o; + labels(1,2,3); set_ic_tr; + endchar +enddef; + +def do_M(expr code) = + ma_char(code, width# + 2pn_adj#, height#, 0pt#)(3/4,3/4); + if 1/2w <> apex.x 1/2w: change_width; fi + lft x1 = w - rt x5 = l; bot y1 = bot y5 = -d -o; + top y2 = top y4 = h; + x3 = 1/2[l, r]; y3 = 0.1[y1, y2]; + x2 = w - x4 = x1 + floor(1/18(r - l)); + draw z1 -- apex_path2 -- vpex_path3 -- apex_path4 -- z5; + labels(1,2,3,4,5); set_ic_tr; + endchar +enddef; + +if (width# < 7.5pt#): + do_variant_M(capcode.m); + if known code.cap.m1: "variant cap. M"; + do_M(code.cap.m1); + fi +else: + do_M(capcode.m); + if known code.cap.m1: "variant cap. M"; + do_variant_M(code.cap.m1); + fi +fi + +fi + +%}}} M +%{{{ X +iff known capcode.x: "Capital Chi"; +ma_cap(capcode.x, medium_wd# + 2pn_adj#)(1/2,1/2); + draw_X 1/16; set_ic_tr; +endchar; +%}}} X + +%}}} maglcaps.mf + +% Local variables: +% fold-folded-p: t +% End: |