| 1 |
%% This file is public domain. |
| 2 |
%% Originally written 1998, Ivan A Derzhanski. |
| 3 |
%% Notice added by Clea F. Rees 2009/01/06. |
| 4 |
%% |
| 5 |
% eira.mf: Irish diacritics and macros |
| 6 |
|
| 7 |
ailm_fada := oct"033"; Ailm_fada := oct"003"; |
| 8 |
eabhadh_fada := oct"034"; Eabhadh_fada := oct"004"; |
| 9 |
iodha_fada := oct"035"; Iodha_fada := oct"005"; |
| 10 |
oir_fada := oct"036"; Oir_fada := oct"006"; |
| 11 |
uwr_fada := oct"037"; Uwr_fada := oct"007"; |
| 12 |
|
| 13 |
def fada(suffix $) = |
| 14 |
x.fad1-x.fad2=3u; .5[x.fad1,x.fad2]=x$; |
| 15 |
if serifs: pickup crisp.nib; |
| 16 |
y.fad1+.5stem=h+eps; |
| 17 |
y.fad2=max(2/3[h,x_height],x_height+o+hair,y$+o+.5tiny); |
| 18 |
numeric theta; theta=angle(z.fad2-z.fad1)+90; |
| 19 |
pos.fad1(stem,theta); pos.fad2(hair,theta); |
| 20 |
filldraw circ_stroke z.fad1e--z.fad2e; % diagonal |
| 21 |
else: pickup fine.nib; pos.fad1(stem,0); pos.fad2(vair,0); |
| 22 |
top y.fad1=h; bot y.fad2=max(vround 2/3[h,x_height],y$r+o+.5tiny); |
| 23 |
filldraw stroke z.fad1e--z.fad2e; fi % diagonal |
| 24 |
penlabels(fad1,fad2); enddef; |
| 25 |
|
| 26 |
dot_diam# := max(dot_size#,cap_curve#); |
| 27 |
beith_h := oct"166"; Beith_h := oct"126"; |
| 28 |
coll_h := oct"153"; Coll_h := oct"113"; |
| 29 |
dair_h := oct"152"; Dair_h := oct"112"; |
| 30 |
fearn_h := oct"161"; Fearn_h := oct"121"; |
| 31 |
gort_h := oct"171"; Gort_h := oct"131"; |
| 32 |
muin_h := oct"167"; Muin_h := oct"127"; |
| 33 |
peith_bhog_h := oct"040"; Peith_Bhog_h := oct"000"; |
| 34 |
sail_h := oct"172"; Sail_h := oct"132"; |
| 35 |
teine_h := oct"170"; Teine_h := oct"130"; |
| 36 |
agus_lig := oct"031"; |
| 37 |
|
| 38 |
def gen_ponc (expr meawn) = |
| 39 |
pickup tiny.nib; pos.ponc1(dot_diam,0); pos.ponc2(dot_diam,90); |
| 40 |
x.ponc1=x.ponc2=meawn; |
| 41 |
top y.ponc2r=h+1; |
| 42 |
if bot y.ponc2l<x_height+o+slab: |
| 43 |
y.ponc2l:=min(y.ponc2r-eps,x_height+o+slab+.5tiny); fi |
| 44 |
y.ponc1=.5[y.ponc2l,y.ponc2r]; dot(ponc1,ponc2); % dot |
| 45 |
penlabels(ponc1,ponc2); enddef; |
| 46 |
|
| 47 |
cmchar "Dot accent"; |
| 48 |
numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#); |
| 49 |
beginchar(oct"032",5u#,min(old_asc_height#,10/7x_height#+.5dot_diam#),0); |
| 50 |
define_whole_blacker_pixels(dot_diam); |
| 51 |
italcorr h#*slant+.5dot_diam#-2u#; |
| 52 |
adjust_fit(0,0); gen_ponc (.5w); endchar; |
| 53 |
|
| 54 |
def aspirate(suffix $) = gen_ponc (x$); enddef; |
| 55 |
|
| 56 |
def trasnawn(suffix $,@)(expr jut) = |
| 57 |
pickup crisp.nib; pos@1(hround(hair-stem_corr),0); pos@2(bar,90); |
| 58 |
lft x@0=lft x@1l=tiny.lft x$l; top y@1=tiny.top y$r; |
| 59 |
lft x@2=lft x@0-jut; y@2r=y@1-serif_drop; |
| 60 |
y@0=y@2l-bracket-eps; |
| 61 |
if serif_drop>0: erase fill z@1--top z@1 |
| 62 |
--(x@2r,top y@1)--z@2r--cycle; fi % erase excess at top |
| 63 |
filldraw z@1l{down}...{left}z@2r--z@2l{right} |
| 64 |
...1/3[(x@0,y@2l),.5[z@2l,z@0] ]{z@0-z@2l} |
| 65 |
...{down}z@0--(x@1,y@0)--cycle; % sloped serif |
| 66 |
z@3=(tiny.rt x$r,y@2); |
| 67 |
erase fill top z@1r{right}...(x@3,y@2){down}--(x@3,top y@1r)--cycle; |
| 68 |
labels(@0,@1,@2,@3); enddef; |
| 69 |
|
| 70 |
def guta_beag (expr ainm, achar) (suffix $) = |
| 71 |
scantokens("cmchar") ainm; |
| 72 |
beginchar (substring (0,1) of ainm, achar, x_height#, 0); |
| 73 |
gen_letter; |
| 74 |
endchar; |
| 75 |
scantokens("cmchar") (ainm & " fada"); |
| 76 |
beginchar (scantokens (ainm & "_fada"), |
| 77 |
achar, min(old_asc_height#,2x_height#), 0); |
| 78 |
gen_letter; fada ($); |
| 79 |
endchar; |
| 80 |
enddef; |
| 81 |
|
| 82 |
def guta_mowr (expr ainm, achar) (suffix $) = |
| 83 |
scantokens("cmchar") ainm; |
| 84 |
beginchar (substring (0,1) of ainm, achar, cap_height#, 0); |
| 85 |
gen_letter; |
| 86 |
endchar; |
| 87 |
scantokens("cmchar") (ainm & " fada"); |
| 88 |
beginchar (scantokens (ainm & "_fada")-guta_offset, |
| 89 |
achar, cap_asc_height#, 0); |
| 90 |
gen_letter; fada ($); |
| 91 |
endchar; |
| 92 |
enddef; |
| 93 |
|
| 94 |
def consan_beag (expr ainm, achar, doimh) (suffix $) = |
| 95 |
scantokens("cmchar") ainm; |
| 96 |
beginchar (substring (0,1) of ainm, achar, x_height#, doimh); |
| 97 |
gen_letter; |
| 98 |
endchar; |
| 99 |
scantokens("cmchar") (ainm & " haitch"); |
| 100 |
beginchar (scantokens (ainm & "_h"), achar, |
| 101 |
min(old_asc_height#,10/7x_height#+.5dot_diam#), doimh); |
| 102 |
gen_letter; aspirate ($); |
| 103 |
endchar; |
| 104 |
enddef; |
| 105 |
|
| 106 |
def consan_mowr (expr ainm, achar, doimh) (suffix $) = |
| 107 |
scantokens("cmchar") ainm; |
| 108 |
beginchar (substring (0,1) of ainm, achar, cap_height#, doimh); |
| 109 |
gen_letter; |
| 110 |
endchar; |
| 111 |
scantokens("cmchar") (ainm & " haitch"); |
| 112 |
beginchar (scantokens (ainm & "_h"), achar, cap_asc_height#, doimh); |
| 113 |
gen_letter; aspirate ($); |
| 114 |
endchar; |
| 115 |
enddef; |
| 116 |
|
| 117 |
cmchar "agus"; |
| 118 |
beginchar(agus_lig,8u#,x_height#,desc_depth#); |
| 119 |
italcorr x_height#*slant; |
| 120 |
adjust_fit(0,0); |
| 121 |
numeric arm_thickness, bot_width, top_shift, top_hair; |
| 122 |
if hefty: arm_thickness=Vround(slab+2stem_corr); top_shift=0; |
| 123 |
bot_width=hround .51[curve,cap_curve]; top_hair=.4[thin_join,bot_width]; |
| 124 |
else: arm_thickness=Vround .4[stem,cap_stem]; top_shift=.5u; |
| 125 |
bot_width=flare; top_hair=cap_hair; fi |
| 126 |
if top_hair<tiny.breadth: top_hair:=tiny.breadth; fi |
| 127 |
pickup crisp.nib; |
| 128 |
if arm_thickness<=2currentbreadth: arm_thickness:=2currentbreadth+eps; fi |
| 129 |
pos2(.5arm_thickness,90); pos1(arm_thickness,70); |
| 130 |
top y1r=top y2r=h; rt x2=hround(w-.75u+top_shift); |
| 131 |
lft x1r=hround(.75u+.5top_shift); |
| 132 |
filldraw stroke z1e{x2l-x1r,2(y2l-y1r)} .. z2e; |
| 133 |
penpos2'(2epsilon,-90); z2'=z2r; |
| 134 |
pickup tiny.nib; pos4(top_hair,0); |
| 135 |
bot y4=max(h-arm_thickness,h-slab,bot y2l); rt x4r=crisp.rt x2; |
| 136 |
pos5(top_hair,0); y5=-d; lft x5l=hround(5.5u+top_shift-.5top_hair); |
| 137 |
if hefty: erase fill rt z4r--z4r...{down}z5r |
| 138 |
--(rt x4r,y5)--cycle; % erase excess at top |
| 139 |
filldraw stroke z4e...{down}z5e; % stroke |
| 140 |
else: |
| 141 |
erase fill rt z4r--z4r--z5r--(rt x4r,y5)--cycle; % erase excess at top |
| 142 |
filldraw stroke z4e---z5e; fi % stroke |
| 143 |
penlabels(1,2,4,5); endchar; |
| 144 |
|