diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/semaphor/metafont/semaf.mf |
Initial commit
Diffstat (limited to 'fonts/semaphor/metafont/semaf.mf')
-rw-r--r-- | fonts/semaphor/metafont/semaf.mf | 691 |
1 files changed, 691 insertions, 0 deletions
diff --git a/fonts/semaphor/metafont/semaf.mf b/fonts/semaphor/metafont/semaf.mf new file mode 100644 index 0000000000..874e98d7cf --- /dev/null +++ b/fonts/semaphor/metafont/semaf.mf @@ -0,0 +1,691 @@ +%% SEMAPHORE ALPHABET FONT, METAFONT driver file "semaf.mf" +%% +%% Font znaku semaforove abecedy, ridici soubor pro METAFONT. +%% +%% Copyright (C) 1998 Vit ZYKA, zyka@cmp.felk.cvut.cz +%% +%% This program 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. +%% +%% This program 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 program; if not, see web page +%% http://www.gnu.org/copyleft/fdl.html or write to the Free Software +%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +%% +% ----------------------------------------------------------------------- CODE +L#:=4.75u#; % left width +C#:=1u#; % center width +R#:=4.75u#; % right width +H#:=10u#; % character height +HC#:=H#/2; % center height +%% |width#|, |height#|, |WC#|, |HC#| (center width, height) +%% is evaluated in macro |beginchar| +define_pixels(u,C); + +% ----------------------------------------------------------------------- BASE +def base_empty= + pickup pencircle scaled (series*1*u); + drawdot origin slanted slant; +enddef; + +def base_pillar= + pickup pencircle scaled (series*1*u); + drawdot origin slanted slant; + pickup pencircle scaled (series*.2*u); + draw (origin--(0,-HC)) slanted slant; + draw ((-C,-HC)--(C,-HC)) slanted slant; +enddef; + +def base_person= + pickup pencircle scaled (series*1.2*u); + drawdot (0,.4*HC) slanted slant; + pickup pencircle scaled (series*.2*u); + draw ((0,.4*HC)--(0,-.2*HC)) slanted slant; + draw ((-.7C,-HC)--(0,-.2*HC)--(.7C,-HC)) slanted slant; +enddef; + +% ---------------------------------------------------------------------- FLAG +r:=if proportional: 4.5u else: 4.3u fi; % flag radius +a:=1.5u; % flag width +b:=1.8u; % flag height +def flag= + pickup pencircle scaled (series*.5*u); + draw (origin--(r,0)) withweight 2; + pickup pencircle scaled (series*.3*u); + unfill ((r,0)--(r-a,0)--(r-a,b)--cycle); + draw ((r-a,0)--(r-a,b)--(r,b)--(r,0)); + fill ((r,0)--(r-a,b)--(r,b)--cycle); +enddef; +def flagL(expr angel)= + begingroup; + save currenttransform; transform currenttransform; + currenttransform:= identity rotated angel slanted slant; + flag; + endgroup; +enddef; +def flagR(expr angel)= + begingroup; + save currenttransform; transform currenttransform; + currenttransform:= identity reflectedabout ((0,0),(1,0)) + rotated angel slanted slant; + flag; + endgroup; +enddef; + +uu:=0.95; % upper portion of |L#| (|R#|) +bb:=0.8; % botton +dd:=0.55; % character d + +def charA= + if SL#<(uu*L#): SL#:= bb*L# fi; + flagL(-135); +enddef; + +def charB= + SL#:= L#; + flagL(180); +enddef; + +def charC= + if SL#<L#: SL#:= uu*L# fi; + SH#:= H#; + flagL(135); +enddef; + +def charD= + if SL#<(bb*L#): SL#:= dd*L#; fi; + charic:= slant*HC#; + SH#:= H#; + flagL(90); +enddef; + +def charE= + if SR#<R#: SR#:= uu*R# fi; + SH#:= H#; + if charic=0: charic:=.5*slant*HC# fi; + flagR(45); +enddef; + +def charF= + SR#:= R#; + flagR(0); +enddef; + +def charG= + if SR#<(uu*R#): SR#:= bb*R# fi; + flagR(-45); +enddef; + +def sipka(expr length, direct, point)= + begingroup + save x,y; + z1=origin; x2=x3=-length; -y2=y3=3/7length; + draw (z2..{dir 5}z1) rotated direct shifted point slanted slant; + draw (z3..{dir -5}z1) rotated direct shifted point slanted slant; + endgroup +enddef; + +% ------------------------------------ extensions tokens into begin and end char +extra_beginchar:= + "SL#:= 0.75u#; SR#:= 0.75u#; SH#:= HC#+(C#/2);"; +extra_endchar:= + "if proportional:" & + "WC#:= (C#/2)+SL#;" & + "charwd:= SL#+C#+SR#; charht:= SH#; chardp:= 0u#;" & + "else:" & + "charwd:= L#+(C#/2)+R#; WC#:= charwd/2; charht:= SH#; chardp:= 0u#;" & + "fi;" & + "w:=hround(charwd*hppp); h:=vround(charht*hppp); d:= vround(chardp*hppp);" & + "define_pixels( WC, HC);" & + "scantokens center;" & + "currentpicture:= currentpicture shifted (WC,HC);"; + +% ------------------------------------------------------------ lowercase letter +beginchar("a", 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar("b", 0pt, 0pt, 0pt); + charB; +endchar; + +beginchar("c", 0pt, 0pt, 0pt); + charC; +endchar; + +beginchar("d", 0pt, 0pt, 0pt); + charD; +endchar; + +beginchar("e", 0pt, 0pt, 0pt); + charE; +endchar; + +beginchar("f", 0pt, 0pt, 0pt); + charF; +endchar; + +beginchar("g", 0pt, 0pt, 0pt); + charG; +endchar; + +beginchar("h", 0pt, 0pt, 0pt); + charA; charB; +endchar; + +beginchar("i", 0pt, 0pt, 0pt); + charA; charC; +endchar; + +beginchar("k", 0pt, 0pt, 0pt); + charA; charD; +endchar; + +beginchar("l", 0pt, 0pt, 0pt); + charA; charE; +endchar; + +beginchar("m", 0pt, 0pt, 0pt); + charA; charF; +endchar; + +beginchar("n", 0pt, 0pt, 0pt); + charA; charG; +endchar; + +beginchar("o", 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar("p", 0pt, 0pt, 0pt); + charB; charD; +endchar; + +beginchar("q", 0pt, 0pt, 0pt); + charB; charE; +endchar; + +beginchar("r", 0pt, 0pt, 0pt); + charB; charF; +endchar; + +beginchar("s", 0pt, 0pt, 0pt); + charB; charG; +endchar; + +beginchar("t", 0pt, 0pt, 0pt); + charC; charD; +endchar; + +beginchar("u", 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar("y", 0pt, 0pt, 0pt); + charC; charF; +endchar; + +beginchar("j", 0pt, 0pt, 0pt); + charD; charF; +endchar; + +beginchar("v", 0pt, 0pt, 0pt); + charD; charG; +endchar; + +beginchar("w", 0pt, 0pt, 0pt); + charE; charF; +endchar; + +beginchar("x", 0pt, 0pt, 0pt); + charE; charG; +endchar; + +beginchar("z", 0pt, 0pt, 0pt); + charF; charG; +endchar; + +% -------------------------------------------------------------- capital letter +beginchar("A", 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar("B", 0pt, 0pt, 0pt); + charB; +endchar; + +beginchar("C", 0pt, 0pt, 0pt); + charC; +endchar; + +beginchar("D", 0pt, 0pt, 0pt); + charD; +endchar; + +beginchar("E", 0pt, 0pt, 0pt); + charE; +endchar; + +beginchar("F", 0pt, 0pt, 0pt); + charF; +endchar; + +beginchar("G", 0pt, 0pt, 0pt); + charG; +endchar; + +beginchar("H", 0pt, 0pt, 0pt); + charA; charB; +endchar; + +beginchar("I", 0pt, 0pt, 0pt); + charA; charC; +endchar; + +beginchar("K", 0pt, 0pt, 0pt); + charA; charD; +endchar; + +beginchar("L", 0pt, 0pt, 0pt); + charA; charE; +endchar; + +beginchar("M", 0pt, 0pt, 0pt); + charA; charF; +endchar; + +beginchar("N", 0pt, 0pt, 0pt); + charA; charG; +endchar; + +beginchar("O", 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar("P", 0pt, 0pt, 0pt); + charB; charD; +endchar; + +beginchar("Q", 0pt, 0pt, 0pt); + charB; charE; +endchar; + +beginchar("R", 0pt, 0pt, 0pt); + charB; charF; +endchar; + +beginchar("S", 0pt, 0pt, 0pt); + charB; charG; +endchar; + +beginchar("T", 0pt, 0pt, 0pt); + charC; charD; +endchar; + +beginchar("U", 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar("Y", 0pt, 0pt, 0pt); + charC; charF; +endchar; + +beginchar("J", 0pt, 0pt, 0pt); + charD; charF; +endchar; + +beginchar("V", 0pt, 0pt, 0pt); + charD; charG; +endchar; + +beginchar("W", 0pt, 0pt, 0pt); + charE; charF; +endchar; + +beginchar("X", 0pt, 0pt, 0pt); + charE; charG; +endchar; + +beginchar("Z", 0pt, 0pt, 0pt); + charF; charG; +endchar; + +% --------------------------------------------------- accented letters (in IL2) +beginchar(152, 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar(165, 0pt, 0pt, 0pt); + charA; charE; +endchar; + +beginchar(169, 0pt, 0pt, 0pt); + charB; charG; +endchar; + +beginchar(171, 0pt, 0pt, 0pt); + charC; charD; +endchar; + +beginchar(174, 0pt, 0pt, 0pt); + charF; charG; +endchar; + +beginchar(181, 0pt, 0pt, 0pt); + charA; charE; +endchar; + +beginchar(184, 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar(185, 0pt, 0pt, 0pt); + charB; charG; +endchar; + +beginchar(187, 0pt, 0pt, 0pt); + charC; charD; +endchar; + +beginchar(190, 0pt, 0pt, 0pt); + charF; charG; +endchar; + +beginchar(192, 0pt, 0pt, 0pt); + charB; charF; +endchar; + +beginchar(193, 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar(196, 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar(197, 0pt, 0pt, 0pt); + charA; charE; +endchar; + +beginchar(200, 0pt, 0pt, 0pt); + charC; +endchar; + +beginchar(201, 0pt, 0pt, 0pt); + charE; +endchar; + +beginchar(204, 0pt, 0pt, 0pt); + charE; +endchar; + +beginchar(205, 0pt, 0pt, 0pt); + charA; charC; +endchar; + +beginchar(207, 0pt, 0pt, 0pt); + charD; +endchar; + +beginchar(210, 0pt, 0pt, 0pt); + charA; charG; +endchar; + +beginchar(211, 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar(212, 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar(214, 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar(216, 0pt, 0pt, 0pt); + charB; charF; +endchar; + +beginchar(217, 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar(218, 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar(220, 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar(221, 0pt, 0pt, 0pt); + charC; charF; +endchar; + +beginchar(224, 0pt, 0pt, 0pt); + charB; charF; +endchar; + +beginchar(225, 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar(228, 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar(229, 0pt, 0pt, 0pt); + charA; charE; +endchar; + +beginchar(232, 0pt, 0pt, 0pt); + charC; +endchar; + +beginchar(233, 0pt, 0pt, 0pt); + charE; +endchar; + +beginchar(236, 0pt, 0pt, 0pt); + charE; +endchar; + +beginchar(237, 0pt, 0pt, 0pt); + charA; charC; +endchar; + +beginchar(239, 0pt, 0pt, 0pt); + charD; +endchar; + +beginchar(242, 0pt, 0pt, 0pt); + charA; charG; +endchar; + +beginchar(243, 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar(244, 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar(246, 0pt, 0pt, 0pt); + charB; charC; +endchar; + +beginchar(248, 0pt, 0pt, 0pt); + charB; charF; +endchar; + +beginchar(249, 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar(250, 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar(252, 0pt, 0pt, 0pt); + charC; charE; +endchar; + +beginchar(253, 0pt, 0pt, 0pt); + charC; charF; +endchar; + +% --------------------------------------------------------------------- digits +beginchar("1", 0pt, 0pt, 0pt); + charA; +endchar; + +beginchar("2", 0pt, 0pt, 0pt); + charB; +endchar; + +beginchar("3", 0pt, 0pt, 0pt); + charC; +endchar; + +beginchar("4", 0pt, 0pt, 0pt); + charD; +endchar; + +beginchar("5", 0pt, 0pt, 0pt); + charE; +endchar; + +beginchar("6", 0pt, 0pt, 0pt); + charF; +endchar; + +beginchar("7", 0pt, 0pt, 0pt); + charG; +endchar; + +beginchar("8", 0pt, 0pt, 0pt); + charA; charB; +endchar; + +beginchar("9", 0pt, 0pt, 0pt); + charA; charC; +endchar; + +beginchar("0", 0pt, 0pt, 0pt); + charA; charD; +endchar; + +% ---------------------------------------------------------- special characters +beginchar(" ", L#+C#+R#, 0pt, 0pt); % space +endchar; + +beginchar("*", 0pt, 0pt, 0pt); % all flag positions (asterisk) + charA; charB; charC; charD; charE; charF; charG; +endchar; + +beginchar(".", 0pt, 0pt, 0pt); % separator (period) + begingroup; + save currenttransform; transform currenttransform; + currenttransform:= identity rotated -90 slanted slant; + flag; + currenttransform:= identity reflectedabout ((0,0),(1,0)) + rotated -90 slanted slant; + flag; + endgroup; + SL#:= L#; SR#:= R#; + k:= (r-a)++b; + pickup pencircle scaled (series*.2*u); + z1=(0,-k) rotated -50; z2=(0,-k) rotated 50; + draw (z1..(-k,0)..(0,k)..(k,0)..z2) slanted slant; + sipka( 2/5b, -50-5, z1); sipka( 2/5b, 180+50+5, z2); +endchar; + +beginchar("~", 0pt, 0pt, 0pt); % mistake + charC; charG; +endchar; + +beginchar("$", 0pt, 0pt, 0pt); % begin digits + charD; charE; +endchar; + +beginchar("#", 0pt, 0pt, 0pt); % end digits + charD; charF; +endchar; + +% ------------------------------------------------------- fontdimen parameters +font_identifier:="SEMAF"; +font_coding_scheme:="TEX CS TEXT"; +designsize:=10u#; + +font_slant:=slant; % fontdimen 1 +font_height:=10u#; % 5 +if proportional: + font_normal_space:=8u#; % 2 + font_normal_stretch:=4u#; % 3 + font_normal_shrink:=2u#; % 4 + font_extra_space:=5u#; % 7 + font_quad:=16u#; % 6 +else: + font_normal_space:=10u#; % 2 + font_normal_stretch:=0u#; % 3 + font_normal_shrink:=0u#; % 4 + font_extra_space:=10u#; % 7 + font_quad:=20u#; % 6 +fi; + +% ------------------------------------------------------ kernings and ligatures +def chars="a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", + "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", + "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + 152, 165, 169, 171, 174, 181, 184, 185, 187, 190, 192, 193, 196, 197, + 200, 201, 204, 205, 207, 210, 211, 212, 214, 216, 217, 218, 220, 221, + 224, 225, 228, 229, 232, 233, 236, 237, 239, 242, 243, 244, 246, 248, + 249, 250, 252, 253 enddef; +def digits="1", "2", "3", "4", "5", "6", "7", "8", "9", "0" enddef; +def chars_tr="e", "l", "q", "u", "$", "E", "L", "Q", "U", + 165, 181, 197, 201, 204, 217, 218, 220, 229, 233, 236, 249, 250, 252 enddef; +def chars_br="g", "n", "s", "~", "v", "G", "N", "S", "V", + 169, 185, 210, 242 enddef; +def digits_tr="5" enddef; +def digits_br="7" enddef; +def chars_nr="a", "b", "c", "d", "f", "h", "i", "j", "k", "m", + "o", "p", "r", "t", "w", "x", "y", "z", + "A", "B", "C", "D", "F", "H", "I", "J", "K", "M", + "O", "P", "R", "T", "W", "X", "Y", "Z", + 152, 171, 174, 184, 187, 190, 192, 193, 196, 200, 205, 207, 211, 212, + 214, 216, 221, 224, 225, 228, 232, 237, 239, 243, 244, 246, 248, 253 enddef; +def digits_nr="1", "2", "3", "4", "6", "8", "9", "0" enddef; +def tr=chars_tr, digits_tr enddef; +def br=chars_br, digits_br enddef; +def tl="c", "t", "u", "y", "~", "C", "T", "U", "Y", "3", + 171, 187, 200, 217, 218, 220, 221, 232, 249, 250, 252, 253 enddef; +def bl="a", "l", "m", "n", "A", "L", "M", "N", "1", + 152, 165, 181, 184, 193, 196, 197, 210, 225, 228, 229, 242 enddef; +def td="d", "$", "j", "v", "D", "J", "V", "4", 207, 239 enddef; +boundarychar:=1; + +ligtable for i=chars_tr: i: endfor for i=digits: i|=:|>>"$", endfor skipto 1; +ligtable for i=digits_tr: i: endfor for i=chars: i|=:|>>"#", endfor + 1|=:|"#", skipto 1; +ligtable 1:: if proportional: for i=bl: i kern-1u#, endfor fi " " kern 0u#; +ligtable for i=chars_br: i: endfor for i=digits: i|=:|>>"$", endfor skipto 2; +ligtable for i=digits_br: i: endfor for i=chars: i|=:|>>"#", endfor + 1|=:|"#", skipto 2; +ligtable 2:: if proportional: for i=tl: i kern-1u#, endfor + for i=td: i kern-.5u#, endfor fi " " kern 0u#; +ligtable for i=chars_nr: i: endfor for i=digits: i|=:|>>"$", endfor + " "|=:>" "; +ligtable for i=digits_nr: i: endfor for i=chars: i|=:|>>"#", endfor + 1|=:|"#"; +ligtable ||: for i=digits: i|=:|>>"$", endfor " "|=:>" "; + +endinput; |