From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- fonts/apl/00readme.tex | 32 + fonts/apl/apl.sty | 37 + fonts/apl/apldef.tex | 106 ++ fonts/apl/aplstyle.sty | 35 + fonts/apl/aplstyle.tex | 29 + fonts/apl/aplverb.tex | 45 + fonts/apl/clean.pas | 226 ++++ fonts/apl/cmapl10.mf | 3174 +++++++++++++++++++++++++++++++++++++++++++++++ fonts/apl/cmapl10.tfm | Bin 0 -> 764 bytes fonts/apl/convert.pas | 117 ++ fonts/apl/fontnotes | 97 ++ fonts/apl/ninesize.tex | 34 + fonts/apl/problems.tex | 316 +++++ fonts/apl/readme | 28 + fonts/apl/readme.txt | 129 ++ fonts/apl/sample.tex | 124 ++ fonts/apl/solutions.tex | 198 +++ fonts/apl/tugboat.tex | 530 ++++++++ fonts/apl/tugboat2.tex | 534 ++++++++ fonts/apl/versatim.tex | 66 + 20 files changed, 5857 insertions(+) create mode 100644 fonts/apl/00readme.tex create mode 100644 fonts/apl/apl.sty create mode 100644 fonts/apl/apldef.tex create mode 100644 fonts/apl/aplstyle.sty create mode 100644 fonts/apl/aplstyle.tex create mode 100644 fonts/apl/aplverb.tex create mode 100644 fonts/apl/clean.pas create mode 100644 fonts/apl/cmapl10.mf create mode 100644 fonts/apl/cmapl10.tfm create mode 100644 fonts/apl/convert.pas create mode 100644 fonts/apl/fontnotes create mode 100644 fonts/apl/ninesize.tex create mode 100644 fonts/apl/problems.tex create mode 100644 fonts/apl/readme create mode 100644 fonts/apl/readme.txt create mode 100644 fonts/apl/sample.tex create mode 100644 fonts/apl/solutions.tex create mode 100644 fonts/apl/tugboat.tex create mode 100644 fonts/apl/tugboat2.tex create mode 100644 fonts/apl/versatim.tex (limited to 'fonts/apl') diff --git a/fonts/apl/00readme.tex b/fonts/apl/00readme.tex new file mode 100644 index 0000000000..d729a540b6 --- /dev/null +++ b/fonts/apl/00readme.tex @@ -0,0 +1,32 @@ +% langs/apl +\par\begin{footnotesize}\begin{alltt} +Contents of README files:\par +Thank you for your letter of 27 February. The original purpose +of our APL font and macros was to solve the immediate problem +of writing documents with APL code. Therefore, they are free for +anyone who finds them useful. Some people have requested the font +and we have sent them the files appended below (with CMAPL10 and +two conversion programs for downloading pixel files, not given here). +Further, we have nothing against giving our net address to the +users because it would be useful to hear about extensions made +to the system. + +The files APLDEF.TEX and TUGBOAT.TEX are identical with the second +versions sent to you (via BITNET) except for minimal changes (there +are some corrections and extensions in APLDEF.TEX, and in +TUGBOAT.TEX one APL line was corrected.) We think the files are +in a "final" form (at least we are not planning any changes). + +Our original purpose was to publish the second version, but the only +difference was really the removal of the tilde space character (this +resulted in more complex 1-character macros, but the user cannot +see any difference; moreover, TeX runs only about 14% slower). Thus, +we feel that there is no reason to publish a list of errata in +TUGboat, because any user would inevitably have to use the new +version (the old one has not been released). + +We are adding a file containing sample examples on the use of the +APL mnemonics. + +Aarno Hohti +\end{alltt}\end{footnotesize}\par diff --git a/fonts/apl/apl.sty b/fonts/apl/apl.sty new file mode 100644 index 0000000000..f676e6e541 --- /dev/null +++ b/fonts/apl/apl.sty @@ -0,0 +1,37 @@ + + + +%================================================================== +% A P L S T Y L E +%================================================================== +% A.Hohti/O.Kanerva University of Helsinki April 6 1987 +% revised August 19 1987 +% +% APL symbols are represented by the Digital (VAX) APL +% replacement symbols. The standard escape character is +% changed to "@" (at sign) in accordance with the usage +% in Digital APL. +% +\font\apl=cmapl10 % The APL font of typewriter type +% +% +% The following macro \choosett switches the typewriter-like +% font used within verbatim: +% +\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax} +\newif\ifapl \def\aplname{apl} +\outer\def\choosett#1{\ifundefined{#1}% + \message{Undefined font(?), replaced with cmtt10}% + \let\tt=\tentt + \else + \def\tt{\expandafter\csname#1\endcsname}% + \def\ttname{#1}% + \ifx\ttname\aplname\apltrue\else\aplfalse\fi\fi} +% +\choosett{tentt} % default value +% +\input versatim % a slightly modified version of verbatim +\input apldef % control sequences for APL symbols + + + diff --git a/fonts/apl/apldef.tex b/fonts/apl/apldef.tex new file mode 100644 index 0000000000..66451a7dbc --- /dev/null +++ b/fonts/apl/apldef.tex @@ -0,0 +1,106 @@ +% apldef.tex +% +% Aarno Hohti/Okko Kanerva +% University of Helsinki +% Department of Mathematics +% Hallituskatu 15 +% SF--00100 Helsinki +% Finland +% +% Bitnet: HOHTI@FINFUN +% +%=============================================================== +% This file contains the definitions of the 2-letter control +% sequences for using cmapl10. +% cmapl10 was described in TUGboat 8 #3, November 1987. +%=============================================================== +% +\def\RO{{\apl\char'014}} % rho +\def\IO{{\apl\char'015}} % iota +\def\BX{\lower.1ex\hbox{\apl\char'001}} % quad box (window etc.) +\def\CE{{\apl\char'035}} % ceiling +\def\FL{{\apl\char'034}} % floor +\def\DE{{\apl\char'031}} % decode +\def\EN{{\apl\char'030}} % encode +\def\DL{{\apl\char'002}} % del +\def\LD{{\apl\char'003}} % delta +\def\NT{{\apl\char'026}} % not +\def\LO{{\apl\char'017}} % circle +\def\GO{{\apl\char'036}} % arrow right +\def\OR{{\apl\char'010}} % logical or +\def\DM{{\apl\char'011}} % diamond +\def\LE{{\apl\char'012}} % less than or equal +\def\GE{{\apl\char'013}} % greater than or equal +\def\AB{{\apl\char'174}} % stile +\def\LB{{\apl\char'173}} % left brace +\def\RB{{\apl\char'175}} % right brace +\def\DA{{\apl\char'037}} % arrow down +\def\UA{{\apl\char'136}} % arrow up +\def\EP{{\apl\char'006}} % epsilon +\def\NE{{\apl\char'027}} % not equal +\def\BL{{\apl\char'134}} % backslash +\def\RU{{\apl\char'022}} % right U +\def\LU{{\apl\char'023}} % left U +\def\DU{{\apl\char'021}} % down U +\def\UU{{\apl\char'020}} % up U +\def\LK{{\apl\char'033}} % left tack +\def\RK{{\apl\char'032}} % right tack +\def\US{{\apl\char'024}} % underscore +\def\NG{{\apl\char'025}} % high minus +\def\DD{{\apl\char'007}} % dieresis +\def\AM{{\apl\char'004}} % alpha +\def\OM{{\apl\char'005}} % omega +\def\SO{\raise.3ex\hbox{{\apl\char'016}}} % small circle +% +% This macro is used for overstriking two characters +\newskip\charwidth +\def\overstrike#1#2{\setbox1=\hbox{#1}\charwidth=\wd1 + #1\hskip-\charwidth#2} +% +\def\TR{\overstrike{\LO}{\BL}} % transpose +\def\RV{\overstrike{\LO}{\AB}} % reverse +\def\CR{\overstrike{\LO}{-}} % column reverse +\def\GD{\overstrike{\DL}{\AB}} % grade down +\def\GU{\overstrike{\LD}{\AB}} % grade up +\def\FM{\overstrike{\raise.1ex\hbox{{\apl\char'016}}}{\EN}} % format +\def\XQ{\overstrike{\raise.1ex\hbox{{\apl\char'016}}}{\DE}} % execute +\def\SS{\overstrike{\RU}{\US}} % subset +\def\CO{\overstrike{\LU}{\US}} % contains +\def\CB{\overstrike{\BL}{-}} % column backslash +\def\CS{\overstrike{/}{-}} % column slash +\def\IB{\overstrike{\EN}{\DE}} % I-beam +\def\DQ{\overstrike{{\apl\char'045}}{\BX}} % divide quad +\def\QQ{\overstrike{{\apl '}}{\BX}} % quote quad +\def\PD{\overstrike{\DL}{\NT}} % protected del +\def\NR{\overstrike{\OR}{\NT}} % nor +\def\NN{\overstrike{{\apl\char'046}}{\NT}} % nand +\def\LG{\overstrike{{\apl *}}{\LO}} % logarithm +% underscored letters +\def\ZA{\overstrike{{\apl A}}{\US}} +\def\ZB{\overstrike{{\apl B}}{\US}} +\def\ZC{\overstrike{{\apl C}}{\US}} +\def\ZD{\overstrike{{\apl D}}{\US}} +\def\ZE{\overstrike{{\apl E}}{\US}} +\def\ZF{\overstrike{{\apl F}}{\US}} +\def\ZG{\overstrike{{\apl G}}{\US}} +\def\ZH{\overstrike{{\apl H}}{\US}} +\def\ZI{\overstrike{{\apl I}}{\US}} +\def\ZJ{\overstrike{{\apl J}}{\US}} +\def\ZK{\overstrike{{\apl K}}{\US}} +\def\ZL{\overstrike{{\apl L}}{\US}} +\def\ZM{\overstrike{{\apl M}}{\US}} +\def\ZN{\overstrike{{\apl N}}{\US}} +\def\ZO{\overstrike{{\apl O}}{\US}} +\def\ZP{\overstrike{{\apl P}}{\US}} +\def\ZQ{\overstrike{{\apl Q}}{\US}} +\def\ZR{\overstrike{{\apl R}}{\US}} +\def\ZS{\overstrike{{\apl S}}{\US}} +\def\ZT{\overstrike{{\apl T}}{\US}} +\def\ZU{\overstrike{{\apl U}}{\US}} +\def\ZV{\overstrike{{\apl V}}{\US}} +\def\ZX{\overstrike{{\apl X}}{\US}} +\def\ZY{\overstrike{{\apl Y}}{\US}} +\def\ZW{\overstrike{{\apl W}}{\US}} +\def\ZZ{\overstrike{{\apl Z}}{\US}} + +\endinput diff --git a/fonts/apl/aplstyle.sty b/fonts/apl/aplstyle.sty new file mode 100644 index 0000000000..1a744df218 --- /dev/null +++ b/fonts/apl/aplstyle.sty @@ -0,0 +1,35 @@ + +%================================================================== +% A P L S T Y L E +%================================================================== +% A.Hohti/O.Kanerva University of Helsinki April 6 1987 +% revised August 19 1987 +% +% APL symbols are represented by the Digital (VAX) APL +% replacement symbols. The standard escape character is +% changed to "@" (at sign) in accordance with the usage +% in Digital APL. +% +\font\apl=cmapl10 % The APL font of typewriter type +% +% +% The following macro \choosett switches the typewriter-like +% font used within verbatim: +% +\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax} +\newif\ifapl \def\aplname{apl} +\outer\def\choosett#1{\ifundefined{#1}% + \message{Undefined font(?), replaced with cmtt10}% + \let\tt=\tentt + \else + \def\tt{\expandafter\csname#1\endcsname}% + \def\ttname{#1}% + \ifx\ttname\aplname\apltrue\else\aplfalse\fi\fi} +% +\choosett{tentt} % default value +% +\input versatim % a slightly modified version of verbatim +\input apldef % control sequences for APL symbols + + + diff --git a/fonts/apl/aplstyle.tex b/fonts/apl/aplstyle.tex new file mode 100644 index 0000000000..b732bded0c --- /dev/null +++ b/fonts/apl/aplstyle.tex @@ -0,0 +1,29 @@ +% aplstyle.tex +% +%=============================================================== +% A P L S T Y L E +%=============================================================== +% A.Hohti/O.Kanerva University of Helsinki April 6 1987 +% +% APL symbols are represented by the Digital (VAX) APL replacement +% symbols. The standard escape sequence is changed to "@" (at sign) +% in accordance with the usage in Digital APL. +% +\font\apl=cmapl10 % The APL font of typewriter type +% +% +% The following macro switches the typewriter-like font +% used within verbatim +\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax} +\outer\def\choosett#1{\ifundefined{#1} + \message{Undefined font(?), replaced with cmtt10} + \let\tt=\tentt + \else + \def\tt{\expandafter\csname#1\endcsname}\fi} +% +\choosett{tentt} % default value +% +\input aplverb % definitions for verbatim +\input apldef % control sequences for the APL symbols + +\endinput diff --git a/fonts/apl/aplverb.tex b/fonts/apl/aplverb.tex new file mode 100644 index 0000000000..cac8e3acdb --- /dev/null +++ b/fonts/apl/aplverb.tex @@ -0,0 +1,45 @@ +% aplverb.tex = verbatim.tex +% +% +% F|ljande macron anv{nds d} man vill f} ut \TeX-kommandon +% i klartext. @text@ ger text i fonten \tt med alla kontroll- +% tecken och dylika bevarade (\TeX\ f|rst}r sig endast p} kommandot +% @ i denna mode). Man kan ocks} utnyttja \begintt ... \endtt f|r +% att beskriva kommandon, d} {r ocks} \obeylines och \obeyspaces +% aktiva. Om man vill anv{nda vissa \TeX-kommandon men vill +% ocks} displaya n}got i en-kolumn-tabell-form kan man anv{nda +% \begindisplay ...\cr ...\cr \enddisplay +% Om du vill anv{nda \begintt...\endtt f|r text som inte +% ryms p} en sida, kan du ocks} anv{nda \beginlines...\endlines. +% Varje rad m}ste d} b|rjas och avslutas med kommandot @. +\newskip\verbatimindent \verbatimindent=0cm +\newskip\ttglue{\tt \global\ttglue=.5em plus.25em minus.15em} +\def\@{\char'100 } +% +\outer\def\begindisplay{\obeylines\startdisplay} +{\obeylines\gdef\startdisplay#1 + {\catcode`\^^M=5$$#1\halign\bgroup&\hskip\verbatimindent##\hfil\cr}} +\outer\def\enddisplay{\crcr\egroup$$} +% +\chardef\other=12 +\def\ttverbatim{\begingroup \catcode`\\=\other \catcode`\{=\other + \catcode`\}=\other \catcode`\$=\other \catcode`\&=\other + \catcode`\#=\other \catcode`\%=\other \catcode`\~=\other + \catcode`\_=\other \catcode`\^=\other\catcode`\*=\other\catcode`\==\other + \obeyspaces \obeylines \tt} +{\obeyspaces\gdef {\ }} +% +\def\begintt{$$\let\par=\endgraf \ttverbatim \parskip=0pt + \catcode`\@=0 \parindent=\verbatimindent \rightskip=-5pc \ttfinish} +{\catcode`\@=0 @catcode`@\=\other % @ is temporary escape character + @obeylines % end of line is active + @gdef@ttfinish#1^^M#2\endtt{#1@vbox{#2}@endgroup$$}} +% +\catcode`\@=\active +{\obeylines\gdef@{\ttverbatim\spaceskip=\ttglue\let^^M=\ \let@=\endgroup}} + +\def\beginlines{\par\begingroup\nobreak\medskip\parindent=0pt + \kern1pt\nobreak \obeylines \everypar{\strut}} +\def\endlines{\kern1pt\endgroup\medbreak\noindent} + +\endinput diff --git a/fonts/apl/clean.pas b/fonts/apl/clean.pas new file mode 100644 index 0000000000..611d434fe5 --- /dev/null +++ b/fonts/apl/clean.pas @@ -0,0 +1,226 @@ + +%============================================================================ +% C L E A N . P A S +%============================================================================ + +% A sample Turbo Pascal (3.0) program for truncating downloaded pixel files +% to the standard size assumed by some TeX-oriented programs (starting from +% a file of type: File of Array[0..511] of Byte. + +Program Clean_Up(Output,Input,Font_List_File); + +LABEL + +Report; + + +TYPE + +Name_Of_File =String[20]; +Name_Of_Font =String[20]; +Byte =0..255; +Byte_Block =Array[0..511] Of Byte; +Word =Array[0..3] Of Byte; + + + +VAR + +Font_List_File:Text; +Pxl_File:File of Byte_Block; +Block:Byte_Block; +Last_Blocks:Array[0..1023] Of Byte; +One_Word:Word; +File_Name,New_File_Name:Name_Of_File; +Font_Name:Name_Of_Font; +New_Pxl_File:File Of Word; +File_Id_Found,Bad_Pxl_File:Boolean; +End_Of_Block:Boolean; +IOR,Word_Pos:Integer; +Ch:Char; +Word_Value:Real; + + +PROCEDURE Banner; + + Begin + Writeln('!==================================================!'); + Writeln('! The files to be repaired are assumed consist of !'); + Writeln('! blocks 512 bytes long. The repaired files consist!'); + Writeln('! of words. The names of files are supposed to be !'); + Writeln('! found from a separate file. !'); + Writeln('!==================================================!'); + End; + + + +PROCEDURE Initialize; + + Begin + File_Id_Found:=False; + Word_Pos:=0; + End_Of_Block:=False; + Bad_Pxl_File:=False; + End; + + + + +PROCEDURE Check_File_Id; + +VAR + +A:Integer; + + Begin + If Abs(Word_Value)<2000.0 Then + Begin + A:=Round(Word_Value); + If (A=1001) Or (A=1002) Then File_Id_Found:=True; + End; + End; + + + +PROCEDURE READ_NEXT_WORD; + +VAR + +I:Integer; + + Begin + If Not End_Of_Block Then + Begin + For I:=0 To 3 Do One_Word[3-I]:=Last_Blocks[1023-((4*Word_Pos)+I)]; + Word_Pos:=Word_Pos+1; + If Word_Pos>255 Then End_Of_Block:=True; + End; + End; + + + + +PROCEDURE EVALUATE_NEXT_WORD; + + Begin + Read_Next_Word; + Word_Value:=One_Word[3]+256.0*(One_Word[2]+ + 256.0*(One_Word[1]+256.0*One_Word[0])); + + End; + + + +PROCEDURE Find_File_Id; + +Var + +K:Integer; + + Begin + While (Not File_Id_Found) And (Not End_Of_Block) Do + Begin + Evaluate_Next_Word; + Check_File_Id; + End; + If Not File_Id_Found Then + Begin + For K:=Length(Font_Name) To 30 Do Write('.'); + Writeln(' Bad Pxl File, File Not Repaired'); + Bad_Pxl_File:=True; + End; + End; + + + +PROCEDURE Rewrite_Pxl_File(Var Font_Name,File_Name:Name_Of_File); + +LABEL + +Report; + +VAR + +I,J,K,IOR:Integer; + + Begin + Assign(Pxl_File,Font_Name); + {$I-} Reset(Pxl_File) {$I+}; + IOR:=IOresult; + If IOR<>0 Then Goto Report; + Assign(New_Pxl_File,File_Name); + Rewrite(New_Pxl_File); + Seek(Pxl_File,0); + For I:=0 To Filesize(Pxl_File)-3 Do + Begin + Read(Pxl_File,Block); + For J:=0 To 127 Do + Begin + For K:=0 To 3 Do One_Word[K]:=Block[(4*J)+K]; + Write(New_Pxl_File,One_Word); + End; + End; + Read(Pxl_File,Block); + For I:=0 To 511 Do + Last_Blocks[I]:=Block[I]; + Read(Pxl_File,Block); + For I:=512 To 1023 Do + Last_Blocks[I]:=Block[I-512]; + Find_File_ID; + Word_Pos:=255-Word_Pos; + If Not Bad_Pxl_File Then + Begin + For I:=0 To Word_Pos+1 Do + Begin + For K:=0 To 3 Do One_Word[K]:=Last_Blocks[(4*I)+K]; + Write(New_Pxl_File,One_Word); + End; + Report:Begin + For I:=0 To 30-Length(Font_Name) Do Write('.'); + If IOR<>0 Then Writeln('File Not Found') Else + Begin + Writeln(New_File_Name); + Close(New_Pxl_File); + Close(Pxl_File); + End; + End; + End; + End; + + + + + (*** M A I N P R O G R A M ***) +BEGIN + + Banner; + Writeln; + Writeln('Give The Name Of File Containing The List Of Pxl Files: '); + Readln(File_Name); + Assign(Font_List_File,File_Name); + {$I-} Reset(Font_List_File) {$I+}; + IOR:=IOresult; + If IOR<>0 Then Goto Report; + While Not Eof(Font_List_File) Do + Begin + Initialize; + Font_Name:=''; + While Not Eoln(Font_List_File) Do + Begin + Read(Font_List_File,Ch); + Font_Name:=Font_Name+Ch; + End; + Readln(Font_List_File); + Write(Font_Name); + New_File_Name:=Copy(Font_Name,1,Pos('.',Font_Name)-1)+'.rxl'; + Rewrite_Pxl_File(Font_Name,New_File_Name); + End; + Writeln; + Report: Begin + If IOR<>0 Then Writeln('File Not Found!') Else + Begin + Writeln('............Done!...........'); + Close(Font_List_File); + End; + End; +END. diff --git a/fonts/apl/cmapl10.mf b/fonts/apl/cmapl10.mf new file mode 100644 index 0000000000..64b68cd341 --- /dev/null +++ b/fonts/apl/cmapl10.mf @@ -0,0 +1,3174 @@ + +%==================================================================== +% This material is from C M T E X 1 0 . M F +%==================================================================== + +% Computer Modern TeX extended ASCII characters for use with 10 point +if unknown cmbase: input cmbase fi + +font_identifier:="CMAPL"; font_size 10pt#; + +u#:=21/36pt#; % unit width +width_adj#:=0pt#; % width adjustment for certain characters +serif_fit#:=0pt#; % extra sidebar near lowercase serifs +cap_serif_fit#:=0pt#; % extra sidebar near uppercase serifs +letter_fit#:=0pt#; % extra space added to all sidebars + +body_height#:=250/36pt#; % height of tallest characters +asc_height#:=220/36pt#; % height of lowercase ascenders +cap_height#:=220/36pt#; % height of caps +fig_height#:=220/36pt#; % height of numerals +x_height#:=155/36pt#; % height of lowercase without ascenders +math_axis#:=110/36pt#; % axis of symmetry for math symbols +bar_height#:=79/36pt#; % height of crossbar in lowercase e +comma_depth#:=50/36pt#; % depth of comma below baseline +desc_depth#:=80/36pt#; % depth of lowercase descenders + +crisp#:=22/36pt#; % diameter of serif corners +tiny#:=22/36pt#; % diameter of rounded corners +fine#:=21/36pt#; % diameter of sharply rounded corners +thin_join#:=21/36pt#; % width of extrafine details +hair#:=25/36pt#; % lowercase hairline breadth +stem#:=25/36pt#; % lowercase stem breadth +curve#:=25/36pt#; % lowercase curve breadth +ess#:=22/36pt#; % breadth in middle of lowercase s +flare#:=32/36pt#; % diameter of bulbs or breadth of terminals +dot_size#:=36/36pt#; % diameter of dots +cap_hair#:=25/36pt#; % uppercase hairline breadth +cap_stem#:=25/36pt#; % uppercase stem breadth +cap_curve#:=25/36pt#; % uppercase curve breadth +cap_ess#:=25/36pt#; % breadth in middle of uppercase s +rule_thickness#:=25/36pt#; % thickness of lines in math symbols + +dish#:=0pt#; % amount erased at top or bottom of serifs +bracket#:=0pt#; % vertical distance from serif base to tangent +jut#:=34/36pt#; % protrusion of lowercase serifs +cap_jut#:=34/36pt#; % protrusion of uppercase serifs +beak_jut#:=0pt#; % horizontal protrusion of beak serifs +beak#:=34/36pt#; % vertical protrusion of beak serifs +vair#:=22/36pt#; % vertical diameter of hairlines +notch_cut#:=25/36pt#; % maximum breadth above or below notches +bar#:=22/36pt#; % lowercase bar thickness +slab#:=22/36pt#; % serif and arm thickness +cap_bar#:=22/36pt#; % uppercase bar thickness +cap_band#:=22/36pt#; % uppercase thickness above/below lobes +cap_notch_cut#:=25/36pt#; % max breadth above/below uppercase notches +serif_drop#:=0pt#; % vertical drop of sloped serifs +stem_corr#:=0pt#; % for small refinements of stem breadth +vair_corr#:=0pt#; % for small refinements of hairline height +apex_corr#:=10/36pt#; % extra width at diagonal junctions + +o#:=4/36pt#; % amount of overshoot for curves +apex_o#:=3/36pt#; % amount of overshoot for diagonal junctions + +%------------------------------------------- +% (AH) the tilt ratio has been changed to 0. +%------------------------------------------- + +slant:=0; % tilt ratio $(\Delta x/\Delta y)$ +fudge:=0.81; % factor applied to weights of heavy characters +math_spread:=-1; % extra openness of math symbols +superness:=1/sqrt2; % parameter for superellipses +superpull:=0; % extra openness inside bowls +beak_darkness:=0; % fraction of triangle inside beak serifs +ligs:=0; % level of ligatures to be included + +square_dots:=false; % should dots be square? +hefty:=true; % should we try hard not to be overweight? +serifs:=true; % should serifs and bulbs be attached? +monospace:=true; % should all characters have the same width? +variant_g:=false; % should an italic-style g be used? +low_asterisk:=true; % should the asterisk be centered at the axis? +math_fitting:=false; % should math-mode spacing be used? + + + + +%=============================================================== +% This material is from T E X S E T . M F +%=============================================================== + + + +% Special version of Computer Modern for \TeX's extended ASCII character set + +font_coding_scheme:="TeX extended ASCII"; + +mode_setup; font_setup; mono_charic#:=0; + + + cmchar "An empty space"; % This character + beginchar(" ",8u#,0,0); % was entirely + adjust_fit(0,0); % defined by + endchar; % O J K . + + + +% These characters were copied from greekl.mf and +% with character positions changed and italic corrections added to the width. + + +cmchar "Lowercase Greek alpha for extended ASCII"; +beginchar(oct"004",11u#,x_height#,0); +italcorr max(1/3x_height#*slant+.5hair#+.5u#,x_height#*slant-.5u#); +adjust_fit(0,0); pickup fine.nib; +pos0(hair,0); pos1(vair,-90); pos2(curve,-180); pos3(vair,-270); +z4=(w-3.25u,9/16h); z5=(w-2.75u,.5[vair,y4]); +numeric theta; theta=angle(z4-z5)-90; +pos4(stem,theta); pos5(stem,theta); +pos6(vair,90); pos7(hair,180); +rt x0r=hround(w-u); x1=x3=.5w-u; lft x2r=hround(1.5u-.5curve); +x6=w-u; x7+.5hair=hround(w+.5hair-eps); +top y0=vround .8[bar_height,h]; bot y1r=bot y6l=-oo; +y2=.5[y1,y3]; top y3r=h+oo; y7=1/4bar_height; +filldraw stroke z0e{down}...pulled_arc.e(1,2) & pulled_arc.e(2,3) + ...z4e---z5e...z6e{right}...{up}z7e; % diagonal, bowl, and hook +penlabels(0,1,2,3,4,5,6,7); endchar; + + + + + % Rejected(OJK) at this stage % +% cmchar "Lowercase Greek epsilon"; %=============================% +% beginchar(oct"002",8u#,x_height#,0); +% italcorr x_height#*slant+.5hair#-2u#; +% adjust_fit(0,0); pickup fine.nib; +% pos0(bar,90); pos1(bar,90); pos2(curve,180); +% pos3(vair,270); pos4(hair,300); pos6(bar,90); pos7(bar,90); +% x1=.5w+.5u; x0=x1+u; lft x2r=hround(1.5u-.5curve); x3=.5[x0,x1]; +% x4r=good.x(w-u); x5=w+.5u; x6=x0; z7=z2l; +% top y0r=top y1r=h; y2=y5=y6=bar_height; bot y3r=-oo; +% path p; p=z3r{right}...{up}z5; +% numeric t; t=ypart(((x4r,y3r)--(x4r,y5))intersectiontimes p); +% y4r=ypart point t of p; +% filldraw circ_stroke z0e..pulled_arc.e(1,2) & pulled_arc.e(2,3) +% ..z4e{direction t of p}; % arc +% filldraw circ_stroke z6e--z7e; % bar +% penlabels(0,1,2,3,4,5,6,7); endchar; + +% This letter has been copied from ITALMS.MF as the +% original iota from GREEKL.MF had only one hook (the +% iota symbol in APL needs two) +cmchar "iota"; +beginchar(oct"015",5u#,x_height#,0); +italcorr 1/3x_height#*slant+.5hair#+.5u#; +adjust_fit(if monospace:u#,u# else: 0,0 fi); pickup fine.nib; +x0=0; x5=w; x2=.5w+.25u; x3=.5w-.25u; +hook_in(0,1,2)(skewed); hook_out(3,4,5)(skewed); % hooks +filldraw stroke z2e--z3e; % stem +math_fit(-2/3x_height#*slant+.5hair#+.5u#,ic#); +penlabels(0,1,2,3,4,5); endchar; + +cmchar "Lowercase Greek rho"; +beginchar(oct"014",8.25u#,x_height#,desc_depth#); +italcorr .7x_height#*slant+.5curve#-u# if math_fitting:-.5u# fi; +adjust_fit(0,0); pickup fine.nib; +pos1(stem,180); pos2(stem,180); pos3(vair,90); +pos4(curve,0); pos5(vair,-90); pos6(hair,-180); +lft x2r=hround(1.5u-.5stem); x1=x2=x6; x3=x5=.5[x2,x4]; +rt x4r=hround(w-1.5u+.5curve); +y1-.5stem=-d-o; y2=y4=y6=.5[y3,y5]; top y3r=h+oo; bot y5r=-oo; +filldraw circ_stroke z1e..pulled_arc.e(2,3) & pulled_arc.e(3,4) + & pulled_arc.e(4,5) & pulled_arc.e(5,6); % stem and bowl +penlabels(1,2,3,4,5,6); endchar; + +cmchar "Lowercase Greek omega"; +beginchar(oct"005",11u#,x_height#,0); +italcorr x_height#*slant; +adjust_fit(0,0); pickup fine.nib; +pos2(hair,-180); lft x2r=hround.5u; y2=y4=y6=y8=bar_height; +y1+.5hair=h; x1=x2+.75u; pos1(hair,angle(2(x1-x2),y1-y2)+90); +pos3(vstem+dw,-90); pos4(hair,0); pos5(vair,90); +pos6(hair,180); pos7(vstem+dw,270); pos8(hair,360); +bot y3r=bot y7r=-oo; top y5r=vround(.2[y4,h]+.5vair); +x3=.5[x2,x4]; x7+.25u=.5[x6,x8]; rt x8r=hround(w-.5u); +x5+.5stem=hround(.5w+.5stem)+eps; +x5=.5[x4,x6]; rt x4r-lft x6r=min(stem,2hair)+2eps; +if x4l"; +compute_spread((5/8+.45)*x_height#,(3/4+.55)*x_height#); +beginchar(underbar,14u#,0,spread#-math_axis#+.5rule_thickness#); +adjust_fit(0,0); pickup light_rule.nib; +lft x1=hround 1.5u-eps; x2=w-x1; bot y1=bot y2=-d; +draw z1--z2; % bar +labels(1,2); endchar; + %=======================% + % Rejected (?): % + %=======================% +% cmchar "Overbar"; +% compute_spread((5/8+.45)*x_height#,(3/4+.55)*x_height#); +% beginchar(oct"142",14u#,body_height#,0); +% adjust_fit(0,0); pickup rule.nib; +% lft x1=hround 1.5u-eps; x2=w-x1; top y1=top y2=h+o; +% draw z1--z2; % bar +% labels(1,2); endchar; + +iff known neq: cmchar "Unequals sign"; +compute_spread(.45x_height#,.55x_height#); +beginchar(neq,14u#,v_center(4spread#+rule_thickness#)); +italcorr h#*slant-.5u#; +adjust_fit(0,0); pickup light_rule.nib; +lft x1=hround u-eps; x3=x1; x2=x4=w-x1; +y1=y2; y3=y4; y1-y3=spread; .5[y1,y3]=math_axis; +draw z1--z2; draw z3--z4; % bars +lft x6=hround 3.5u-eps; x5=w-x6; top y5=h+o; bot y6=-d-o; +draw z5--z6; % diagonal +labels(1,2,3,4,5,6); endchar; + +iff known leq: cmchar "Less than or equal to sign"; +compute_spread(.45x_height#,.55x_height#); +spread#':=spread#; spread':=spread; % the spread of `$=$' +compute_spread(5/4x_height#,3/2x_height#); +beginchar(leq,14u#,v_center(spread#'+spread#+rule_thickness#)); +italcorr h#*slant-u#; +adjust_fit(0,0); pickup light_rule.nib; +lft x2=hround 1.5u-eps; x1=x3=w-x2; +y1-y3=spread; y2=.5[y1,y3]; top y1=h; +draw z1--z2--z3; % diagonals +x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9; % bar +labels(1,2,3,8,9); endchar; + +iff known geq: cmchar "Greater than or equal to sign"; +compute_spread(.45x_height#,.55x_height#); +spread#':=spread#; spread':=spread; % the spread of `$=$' +compute_spread(5/4x_height#,3/2x_height#); +beginchar(geq,14u#,v_center(spread#'+spread#+rule_thickness#)); +italcorr h#*slant-u#; +adjust_fit(0,0); pickup light_rule.nib; +lft x1=hround 1.5u-eps; x2=w-x1; x3=x1; +y1-y3=spread; y2=.5[y1,y3]; top y1=h; +draw z1--z2--z3; % diagonals +x8=x1; x9=x2; y8=y9; y3-y9=spread'; draw z8--z9; % bar +labels(1,2,3,8,9); endchar; + +iff known backslash: cmchar "Reverse slash (backslash)"; +beginchar(backslash,9u#,body_height#,paren_depth#); +adjust_fit(0,0); pickup light_rule.nib; +lft x1=hround u-eps; top y1=h+eps; +rt x2=hround(w-u)+eps; bot y2=-d-eps; +draw z1--z2; % diagonal +labels(1,2); endchar; + +iff known vertical: cmchar "Vertical line"; +beginchar(vertical,5u#,body_height#,paren_depth#); +italcorr body_height#*slant+.5rule_thickness#-2u#; +adjust_fit(0,0); pickup light_rule.nib; +x1=x2=good.x .5w; top y1=h+eps; bot y2=-d-eps; +draw z1--z2; % stem +labels(1,2); endchar; + +% % modified from cdot (AH) +% iff known dieresis: cmchar "High double dot in APL"; +% beginchar(dieresis,7u#,asc_height#); +% adjust_fit(0,0); pickup fine.nib; +% numeric dot_diam#; dot_diam#=if monospace: 5/4 fi\\ dot_size#; +% define_whole_blacker_pixels(dot_diam); +% pos1(dot_diam,0); pos2(dot_diam,90); +% pos3(dot_diam,0); pos4(dot_diam,90); +% lft x1l=hround(.25w-.5dot_diam);y1=h; +% lft x3l=hround(.75w-.5dot_diam);y3=h; +% z1=z2; dot(1,2); % first dot +% z3=z4; dot(3,4); % second dot +% penlabels(1,2,3,4); endchar; + + +% changed (AH) from the original diamond since the diamond +% operator in APL is taller than a square rotated by 45 degrees +iff known diamond: cmchar "Diamond operator"; +beginchar(diamond,9u#,v_center(7u#)); +italcorr math_axis#*slant; +adjust_fit(0,0); pickup light_rule.nib; +numeric a; a=(lft 3.5u)*sqrt(3.14159/2); % an attempt to match circle area +x4=x8=good.x .5w; w:=r:=2x4; x2=w-x6=good.x(x4+a); +y2=y6=.5[y4,y8]=math_axis; y8=good.y(y2+1.5a); +draw z2--z4--z6--z8--cycle; % bowl +labels(2,4,6,8); endchar; + +iff known left_brace: cmchar "Left curly brace"; +beginchar(left_brace,9u#,body_height#,paren_depth#); +italcorr body_height#*slant+.5vair#-u#; +adjust_fit(0,0); pickup fine.nib; +forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor +forsuffixes $=2,3,5,6: pos$(stem,0); endfor +x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4'; +lft x4l=hround(1.5u-.5vair); lft x2l=hround(.5w-.5stem); +top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5]; +y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine; +filldraw z1l{left}...z2l---z3l...{left}z4l + --z4'l{right}...z5l---z6l...{right}z7l + --z7r--z7'r{left}...z6r---z5r...{left}.5[z4r,z4'r]{right} + ...z3r---z2r...{right}z1'r--z1r--cycle; % stroke +penlabels(1,2,3,4,5,6,7); endchar; + +iff known right_brace: cmchar "Right curly brace"; +beginchar(right_brace,9u#,body_height#,paren_depth#); +italcorr math_axis#*slant+.5vair#-u#; +adjust_fit(0,0); pickup fine.nib; +forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor +forsuffixes $=2,3,5,6: pos$(stem,0); endfor +x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4'; +rt x4r=hround(w-1.5u+.5vair); rt x2r=hround(.5w+.5stem); +top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5]; +y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine; +filldraw z1r{right}...z2r---z3r...{right}z4r + --z4'r{left}...z5r---z6r...{left}z7r + --z7l--z7'l{right}...z6l---z5l...{right}.5[z4l,z4'l]{left} + ...z3l---z2l...{left}z1'l--z1l--cycle; % stroke +penlabels(1,2,3,4,5,6,7); endchar; + +% cmchar "APL quote"; +% beginchar("'",9u#,asc_height#,0); +% numeric top_width#,spread#; top_width#=if serifs: flare# else: stem# fi; +% spread#=max(3u#,top_width#+.5u#); define_pixels(spread); +% italcorr asc_height#*slant+.5top_width#+.5spread#-4u#; +% adjust_fit(0,0); +% x1=x2; x3=x4=w-x1; x3-x1=0; y1=y3; +% y2=y4=max(.5[bar_height,x_height]+.5vair,h-x_height); +% if serifs: pickup crisp.nib; pos1(flare,0); pos2(vair,0); +% pos3(flare,0); pos4(vair,0); +% y1+.5stem=h; filldraw circ_stroke z1e--z2e; % left stem and bulb +% filldraw circ_stroke z3e--z4e; % right stem and bulb +% else: pickup fine.nib; pos1(stem,0); pos2(vair,0); +% top y1=h; filldraw stroke z1e--z2e; % left stem +% pos3(stem,0); pos4(vair,0); +% filldraw stroke z3e--z4e; fi % right stem +% penlabels(1,2,3,4); endchar; + + + %================================================================% + % The next definition inserted(OJK), with changes, from PUNCT.MF % + %================================================================% + + +% cmchar "Apostrophe"; +% beginchar("'",5u#,asc_height#,0); +% italcorr asc_height#*slant+.5dot_size#-2u#; +% adjust_fit(0,0); +% x1-.5dot_size=hround(.5w-.5dot_size); y1+.5dot_size=h; +% if monospace: comma(1,a,dot_size,.28u,vround 1.5comma_depth); % large comma +% else: comma(1,a,dot_size,.25u,comma_depth); fi % comma with increased jut +% penlabels(1); endchar; + + + %=================================% + % This trial is from QUOTE.MF(?): % + %=================================% + + +%cmchar "Straight single quote"; +%beginchar("'",5u#,asc_height#,0); +%italcorr asc_height#*slant+.5 if serifs: flare# else: stem# fi -2u#; +%adjust_fit(0,0); +%x1=x2=.5w; y2=max(.5[bar_height,x_height]+.5vair,h-x_height); +%if serifs: pickup crisp.nib; pos1(flare,0); pos2(vair,0); +% y1+.5stem=h; filldraw circ_stroke z1e--z2e; % stem and bulb +%else: pickup fine.nib; pos1(stem,0); pos2(vair,0); +% top y1=h; filldraw stroke z1e--z2e; fi % stem +%penlabels(1,2,3,4); endchar; + + + +%cmchar "Straight single quote"; +%beginchar("'",5u#,asc_height#,0); +%adjust_fit(0,0); pickup light_rule.nib; +%bot y1=vround(5/7*h); y2=y1; top y3=h+2o; y4=y3; +%.5[x1,x2]=x5=good.x .5w; w:=r:=2x5; +%lft x1=hround(.5w-1/28*h); +%.5[x3,x4]=x6=good.x .5w; w:=r:=2x6; +%lft x3=hround(.5w-1/7*h); +%filldraw z1--z2--z4--z3--cycle; +%penlabels(1,2,3,4); endchar; + + +cmchar "Straight single quote"; +beginchar("'",5u#,asc_height#,0); +italcorr asc_height#*slant+.5 if serifs: flare# else: stem# fi -2u#; +adjust_fit(0,0); +x1=x2=.5w; y2=max(.5[bar_height,x_height]+.5vair,h-x_height); +if serifs: pickup rule.nib; pos1(flare,0); pos2(vair,0); + y1+.5stem=h; filldraw circ_stroke z1e--z2e; % stem and bulb +else: pickup crisp.nib; pos1(stem,0); pos2(vair,0); + top y1=h; filldraw stroke z1e--z2e; fi % stem +penlabels(1,2,3,4); endchar; + + + + + % S Y M ends % + + +% The following definitions are copied from S Y M B O L . M F + +cmchar "Times operator"; +beginarithchar("#"); pickup light_rule.nib; +x1=good.x(1/sqrt2)[.5w,rt u]; y1=good.y(1/sqrt2)[math_axis,bot h]; +x2=x3=w-x1; x4=x1; .5[y1,y2]=.5[y3,y4]=math_axis; y2=y4; +draw z1--z2; draw z3--z4; % diagonals +labels(1,2,3,4); endchar; + +%cmchar "Division operator"; +%beginarithchar("%"); pickup light_rule.nib; +%x3-.5dot_size=hround(.5w-.5dot_size); w:=r:=2x3; +%y3+.5dot_size=vround(math_axis+math_spread[.3x_height,.4x_height]+.5dot_size); +%lft x1=hround u-eps; x2=w-x1; y1=y2=math_axis; +%draw z1--z2; % bar +%pos3(dot_size,0); pos4(dot_size,90); z3=z4; +%pos5(dot_size,0); pos6(dot_size,90); z5=z6; x5=x3; .5[y3,y5]=math_axis; +%dot(3,4); dot(5,6); % dots +%penlabels(1,2,3,4,5,6); endchar; + + +cmchar "Division operator"; +beginarithchar("%"); pickup light_rule.nib; +x3-.5dot_size=hround(.5w-.5dot_size); w:=r:=2x3; +y3=vround(math_axis+1.5dot_size); +lft x1=hround u-eps; x2=w-x1; y1=y2=math_axis; +draw z1--z2; % bar +pos3(dot_size,0); pos4(dot_size,90); z3=z4; +pos5(dot_size,0); pos6(dot_size,90); z5=z6; +x5=x3; .5[y3,y5]=math_axis+.1rule_thickness; +dot(3,4); dot(5,6); % dots +penlabels(1,2,3,4,5,6); endchar; + + %========================================= + % To be replaced by the next definition... + +% cmchar "Circle operator"; +% beginchar(oct"017",9u#,v_center(9u#)); +% adjust_fit(0,0); pickup light_rule.nib; autorounded; +% lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h; +% circle_points; draw_circle; % circle +% labels(1,2,3,4,5,6,7,8); endchar; + + +cmchar "Circle operator"; +beginchar(oct"017",16u#,v_center(16u#)); %@ For test purposes! +adjust_fit(0,0); pickup light_rule.nib; autorounded; +lft x1=hround u; x0=.5w; y1=y0=math_axis; +z2-z0=(z1-z0) rotated 45; +z3-z0=(z2-z0) rotated 45; +z4-z0=(z3-z0) rotated 45; +z5-z0=(z4-z0) rotated 45; +z6-z0=(z5-z0) rotated 45; +z7-z0=(z6-z0) rotated 45; +z8-z0=(z7-z0) rotated 45; +draw z1...z2...z3...z4...z5...z6...z7...z8...cycle; % Circle(OJK) which is +labels(0,1,2,3,4,5,6,7,8); endchar; % round as it should. + + + +cmchar "Small circle"; +beginchar(oct"016",5u#,v_center(5u#)); +adjust_fit(0,0); pickup light_rule.nib; autorounded; +lft x6=hround u; x2=w-x6; top y8=h-.3x_height; y2=math_axis-.3x_height; %@ Addition here! +circle_points; draw_circle; % circle +labels(1,2,3,4,5,6,7,8); endchar; + +% cmchar "Circle stile operator"; +% beginchar(oct"175",8u#,v_center(8u#)); +% pickup light_rule.nib; autorounded; +% lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h; +% circle_points; draw_circle; % circle +% top y10=body_height#; +% bot y9=-paren_depth#; +% x9=x10=x4; +% draw z9--z10; % stile +% labels(1,2,3,4,5,6,7,8); endchar; + +% cmchar "Circle slope operator"; +% beginchar(oct"176",8u#,v_center(8u#)); +% pickup light_rule.nib; autorounded; +% lft x6=hround u; x2=w-x6; y2=math_axis; top y8=h; +% circle_points; draw_circle; % circle +% top y10=body_height#; +% bot y9=-paren_depth#; +% x9=x10=x4; +% draw z9--z10; % slope +% labels(1,2,3,4,5,6,7,8); endchar; + +iff known elt: cmchar "Element sign"; +compute_spread(5/4x_height#,3/2x_height#); +beginchar(elt,12u#,v_center(spread#+rule_thickness#)); +italcorr h#*slant-u#; +adjust_fit(0,0); pickup light_rule.nib; autorounded; +lft x2=hround 1.5u-eps; x1=x3=x6=w-x2; +y1-y3=spread; y2=y6=.5[y1,y3]=math_axis; +x4=x5=.5w+u; y4=y1; y5=y3; +draw z1---z4...z2{down}...z5---z3; % arc and bars +draw z2--z6; % middle bar +labels(1,2,3,4,5,6); endchar; + +cmchar "Negation"; +compute_spread(.45x_height#,.55x_height#); +beginchar(negation,14u#,v_center(spread#+rule_thickness#)); +adjust_fit(0,0); +pickup pencircle xscaled .7rule_thickness yscaled 1.4rule_thickness; +if vair#>.8curve#: pickup light_rule.nib; autorounded; fi % monoline +lft x1=hround u; x2=4u; x3=w-x2; x4=w-x1; +bot y1=bot y3=-d; top y2=top y4=h; +draw z1{up}...z2{right}..{right}z3...{up}z4; % stroke +labels(1,2,3,4); endchar; + +% sqrt48 was changed (AH) to 6.5 since the Delta symbol in APL has +% a narrower base than the original triangle symbol +cmchar "Delta"; +beginchar(oct"003",16u#,asc_height#,0); +adjust_fit(0,0); pickup light_rule.nib; +bot y1=0; y2=y1; top y3=h+2o; +.5[x1,x2]=x3=good.x .5w; w:=r:=2x3; lft x1=hround(.5w-u*6.25); +draw z1--z2--z3--cycle; % stroke +labels(1,2,3); endchar; + +% sqrt48 was changed to 6.25 since the Del symbol in APL has +% a narrower top than the original reversed triangle symbol +% Moreover, Del must be lifted up to the same line as Delta, +cmchar "Del"; +beginchar(oct"002",16u#,asc_height#,0); +adjust_fit(0,0); pickup light_rule.nib; +top y1=h+2o; y2=y1; bot y3=0; +.5[x1,x2]=x3=good.x .5w; w:=r:=2x3; lft x1=hround(.5w-u*6.25); +draw z1--z2--z3--cycle; % stroke +labels(1,2,3); endchar; + +cmchar "Lattice top"; +beginchar(oct"030",14u#,asc_height#,0); +adjust_fit(0,0); pickup light_rule.nib; +x1=x2=good.x .5w; w:=r:=2x1; lft x3=hround u; x4=r-x3; +bot y1=0; y2-y1=x4-x3; +if top y2>h: y2:=bot h; fi +y3=y4=y2; +draw z1--z2; % stem +draw z3--z4; % bar +labels(1,2,3,4); endchar; + +cmchar "Perpendicular sign or lattice bottom"; +beginchar(oct"031",14u#,asc_height#,0); +adjust_fit(0,0); pickup light_rule.nib; +x1=x2=good.x .5w; w:=r:=2x1; lft x3=hround u; x4=r-x3; +bot y1=0; y2-y1=x4-x3; +if top y2>h: y2:=bot h; fi +y3=y4=y1; +draw z1--z2; % stem +draw z3--z4; % bar +labels(1,2,3,4); endchar; + +cmchar "Left turnstile"; +beginchar(oct"033",11u#,asc_height#,0); +adjust_fit(0,0); pickup light_rule.nib; +.5[y1,y2]=y3=y4; x1=x2=x3; +lft x3=hround u; x4=w-x3; top y1=h; bot y2=0; +draw z1--z2; % stem +draw z3--z4; % bar +labels(1,2,3,4); endchar; + +cmchar "Right turnstile"; +beginchar(oct"032",11u#,asc_height#,0); +adjust_fit(0,0); pickup light_rule.nib; +.5[y1,y2]=y3=y4; x1=x2=x4; +lft x3=hround u; x4=w-x3; top y1=h; bot y2=0; +draw z1--z2; % stem +draw z3--z4; % bar +labels(1,2,3,4); endchar; + +cmchar "Left floor bracket"; +beginchar(oct"034",8u#,body_height#,paren_depth#); +adjust_fit(0,0); pickup light_rule.nib; +x1=x2=good.x 3.5u; x3=x1+3.75u+eps; +top y1=h; .5[y1,y2]=math_axis; y3=y2; +draw z1--z2--z3; % stem and bar +labels(1,2,3); endchar; + +cmchar "Left ceiling bracket"; +beginchar(oct"035",8u#,body_height#,paren_depth#); +adjust_fit(0,0); pickup light_rule.nib; +x1=x2=good.x 3.5u; x3=x1+3.75u+eps; +top y1=h; .5[y1,y2]=math_axis; y3=y1; +draw z3--z1--z2; % stem and bar +labels(1,2,3); endchar; + +%================================================================ + +% The quad symbol is created by using the definition of Del + +cmchar "Quad"; +beginchar(oct"001",16u#,body_height#,0); %@ body or asc +adjust_fit(0,0); pickup light_rule.nib; +bot y1=0; y2=y1; top y3=h+2o; y4=y3; +.5[x1,x2]=x5=good.x .5w; w:=r:=2x5; +% The quad box is slightly wider than Del +lft x1=hround(.5w-u*7); %@ -u*7 or -5/14*h +x3=x1; x4=x2; +draw z1--z2--z4--z3--cycle; % box +labels(1,2,3,4); endchar; + +%% The divide quad is built as a primary character +% NOT AFTER ALL + +%cmchar "Divide quad"; +%beginchar(oct"001",16u#,body_height#,paren_depth#); +%adjust_fit(0,0); pickup light_rule.nib; +%bot y1=0; y2=y1; top y3=h+2o;top y4=h+2o; +%.5[x1,x2]=x5=good.x .5w; w:=r:=2x5; +% the quad box is slightly wider than Del +%lft x1=hround(.5w-u*7); +%x3=x1;x4=x2; +%draw z1--z2--z4--z3--cycle; % box +%pickup rule.nib; +%x8-.5dot_size=hround(.5w-.5dot_size); w:=r:=2x8; +% +%y8=vround(.5y3+1.75dot_size); %@ 1 by 1.75 +%lft x6=x1; x7=x2; y6=y7=.5y3; +%draw z6--z7; % bar +%pos8(dot_size,0); pos9(dot_size,90); z8=z9; +%pos10(dot_size,0); pos11(dot_size,90);z10=z11; +%x10=x8; .5[y8,y10]=.5y3; %@ +rule_thickness#; +%dot(8,9); dot(10,11); % dots +%penlabels(1,2,3,4,5,6,7,8,9,10,11); endchar; + + + +% (AH) +% Before loading in the definitions of the upper case Roman letters, +% we have to load in the preamble for the slanted typewriter font +% since that is the style of letters in APL. +% + + +%===================================================================== +% This material comes from C M S L T T 1 0 +%===================================================================== + + +u#:=21/36pt#; % unit width +width_adj#:=0pt#; % width adjustment for certain characters +serif_fit#:=0pt#; % extra sidebar near lowercase serifs +cap_serif_fit#:=0pt#; % extra sidebar near uppercase serifs +letter_fit#:=0pt#; % extra space added to all sidebars + +body_height#:=250/36pt#; % height of tallest characters +asc_height#:=220/36pt#; % height of lowercase ascenders +cap_height#:=220/36pt#; % height of caps +fig_height#:=220/36pt#; % height of numerals +x_height#:=155/36pt#; % height of lowercase without ascenders +math_axis#:=110/36pt#; % axis of symmetry for math symbols +bar_height#:=79/36pt#; % height of crossbar in lowercase e +comma_depth#:=50/36pt#; % depth of comma below baseline +desc_depth#:=80/36pt#; % depth of lowercase descenders + +crisp#:=22/36pt#; % diameter of serif corners +tiny#:=22/36pt#; % diameter of rounded corners +fine#:=21/36pt#; % diameter of sharply rounded corners +thin_join#:=21/36pt#; % width of extrafine details +hair#:=25/36pt#; % lowercase hairline breadth +stem#:=25/36pt#; % lowercase stem breadth +curve#:=25/36pt#; % lowercase curve breadth +ess#:=22/36pt#; % breadth in middle of lowercase s +flare#:=32/36pt#; % diameter of bulbs or breadth of terminals +dot_size#:=36/36pt#; % diameter of dots +cap_hair#:=25/36pt#; % uppercase hairline breadth +cap_stem#:=25/36pt#; % uppercase stem breadth +cap_curve#:=25/36pt#; % uppercase curve breadth +cap_ess#:=25/36pt#; % breadth in middle of uppercase s +rule_thickness#:=25/36pt#; % thickness of lines in math symbols + +dish#:=0pt#; % amount erased at top or bottom of serifs +bracket#:=0pt#; % vertical distance from serif base to tangent +jut#:=34/36pt#; % protrusion of lowercase serifs +cap_jut#:=34/36pt#; % protrusion of uppercase serifs +beak_jut#:=0pt#; % horizontal protrusion of beak serifs +beak#:=34/36pt#; % vertical protrusion of beak serifs +vair#:=22/36pt#; % vertical diameter of hairlines +notch_cut#:=25/36pt#; % maximum breadth above or below notches +bar#:=22/36pt#; % lowercase bar thickness +slab#:=22/36pt#; % serif and arm thickness +cap_bar#:=22/36pt#; % uppercase bar thickness +cap_band#:=22/36pt#; % uppercase thickness above/below lobes +cap_notch_cut#:=25/36pt#; % max breadth above/below uppercase notches +serif_drop#:=0pt#; % vertical drop of sloped serifs +stem_corr#:=0pt#; % for small refinements of stem breadth +vair_corr#:=0pt#; % for small refinements of hairline height +apex_corr#:=10/36pt#; % extra width at diagonal junctions + +o#:=4/36pt#; % amount of overshoot for curves +apex_o#:=3/36pt#; % amount of overshoot for diagonal junctions + +slant:=1/5; % tilt ratio $(\Delta x/\Delta y)$ +fudge:=0.81; % factor applied to weights of heavy characters +math_spread:=-1; % extra openness of math symbols +superness:=1/sqrt2; % parameter for superellipses +superpull:=0; % extra openness inside bowls +beak_darkness:=0; % fraction of triangle inside beak serifs +ligs:=0; % level of ligatures to be included + +square_dots:=false; % should dots be square? +hefty:=true; % should we try hard not to be overweight? +serifs:=true; % should serifs and bulbs be attached? +monospace:=true; % should all characters have the same width? +variant_g:=false; % should an italic-style g be used? +low_asterisk:=true; % should the asterisk be centered at the axis? +math_fitting:=false; % should math-mode spacing be used? + + %======================== + mode_setup;font_setup; + %======================== + +%==================================================================== +% input romanu; % upper case (majuscules) +%==================================================================== + +% Computer Modern Roman upper case: +% These letters were originally coded by D. E. Knuth in November, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% Sans serif designs by Richard Southall were added in April, 1982. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0101 through \0132 are generated. + +cmchar "The letter A"; +beginchar("A",13u#,cap_height#,0); +adjust_fit(cap_serif_fit#,cap_serif_fit#); +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 y0lower_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); endchar; + +cmchar "The letter O"; +beginchar("O",14u#-width_adj#,cap_height#,0); +italcorr .7cap_height#*slant-.5u#; +adjust_fit(0,0); +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); endchar; + +cmchar "The letter P"; +beginchar("P",12u#,cap_height#,0); +italcorr .75cap_height#*slant-.5u#; +adjust_fit(cap_serif_fit#,0); +pickup tiny.nib; penpos1(cap_stem'-tiny,0); penpos2(cap_stem-tiny,0); +pos0(cap_stem',0); pos0'(cap_stem,0); +lft x1l=hround max(2u,3u-.5cap_stem'); top y1=h; bot y2=0; +x1l=x2l=x0l=x0'l; y0=y0'=y7; +penpos3(cap_band,90); penpos4(cap_band,90); +penpos5(cap_curve if hefty:-3stem_corr fi,0); +penpos6(.5[vair,cap_band],-90); penpos7(.5[vair,cap_band],-90); +z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7; +x7=x2; y7l=vround .5h; x4=x6=.5w+.75u; x5r=hround(w-u); +x4l:=x6l:=x4-.25cap_curve; +filldraw stroke z1e--z0e--z0'e--z2e; % stem +fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e; % lobe +if serifs: nodish_serif(1,0,a,1/3,cap_jut,b,1/3,.5cap_jut); % upper serif + dish_serif(2,0',c,1/3,cap_jut,d,1/3,cap_jut); fi % lower serif +math_fit(0,ic#-2.5u#); penlabels(0,1,2,3,4,5,6,7); endchar; + +cmchar "The letter Q"; +beginchar("Q",14u#-width_adj#,cap_height#,comma_depth#); +italcorr .7cap_height#*slant-.5u#; +adjust_fit(0,0); +numeric light_curve; light_curve=cap_curve-hround stem_corr; +penpos1(vair',90); penpos3(vair',-90); +penpos2(light_curve,180); penpos4(light_curve,0); +if monospace: x2r=hround 1.5u; + interim superness:=sqrt superness; % make |"Q"| like |"O"| +else: x2r=hround u; fi +x4r=w-x2r; x1=x3=.5w; y1r=h+o; y2=y4=.5h-vair_corr; y3r=-o; +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 +pickup tiny.nib; +if hefty: penpos5(1.2(.5[cap_bar,light_curve]),0); penpos6(1.2light_curve,0); + x5=.5w; x6r=hround(w-1.5u); + y5=vround .28h; y6=-d; + fill diag_end(6r,5r,.25,1,5l,6l)--diag_end(5l,6l,.5,1,6r,5r)--cycle; % tail +else: pos3'(vair,270); pos5(vair,180); pos6(vair,90); + pos7(cap_curve,85); penpos8(eps,180); + z3'=z3; x6=x3; top y6r=vround(.2h+.5vair); + lft x5r=hround(.5w-1.25u-.5vair); y5=.5[y3,y6]; + bot y7l=-d; x7l=2/3[x6,x8]; y8=0; rt x8=hround(x4r+.1u); + filldraw stroke z3'e{left}...z5e{up}...z6e{right} + ..z7e{right}...z8e{up}; fi % tail +math_fit(-.3cap_height#*slant-.5u#,ic#); penlabels(1,2,3,4,5,6,7); endchar; + +cmchar "The letter R"; +beginchar("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); +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); endchar; + +cmchar "The letter S"; +beginchar("S",10u#,cap_height#,0); +italcorr cap_height#*slant-u#; +adjust_fit(0,0); +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); endchar; + +cmchar "The letter T"; +beginchar("T",13u#-width_adj#,cap_height#,0); +italcorr cap_height#*slant-beak_jut#-.25u#; +adjust_fit(0,0); +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); endchar; + +cmchar "The letter U"; +beginchar("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; +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); endchar; + +cmchar "The letter V"; +beginchar("V",13u#,cap_height#,0); +italcorr cap_height#*slant+.25u#; +adjust_fit(cap_serif_fit#,cap_serif_fit#); +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); endchar; + +cmchar "The letter W"; +beginchar("W",18u#,cap_height#,0); +italcorr cap_height#*slant+.25u#; +adjust_fit(cap_serif_fit#,cap_serif_fit#); +numeric stem[],outer_jut,upper_notch,alpha,mid_corr; +outer_jut=.7cap_jut; x1l=w-x8r=l+letter_fit+outer_jut+.25u; +stem1=fudged.cap_stem-stem_corr; +stem4=min(fudged.hair if hefty:-2stem_corr fi,stem1); +stem2=stem4 if hefty:-2stem_corr fi; +stem3=stem1 if hefty:-2stem_corr fi; +x2-x1=x4-x3=x6-x5=x8-x7; x2l+apex_corr=x3l; x6l+apex_corr=x7l; +y1=y8=h; y2=y3=y6=y7=-apex_o; y4=y5=if monospace: vround .6 fi\\ h; +mid_corr=if monospace or hefty:-apex_corr else: 1/3jut fi; +alpha=diag_ratio(4,stem2-stem3+stem4,y1-y2,x8r-x1l+mid_corr-2apex_corr); +penpos1(alpha*stem1,0); penpos2(alpha*stem1,0); +penpos3(alpha*stem2,0); penpos4(alpha*stem2,0); +penpos5(alpha*stem3,0); penpos6(alpha*stem3,0); +penpos7(alpha*stem4,0); penpos8(alpha*stem4,0); +x4l-x1l=floor(x4l-x1l+.5(x5r+mid_corr-x4r)); % |x5r+mid_corr| $\approx$ |x4r| +z23=whatever[z1r,z2r]=whatever[z3l,z4l]; +z45=whatever[z3r,z4r]=whatever[z5l,z6l]; +z67=whatever[z5r,z6r]=whatever[z7l,z8l]; upper_notch=y4-cap_notch_cut; +fill diag_end(1l,2l,1,1,3r,4r){z4-z3} + ...if y45cap_notch_cut:(x67,cap_notch_cut)+.5right{down} + --(x67,cap_notch_cut)+.5left{up} else: z67&z67 fi + ...{z5-z6}special_diag_end(6,5,4,3){z3-z4} + ...if y23>cap_notch_cut:(x23,cap_notch_cut)+.5right{down} + --(x23,cap_notch_cut)+.5left{up} else: z23&z23 fi + ...{z1-z2}diag_end(2r,1r,1,1,1l,2l)--cycle; % diagonals +if serifs: numeric inner_jut[]; pickup tiny.nib; + prime_points_inside(1,2); prime_points_inside(5,6); prime_points_inside(8,7); + if monospace: inner_jut1=inner_jut4=1.5cap_jut; + elseif hefty: inner_jut1=inner_jut4=cap_jut; + else: fill diag_end(6r,5r,1,1,5l,6l) + --.5[z5l,z6l]--.5[z5r,z6r]--cycle; % middle stem + inner_jut2=.7inner_jut1; inner_jut4=1.1inner_jut3; + if rt x1'r+cap_jut+.5u+1<=lft x5'l-.7cap_jut: inner_jut1=cap_jut; + else: rt x1'r+inner_jut1+.5u+1=lft x5'l-inner_jut2; fi + if rt x5'r+cap_jut+.5u+1<=lft x8'l-1.1cap_jut: inner_jut3=cap_jut; + else: rt x5'r+inner_jut3+.5u+1=lft x8'l-inner_jut4; fi + dish_serif(5',6,e,1/3,inner_jut2,f,1/2,inner_jut3); fi % middle serif + dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut1); % left serif + dish_serif(8',7,c,.6,inner_jut4,d,1/2,outer_jut)(dark); fi % right serif +math_fit(.75u#-cap_height#*slant,ic#-2.5u#); +penlabels(0,1,2,3,4,5,6,7,8,23,45,67); endchar; + +cmchar "The letter X"; +beginchar("X",13u#,cap_height#,0); +italcorr cap_height#*slant-.25u#; +adjust_fit(cap_serif_fit#,cap_serif_fit#); +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); % lowers 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); endchar; + +cmchar "The letter Y"; +beginchar("Y",13u#,cap_height#,0); +italcorr cap_height#*slant+.45u#; +adjust_fit(cap_serif_fit#,cap_serif_fit#); +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); endchar; + +cmchar "The letter Z"; +beginchar("Z",11u#,cap_height#,0); +italcorr cap_height#*slant-.5u#; +adjust_fit(0,0); +numeric arm_thickness[],z_stem; +if hefty: arm_thickness1=Vround(slab-vair_corr); arm_thickness2=slab; + z_stem=.8[vair,cap_stem]; +else: arm_thickness1=slab; arm_thickness2=vround(slab+vair_corr); + z_stem=.9[vair,cap_stem]; fi +pickup tiny.nib; x3l=x4l=w-x1r=w-x2r; lft x3l=hround u; +top y1=h; y2=min(y1,h-2/3arm_thickness1); +bot y4=0; y3=max(y4,2/3arm_thickness2); +numeric alpha; alpha=diag_ratio(1,z_stem-tiny,y2-y3,x2r-x3l); +penpos1(alpha*(z_stem-tiny),0); penpos2(alpha*(z_stem-tiny),0); +penpos3(alpha*(z_stem-tiny),0); penpos4(alpha*(z_stem-tiny),0); +pair delta; delta=penoffset z3-z2 of currentpen; +fill top lft z1l--z2l+delta---z3l+delta..lft z3l---lft z4l..bot z4l + ---bot rt z4r--z3r-delta---z2r-delta..rt z2r---rt z1r..top z1r + ---cycle; % diagonal +pickup crisp.nib; pos5(arm_thickness1,90); pos6(hair,180); +top y5r=h; x5=x1; lft x6r=hround 1.25u; y6=good.y(y5l-beak)-eps; +arm(5,6,a,beak_darkness**.8,-.4beak_jut); % upper arm and beak +pos7(arm_thickness2,-90); pos8(hair,0); +bot y7r=0; x7=x4; rt x8r=hround(w-.9u); y8=good.y(y7l+1.2beak)+eps; +arm(7,8,b,beak_darkness**.9,.6beak_jut); % lower arm and beak +math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8); endchar; + + % R O M A N U ends % + + + + %=============================================% + % The last characters are from R O M A N L % + %=============================================% + + + +% Computer Modern Roman lower case: +% These letters were originally coded by D. E. Knuth in November, 1979, +% inspired by the Monotype faces used in {\sl The Art of Computer Programming}. +% Sans serif designs by Richard Southall were added in April, 1982. +% The programs were revised for the new \MF\ conventions in 1985. + +% Character codes \0141 through \0172 are generated. + +cmchar "The letter a"; +beginchar("a",9u#,x_height#,0); +bh#:=min(bar_height#,1.14x_height#-bar_height#); define_pixels(bh); +italcorr 1/3[bh#,x_height#]*slant+.5stem#-serif_fit#-2u#; +adjust_fit(0,serif_fit# if serifs: if hair#+.5stem#>1.5u#:-.25u# fi\\fi); +pickup fine.nib; top y3r=h+vround 1.5oo; +if serifs: pos1(flare,180); pos2(hair,180); + pos3(vair,90); lft x1r=hround max(u,2.1u-.5flare); x3=.5w-.5u; + y1=min(bh+.5flare+2vair+2,.9[bh,h]-.5flare); + bulb(3,2,1); % bulb +else: pos1(5/7[vair,flare],95); x1l=good.x 1.5u; x1r:=good.x x1r; + pos3(1/8[vair,thin_join],90); + x3=.5w-.2u; top y1r=vround .82[bh,top y3r]; + filldraw stroke term.e(3,1,left,.9,4); fi % terminal +pos4(stem,0); rt x4r=hround(w-2.5u+.5stem); y4=1/3[bh,h]; +pos5(stem,0); x5=x4; y5=max(.55bh,2vair); +filldraw stroke super_arc.e(3,4)&z4e..z5e; % arc and stem +pos6(.3[thin_join,vair],90); x6=x4; bot y6=bh; +pos7(hround(curve-2stem_corr),180); +lft x7r=hround max(.5u,1.5u-.5curve); y7=1/3[top y8l,top y6r]; +pos8(vair,270); x8l=.5w-.75u; bot y8r=-oo; +pos9(thin_join,360); z9l=z5l; +(x,y8r)=whatever[z8l,z9l]; x8r:=max(x,x8-u); +{{interim superness:=more_super; + filldraw stroke z9e{down}...z8e{left}...{up}z7e&super_arc.e(7,6)}}; % bowl +if serifs: numeric shaved_stem; shaved_stem=hround(stem-3stem_corr); + if hair#+.5stem#>1.5u#: pickup tiny.nib; + pos5'(shaved_stem,0); rt x5'r=fine.rt x5r; y5'=y5; + pos10(shaved_stem,0); x10=x5'; y10=.2[.5tiny,bh]; + pos11(shaved_stem,0); rt x11r=hround(w-.25u); bot y11=0; + pos12(shaved_stem,0); x11=x12; top y12=slab+eps; + filldraw z5'l---z10l...z11l{right}--z11r + --z12r{left}...z10r+.75(z12-z11)---z5'r--cycle; % foot + else: pickup crisp.nib; pos5'(shaved_stem,0); rt x5'r=fine.rt x5r; y5'=y5; + pos10(shaved_stem,0); x10=x5'; y10=1/3bh; + pos11(.2[vair,stem],90); x11r=.5[x10r,x12r]; bot y11l=-vround .5oo; + pos12(hair,180); rt x12l=hround(w-.1u); y12=max(y10,y11+vair); + pos13(hair,180); x13=x12; top y13=max(vround .6bh,top y12); + (x',y11l)=whatever[z11r,z12r]; x11l:=max(x',x10); + filldraw stroke z5'e---z10e...z11e{right}...z12e---z13e; fi % hook +else: numeric shaved_stem; shaved_stem=hround(stem-stem_corr); + pickup tiny.nib; pos5'(shaved_stem,0); rt x5'r=fine.rt x5r; y5'=y5; + pos10(shaved_stem,0); x10=x5'; bot y10=0; + filldraw stroke z5'e--z10e; fi % base of stem +penlabels(1,2,3,4,5,6,7,8,9,10,11,12,13); endchar; + +cmchar "The letter b"; +beginchar("b",10u#+serif_fit#,asc_height#,0); +italcorr .5x_height#*slant+min(.5curve#-u#,-.25u#); +adjust_fit(serif_fit#,0); +pickup tiny.nib; pos1(stem',0); pos2(stem,0); +pos0'(stem',0); pos0(stem,0); z0l=z0'l; x0'=x1; x0=x2; +lft x1l=hround(2.5u-.5stem'); top y1=h; +numeric edge; edge=rt x2r; +pickup fine.nib; pos3(if hefty:thin_join else: hair fi,180); +pos4(vair,90); pos5(curve,0); pos6(vair,-90); penpos7(x3l-x3r,-180); +rt x3l=max(rt x3l-(lft x3r-tiny.lft x2l),1/3[rt x2,edge]); +y3=1/8[bar_height,x_height]; +x4l=w-.5(w-serif_fit)+.5u; top y4r=x_height+oo; +rt x5r=hround min(w-1.35u+.5curve,w-.6u); y5=.5x_height; +x6l=x4l-.2u; bot y6r=-oo; +x7=x3; y7=min(y3,y6+y4-y3+.6vair); +(x,y4r)=whatever[z3l,z4l]; x4r:=min(x,.5[x4,x5r]); +(x',y6r)=whatever[z7l,z6l]; x6r:=min(x',.5[x6,x5r]); +filldraw stroke z3e{up}...pulled_arc.e(4,5)&pulled_arc.e(5,6)...{up}z7e; % bowl +y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{right}z4l)); +y2=ypart(((edge,h)--(edge,0))intersectionpoint(z6l{left}...{up}z7l)); +pickup tiny.nib; filldraw stroke z1e--z0'e--z0e--z2e; % stem +pickup crisp.nib; pos8(hair,0); pos7'(stem,0); +z7'=z2; x8l=x7'l; bot y8=0; +filldraw stroke z7'e--z8e; % point +if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); fi % upper serif +penlabels(0,1,2,3,4,5,6,7,8); endchar; + +cmchar "The letter c"; +beginchar("c",8u#,x_height#,0); +italcorr x_height#*slant-.2u#; +adjust_fit(if monospace: .5u#,.5u# else: 0,0 fi); +pickup fine.nib; pos2(vair',90); pos4(vair',270); +x2=x4=.5(w+u); top y2r=vround(h+1.5oo); bot y4r=-oo; +pos3(curve,180); lft x3r=hround max(.6u,1.35u-.5curve); y3=.5h; +if serifs: pos1(hair,0); pos0(flare,0); + y1=min(bar_height+.5flare+2vair'+2,.9[bar_height,h]-.5flare); + rt x1r=hround(w-.7u); bulb(2,1,0); % bulb + pos5(hair,0); rt x5r=hround(w-.5u); + y5=max(good.y(.5bar_height-.9),y4l+vair'); + (x,y4l)=whatever[z4r,z5l]; x4l:=min(x,x4l+.5u); + filldraw stroke pulled_super_arc.e(2,3)(.7superpull) + & pulled_super_arc.e(3,4)(.5superpull) + ..tension .9 and 1..{x5-x4,5(y5-y4)}z5e; % arc and lower terminal +else: pos1(4/7[vair',flare],80); + rt x1r=hround(w-.6u); top y1r=vround .82[bar_height,top y2r]; + filldraw stroke term.e(2,1,right,.8,4); % upper terminal + pos5(.6[vair',flare],275); rt x5r=hround(w-.5u); + y5r=good.y(y5r+1/3bar_height-y5); y5l:=good.y y5l; x5l:=good.x x5l; + forsuffixes e=l,r: path p.e; p.e=z4e{right}..tension .9 and 1..z5e; + if angle direction 1 of p.e>75: + p.e:=z4e{right}..tension atleast.9 and 1..{dir 75}z5e; fi endfor + filldraw stroke pulled_super_arc.e(2,3)(.7superpull) + & pulled_super_arc.e(3,4)(.5superpull) & p.e; fi % arc and lower terminal +penlabels(0,1,2,3,4,5); endchar; + +cmchar "The letter d"; +beginchar("d",10u#+serif_fit#,asc_height#,0); +italcorr asc_height#*slant-serif_fit#+.5stem#-2u#; +adjust_fit(0,serif_fit#); +pickup tiny.nib; pos1(stem',0); pos2(stem,0); +pos0'(stem',0); pos0(stem,0); z0r=z0'r; x0'=x1; x0=x2; +rt x1r=hround(w-2.5u+.5stem'); top y1=h; +numeric edge; edge=lft x2l; +pickup fine.nib; pos3(if hefty:thin_join else: hair fi,0); +pos4(vair,90); pos5(curve,180); pos6(vair,270); penpos7(x3r-x3l,360); +lft x3l=min(lft x3l-(rt x3r-tiny.rt x2r),1/3[lft x2,edge]); +y3=1/8[bar_height,x_height]; +x4l=.5(w-serif_fit)-.3u; top y4r=x_height+oo; +lft x5r=hround max(1.35u-.5curve,.6u); y5=.5x_height; +x6l=x4l-.2u; bot y6r=-oo; +x7=x3; y7=min(y3,y6+y4-y3+.6vair); +(x,y4r)=whatever[z3l,z4l]; x4r:=max(x,.5[x5r,x4]); +(x',y6r)=whatever[z7l,z6l]; x6r:=max(x',.5[x5r,x6]); +filldraw stroke z3e{up}...pulled_arc.e(4,5) + & pulled_arc.e(5,6)...{up}z7e; % bowl +y0=ypart(((edge,h)--(edge,0))intersectionpoint(z3l{up}...{left}z4l)); +pickup tiny.nib; bot y2=if serifs:-min(oo,serif_drop) else: 0 fi; +filldraw stroke z1e--z0'e--z0e--z2e; % stem +if serifs: sloped_serif.l(1,0',a,1/3,jut,serif_drop); % upper serif + sloped_serif.r(2,0,b,1/3,jut,min(oo,serif_drop)); fi % lower serif +penlabels(0,1,2,3,4,5,6,7); endchar; + +cmchar "The letter e"; +beginchar("e",7.25u#+max(.75u#,.5curve#),x_height#,0); +italcorr .5[bar_height#,x_height#]*slant+.5min(curve#-1.5u#,0); +adjust_fit(if monospace: .25u#,.5u# else: 0,0 fi); +numeric left_curve,right_curve; +left_curve=right_curve+6stem_corr=curve if not serifs: -3stem_corr fi; +if right_curvenotch_cut: y0:=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+jut+.5u+1<=lft x4'l-jut: inner_jut=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 +penlabels(0,1,2,3,4); endchar; + +cmchar "The letter w"; +beginchar("w",13u#,x_height#,0); +italcorr x_height#*slant+.25u#; +adjust_fit(serif_fit#,serif_fit#); +numeric stem[],outer_jut,upper_notch,alpha,mid_corr; +outer_jut=.7jut; x1l=w-x8r=l+letter_fit+outer_jut+.25u; +stem1=fudged.stem-stem_corr; +stem4=min(fudged.hair if hefty:-2stem_corr fi,stem1); +stem2=if hefty:.1[vair,stem4] else: stem4 fi; +stem3=max(stem2,stem1-3stem_corr); +x2-x1=x4-x3=x6-x5=x8-x7; x2l+apex_corr=x3l; x6l+apex_corr=x7l; +y1=y8=h; y2=y3=y6=y7=-apex_oo; +y4=y5=if monospace: vround .6 fi\\ h; upper_notch=y4-notch_cut; +mid_corr=if monospace or hefty:-.3apex_corr else: .5jut fi; +alpha=diag_ratio(4,stem2-stem3+stem4,y1-y2,x8r-x1l+mid_corr-2apex_corr); +penpos1(alpha*stem1,0); penpos2(alpha*stem1,0); +penpos3(alpha*stem2,0); penpos4(alpha*stem2,0); +penpos5(alpha*stem3,0); penpos6(alpha*stem3,0); +penpos7(alpha*stem4,0); penpos8(alpha*stem4,0); +x4l-x1l=floor(x4l-x1l+.5(x5r+mid_corr-x4r)); % |x5r| $\approx$ |x4r+mid_corr| +z23=whatever[z1r,z2r]=whatever[z3l,z4l]; +z45=whatever[z3r,z4r]=whatever[z5l,z6l]; +z67=whatever[z5r,z6r]=whatever[z7l,z8l]; +fill diag_end(1l,2l,1,1,3r,4r){z4-z3} + ...if y45notch_cut:(x67,notch_cut)+.5right{down} + --(x67,notch_cut)+.5left{up} else: z67&z67 fi + ...{z5-z6}special_diag_end(6,5,4,3){z3-z4} + ...if y23>notch_cut:(x23,notch_cut)+.5right{down} + --(x23,notch_cut)+.5left{up} else: z23&z23 fi + ...{z1-z2}diag_end(2r,1r,1,1,1l,2l)--cycle; % diagonals +if serifs: numeric inner_jut[]; pickup tiny.nib; + prime_points_inside(1,2); prime_points_inside(5,6); prime_points_inside(8,7); + if monospace: inner_jut1=inner_jut4=1.5jut; + elseif hefty: inner_jut1=inner_jut4=jut; + else: fill diag_end(6r,5r,1,1,5l,6l)--.5[z5l,z6l] + --.5[z5r,z6r]--cycle;% middle stem + inner_jut2=.7inner_jut1; inner_jut4=1.1inner_jut3; + if rt x1'r+jut+.5u+1<=lft x5'l-.7jut: inner_jut1=jut; + else: rt x1'r+inner_jut1+.5u+1=lft x5'l-inner_jut2; fi + if rt x5'r+jut+.5u+1<=lft x8'l-1.1jut: inner_jut3=jut; + else: rt x5'r+inner_jut3+.5u+1=lft x8'l-inner_jut4; fi + dish_serif(5',6,e,1/3,inner_jut2,f,1/2,inner_jut3); fi % middle serif + dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut1); % left serif + dish_serif(8',7,c,.6,inner_jut4,d,1/2,outer_jut)(dark); fi % right serif +penlabels(0,1,2,3,4,5,6,7,8,23,45,67); endchar; + +cmchar "The letter x"; +beginchar("x",if serifs:9.5u# else:9u# fi,x_height#,0); +italcorr x_height#*slant-.05u#; +adjust_fit(serif_fit# if monospace:+\\.5u#,.5u#+ else:,fi\\ serif_fit#); +numeric stem[],outer_jut,xjut,alpha[]; +stem1=fudged.stem-4stem_corr; stem2=min(fudged.hair,stem1); +outer_jut=.75jut; xjut= if serifs: (stem1-stem2)/4 else: 0 fi; +x1l=l+letter_fit+.1u+outer_jut; x2r=r-letter_fit-.3u-outer_jut-xjut; +x3l=l+letter_fit+outer_jut+xjut; x4r=r-letter_fit-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$'=.2[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+jut+.5u+1<=lft x2'l-jut-xjut: inner_jut1=jut; + else: rt x1'r+inner_jut1+.5u+1=lft x2'l-inner_jut1-xjut; fi + if rt x3'r+jut+.5u+1<=lft x4'l-jut-xjut: inner_jut2=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 +penlabels(0,1,2,3,4,12,13,24,34); endchar; + +cmchar "The letter y"; +beginchar("y",if serifs:9.5u# else:9u# fi,x_height#,desc_depth#); +italcorr x_height#*slant+.25u#; +adjust_fit(serif_fit# if monospace:+\\.5u#,.5u#+ else:,fi\\ serif_fit#); +numeric left_stem,right_stem,bot_stem,bot_vair,outer_jut; +left_stem=fudged.stem-stem_corr; +right_stem=fudged.hair if hefty:-2stem_corr fi; +bot_stem=fudged.hair if hefty:-8stem_corr fi; +bot_vair=Vround(if serifs: vair else:.5[vair,bot_stem] fi); +outer_jut=.75jut; +x1l=w-x4r=l+letter_fit+outer_jut+.25u; y1=y4r=h; y2=y3=0; x2l=x3l; +numeric alpha,alpha[]; x9=3u; y9=bot_vair-d-oo; +alpha1=diag_ratio(2,bot_stem,y1-y3,x4r-x1l-apex_corr); +alpha2=diag_ratio(1,bot_stem,y1-y9,x4r-x9); +if alpha1notch_cut: y0:=notch_cut; + fill z0+.5right{up}...{z4r-z3r}diag_end(0,4l,1,1,4r,3r) + --z3r--z2l--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)--z3r--z2l + --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals +penpos5(alpha*bot_stem,0); z5r=whatever[z3r,z4r]; y5-.5vair=-.5d; +if serifs: numeric light_bulb; light_bulb=hround 7/8[hair,flare]; clearpen; + penpos6(vair,-90); penpos7(hair,-180); penpos8(light_bulb,-180); + x6=2u; y6r=-d-oo; y8-.5light_bulb=-.85d; x8r=hround .35u; + fill stroke z3e---z5e...{left}z6e; bulb(6,7,8); % arc and bulb + numeric inner_jut; pickup tiny.nib; + prime_points_inside(1,2); prime_points_inside(4,3); + if rt x1'r+jut+.5u+1<=lft x4'l-jut: inner_jut=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); % right serif +else: penpos6(bot_vair,-90); x6=2.5u; y6r=-d-oo; + fill stroke z3e---z5e...{left}z6e; % arc + pickup fine.nib; pos6'(bot_vair,-90); z6'=z6; + pos7(2/3[bot_vair,flare],-85); + lft x7l=hround u; bot y7r=vround-.96d-oo; y7l:=good.y y7l; + filldraw stroke term.e(6',7,left,1,4); fi % arc and terminal +penlabels(0,1,2,3,4,5,6,7,8,9); endchar; + +cmchar "The letter z"; +beginchar("z",8u#,x_height#,0); +italcorr x_height#*slant-.5serif_fit#-.3u#; +adjust_fit(0,.5serif_fit#); +numeric arm_thickness[],z_stem; +if hefty: arm_thickness1=Vround(vair-vair_corr); arm_thickness2=vair; + z_stem=.6[vair,stem]; +else: arm_thickness1=vair; arm_thickness2=vair'; z_stem=.9[vair,stem]; fi +pickup tiny.nib; rt x1r=rt x2r=hround(w-.8u); lft x3l=lft x4l=hround .5u; +top y1=h; y2=min(y1,h-2/3arm_thickness1); +bot y4=0; y3=max(y4,2/3arm_thickness2); +numeric alpha; alpha=diag_ratio(1,z_stem-tiny,y2-y3,x2r-x3l-slant*(y2-y3)); +penpos1(alpha*(z_stem-tiny),0); penpos2(alpha*(z_stem-tiny),0); +penpos3(alpha*(z_stem-tiny),0); penpos4(alpha*(z_stem-tiny),0); +pair delta; delta=penoffset z3-z2 of currentpen; +fill top lft z1l--z2l+delta---z3l+delta..lft z3l---lft z4l..bot z4l + ---bot rt z4r--z3r-delta---z2r-delta..rt z2r---rt z1r..top z1r + ---cycle; % diagonal +pickup crisp.nib; pos5(arm_thickness1,90); pos6(hair,180); +top y5r=h; x5=x1; lft x6r=hround .75u; y6=good.y(y5l-beak/1.4)-eps; +arm(5,6,a,beak_darkness,-.4beak_jut); % upper arm and beak +pos7(arm_thickness2,-90); pos8(hair,0); +bot y7r=0; x7=x4; rt x8r=hround(w-.75u); y8=good.y(y7l+beak/1.2)+eps; +arm(7,8,b,beak_darkness,.6beak_jut); % lower arm and beak +penlabels(1,2,3,4,5,6,7,8); endchar; + + % R O M A N L ends % + + +font_x_height x_height#; +if monospace: font_normal_space 9u#; % no stretching or shrinking + font_quad 18u#; + font_extra_space 9u#; +else: font_normal_space 6u#+2letter_fit#; + font_normal_stretch 3u#; font_normal_shrink 2u#; + font_quad 18u#+4letter_fit#; + font_extra_space 2u#; + k#:=-.5u#; kk#:=-1.5u#; kkk#:=-2u#; % three degrees of kerning + ligtable "k": if serifs: "v": "a" kern -u#, fi\\"w": "e" kern k#, + "a" kern k#, "o" kern k#, "c" kern k#; + ligtable "P": "A" kern kk#, + "y": "o" kern k#, "e" kern k#, "a" kern k#, "." kern kk#, "," kern kk#; + ligtable "F": "V": "W": if serifs: "o" kern kk#, "e" kern kk#, "u" kern kk#, + "r" kern kk#, "a" kern kk#, "A" kern kkk#, + else: "o" kern k#, "e" kern k#, "u" kern k#, + "r" kern k#, "a" kern k#, "A" kern kk#, fi + "K": "X": "O" kern k#, "C" kern k#, "G" kern k#, "Q" kern k#; + ligtable "T": "y" kern if serifs: k# else: kk# fi, + "Y": "e" kern kk#, "o" kern kk#, + "r" kern kk#, "a" kern kk#, "A" kern kk#, "u" kern kk#; + ligtable "O": "D": "X" kern k#, "W" kern k#, "A" kern k#, + "V" kern k#, "Y" kern k#; + if serifs: ligtable "h": "m": "n": + "t" kern k#, "u" kern k#, "b" kern k#, "y" kern k#, "v" kern k#, "w" kern k#; + ligtable "c": "h" kern k#, "k" kern k#; fi + ligtable "o": "b": "p": "e" kern -k#, "o" kern -k#, "x" kern k#, + "d" kern -k#, "c" kern -k#, "q" kern -k#, + "a": if serifs: "v" kern k#, "j" kern u#, else: "r" kern k#, fi + "t": "y" kern k#, + "u": "w" kern k#; + ligtable "A": if serifs: "R": fi\\ "t" kern k#, + "C" kern k#, "O" kern k#, "G" kern k#, "U" kern k#, "Q" kern k#, + "L": "T" kern kk#, "Y" kern kk#, "V" kern kkk#, "W" kern kkk#; + ligtable "g": "j" kern -k#; % logjam + ligtable "I": "I" kern -k#; % Richard III +fi; +bye. + diff --git a/fonts/apl/cmapl10.tfm b/fonts/apl/cmapl10.tfm new file mode 100644 index 0000000000..1cecac3c3f Binary files /dev/null and b/fonts/apl/cmapl10.tfm differ diff --git a/fonts/apl/convert.pas b/fonts/apl/convert.pas new file mode 100644 index 0000000000..8a5b619505 --- /dev/null +++ b/fonts/apl/convert.pas @@ -0,0 +1,117 @@ + +%============================================================================ +% C O N V E R T . P A S +%============================================================================ + +% This is a sample Turbo Pascal program for HeX-->Bin conversion useful +% for a safe download of pixel files (Turbo Pascal 3.0) + +PROGRAM ASC_TO_BIN(Input,Output,Font_List_File); + + TYPE + + Byte = 0..255; + Name_Of_File = String[20]; + + + VAR + + Newfile:File Of Byte; + Textfile,Font_List_File:Text; + First_Hex,Second_Hex,Ch:Char; + One_Byte:Byte; + I:Integer; + Font_Name,File_Name,New_File_Name:Name_Of_File; + + +PROCEDURE Banner; + + Begin + Writeln('!=================================================!'); + Writeln('! The text files to be converted must have been !'); + Writeln('! originally obtained as follows: each byte is !'); + Writeln('! replaced by two hexadecimals, the first of which!'); + Writeln('! is Byte Div 16 and the second Byte Mod 16. The !'); + Writeln('! names of files are supposed to be found in a !'); + Writeln('! separate list file. !'); + Writeln('!=================================================!'); + End; + + +FUNCTION Convert_Hex_To_Dec(X:Char):Integer; + + Begin + If X In ['0'..'9'] Then Convert_Hex_To_Dec:=Ord(X)-48 + Else Convert_Hex_To_Dec:=Ord(X)-55; + End; + + + + +PROCEDURE Convert_File(Var File_Name,New_File_Name:Name_Of_File); + +VAR + +A,B,I:Integer; + + + Begin + Assign(Textfile,File_Name); + {$I-} Reset(Textfile) {$I+}; + If IOresult=0 Then + Begin + Assign(Newfile,New_File_Name); + Rewrite(Newfile); + While Not Eof(Textfile) Do + Begin + While Not Eoln(Textfile) Do + Begin + Read(Textfile,First_Hex); + Read(Textfile,Second_Hex); + A:=Convert_Hex_To_Dec(First_Hex); + B:=Convert_Hex_To_Dec(Second_Hex); + One_Byte:=(16*A)+B; + If Eoln(Textfile) Then Readln(Textfile); + Write(Newfile,One_Byte); + End; + End; + For I:=0 To 30-Length(New_File_Name) Do Write('.'); + Writeln(New_File_Name,' written'); + Close(Textfile); + Close(Newfile); + End Else + Writeln('This File Not Found!'); + End; + + (*** M A I N P R O G R A M ***) +BEGIN + + Banner; + Writeln; + Writeln('Give The Name Of File Containing The List Of Pxl Files: '); + Readln(File_Name); + Assign(Font_List_File,File_Name); + {$I-} Reset(Font_List_File) {$I+}; + If IOresult=0 Then + Begin + Writeln; + Writeln('... started converting ...'); + Writeln; + While Not Eof(Font_List_File) Do + Begin + Font_Name:=''; + While Not Eoln(Font_List_File) Do + Begin + Read(Font_List_File,Ch); + Font_Name:=Font_Name+Ch; + End; + Write(Font_Name); + New_File_Name:=Copy(Font_Name,1,Pos('.',Font_Name)-1)+'.bxl'; + Readln(Font_List_File); + Convert_File(Font_Name,New_File_Name); + End; + Writeln; + Writeln('... conversion done ...'); + End Else + Writeln('File List Not Found!'); +END. diff --git a/fonts/apl/fontnotes b/fonts/apl/fontnotes new file mode 100644 index 0000000000..967c6f33db --- /dev/null +++ b/fonts/apl/fontnotes @@ -0,0 +1,97 @@ + + + These files contain the necessary material for producing +APL documents with TeX. It should be pointed out that as written +in an article published in TUGboat, the system as such can be +described as a straightforward solution to the problem of making +nice documents containing APL code. Instead of trying to achieve +a completed result, we tell the reader how to use existing MetaFont +character descriptions as far as possible to provide an APL font +of reasonably fine quality. Further development is left to the users. +Combined with suitable TeX macros using Digital's mnemonics -- chosen +because of the popularity of the interpreter among APL users +(it is really the only one used at our site) -- the font can be used +smoothly enough. Furthermore, if combined with an APL workspace +providing functions for an automatic conversion of APL workspaces +into TeX code, the system can be used to merge pre-existing +APL code into documents without the pain of re-writing the code +in Digital's 2-letter mnemonics. + To produce pixel files from the MetaFont file CMAPL10.MF, +you have to run MetaFont in your local machine. By typing METAFONT +you should get the prompt symbol '*'. It may be necessary to use +the form + + METAFONT\INPUT_DIRECTORY = XXXXXX + +where XXXXXX is the global name of the directory where the basic +CMMF definitions can be found. +The following discussion will then get MetaFont to produce a generic +font file CMAPL10.360GF: + + * \relax; + * \mode = imagen; + * \mag = 1.2; + * input cmapl10 + +Here \mode = imagen was used to get a pixel file for a laserprinter +with the resolution 200 times 200 pixels per square inch. It is +possible that the definition of 'imagen' is different at your local +site; in the case of error ask the person who installed your local +MetaFont. Notice that \mag = 1.2 is needed in case you want to get +magnified pixels. The final pixel (because of the resolution 200) +files will then be named CMAPL10.1800PXL (or whatever you choose +to call them). If you want to produce 'small' pixel files for example +for a screen previewer, use \mag = xxx with an appropriate constant xxx. +(You can check the form of characters obtained on a teletype terminal +by using the program GFTYPE.) Finally, you get a pixel file from +CMAPL10.xxxGF by running the program GF(TO)PXL.EXE, which should be +found together with MetaFont. + Some people want to use their pixel files on a PC (the +laserprinter is connected to a PC or for previewing purposes). In +that case the pixel files must be downloaded from the host. We never +use programs like Kermit for transferring the binary file but +first convert it to hex form, load the file down as a text file and +then convert it back. It is IMPORTANT to notice that pixel files in +VAXes (say) are composed of 512 byte blocks. The pixel file itself +is ended by the pixel_id, which is either 1001 (rasters are in word packed +form) or 1002 (rasters are in byte packed form). Many programs running +on PCs assume that the last 4 bytes of the pixel file really +represent the pixel_id. Hence, the pixel files downloaded from the host +should be CLEANed from garbage (the programs CONVERT and CLEAN are +given for convenience and to fix the definition of what they should do). + MetaFont also produces the file CMAPL10.TFM containing the +metric information of the characters in the font. These are needed +by TeX, and they can be downloaded as such (at least if you are +using Micro-TeX or PCTeX). + + In order to use the mnemonics, the macros in APLSTYLE are +needed. There are basically two ways of merging APL code. There are +standard macros called VERBATIM, which enable the user to produce +'typewriter-like' output. As APL is modelled on a typewriter style, +too, it has been reasonable to extend VERBATIM to accept different +typewriter-like fonts. The escape sequence \choosett enables you to +choose the font you want to use. Thus, \choosett{tentt} swithces +the standard font CMTT10 on, whereas \choosett{apl} chooses the font +APL, defined in APLSTYLE by '\font\apl = cmapl10'. First, you can +insert APL code into text lines. In this case you can call any +APL symbol either by its 2-letter mnemonic (for example \BX produces the +box symbol) if there is no symbol for it OR otherwise by its name +surrounded by two @'s. (The @ character swithces into the current +typewriter style.) Thus, @A_B@ produces 'A <-- B' in APL style, because +'_' is the name of '<--' in Digital's mnemonics. Secondly, you can +insert APL code in 'screenlike' mode. The code is to be delimited +by the pair \begintt - \endtt. Example: + +\begintt + @DL Z_ZNPLUS N;@BXIO % Here '@' replaces '\' as the escape +[1] @BXIO_0 % character +[2] Z_N@AB(@ION)@SO.+@ION + @DL +\endtt + +Please note that in this case the material between \begintt -- \endtt +is considered by TeX as a vertical box that cannot be divided between +pages. Thus, if you have a long APL function, it might produce +a message of underfull vbox. + + diff --git a/fonts/apl/ninesize.tex b/fonts/apl/ninesize.tex new file mode 100644 index 0000000000..a0260f0799 --- /dev/null +++ b/fonts/apl/ninesize.tex @@ -0,0 +1,34 @@ + +%============================================================================= +% N I N E S I Z E . T E X (for convenience only) +%============================================================================= +%=============================================================== +% This is a TeX macro for switching to nine point fonts. Taken +% from the TeXbook, pages 413 - 415. (For special cases only) +%=============================================================== +% +\font\ninerm=amr9 +\font\ninei=ammi9 +\font\ninesy=amsy9 +\font\ninebf=ambx9 +\font\ninett=amtt9 +\font\nineit=amti9 +\font\ninesl=amsl9 +% +\skewchar\ninei='177 +\skewchar\ninesy='60 +\skewchar\ninett=-1 +% +\newskip\tglue +\def\ninepoint{\def\rm{\fam0\ninerm} + \textfont0=\ninerm + \textfont1=\ninei + \textfont2=\ninesy + \textfont\itfam=\nineit \def\it{\fam\itfam\nineit}% + \textfont\slfam=\ninesl \def\sl{\fam\slfam\ninesl}% + \textfont\ttfam=\ninett \def\tt{\fam\ttfam\ninett}% + \textfont\bffam=\ninebf \def\bf{\fam\bffam\ninebf}% + \tt\tglue=.5em plus.25em minus .15em + \normalbaselineskip=11pt + \setbox\strutbox=\hbox{\vrule height8pt depth3pt width0pt}% + \let\sc=\sevenrm \let\big=\ninebig \normalbaselines\rm}% diff --git a/fonts/apl/problems.tex b/fonts/apl/problems.tex new file mode 100644 index 0000000000..3f47553ea3 --- /dev/null +++ b/fonts/apl/problems.tex @@ -0,0 +1,316 @@ + +%=================================================================== +% Sample problems; solutions give examples on using APL style in TeX +% Taken from the course ``Mathematics on the Computer'', Fall 87 +%=================================================================== + +\magnification = \magstep1 + +\advance\vsize by 3truecm + +\input mssymb % for some math symbols only! This is the new + % symbol font for some standard and non-standard + % mathematical symbols. It is only used here for + % blackboard bold letters. If you dont have it, + % just define \def\Bbb{} etc. + +\input aplstyle + +\choosett{apl} + +\font\sans = amss10 +\font\sltt = amsltt10 + +\def\header{{\sans Sample problems 9.\ 10.\ 1987}} +% some of them come from Sims' ``Abstract Algebra, A Computational Approach'' +\def\APL{{\sltt APL}} + +\nopagenumbers +\tolerance = 300 +\noindent +\header + +\vskip 2cm + +\item{1.} Let $N>1$ be an integer. Show that each of the following + matrices represents a binary operation on + $S(N)$ (we set locally \BX@IO_0@.) Which of them are + associative, which commutative? + \medskip + + \itemitem{a)} @(@\IO@N)@\SO@.@\CE\IO@N@ + + \itemitem{b)} \AB@(@\IO@N)@\SO@.-@\IO@N@ + + \itemitem{c)} @N@\AB@(@\IO@N)@\SO@.+@\IO@N@ + + \itemitem{d)} @N@\AB@(@\IO@N)@\SO@.#@\IO@N@ + + \medskip +\item{} Here @x@\CE@y@ is $\max(x,y)$, @x@\AB@y@ is + $y\bmod x$ and \AB@x@ is the absolute value of $x$. + +\bigskip + +\item{2.} Write an \APL\ function @GPOWER@ that computes for a group + @G@ (global variable) the $n$-th power of a given element $x$. + (If $S(M)$ is a representation vector of @G@, then + @GPOWER@ is a map $S(M)\times \Bbb Z\to S(M)$. Simply + use iteration.) + +\bigskip + +\item{3.} (Continuing problem 2.) A faster algorithm is obtained by + decomposing $x^n$ into its 2--base form + $x^n = x^{i_0}\times x^{2i_1}\times + x^{4i_2}\times ... \times x^{{2^k}i_k}$, where $i_j\in\{0,1\}$. Show + that the complexity of this algorithm is $O(\log_2(n))$. + (Show that the number of necessary multiplications does + not exceed $2\log_2(n)$). How would you write the corresponding + function in \APL? (Note that the binary representation of $n$ + can be obtained by applying iteratively the procedure $n\bmod 2$.) + +\bigskip + +\item{4.} Write an \APL\ function @GTSGP@ that computes for a given group @G@ + (global variable) the subgroup generated by a given subset $A$. The + function @GTSGP@ has one argument (the vector @A@) and returns + a subset of the set $S(N)$ (as a vector). (Extend the set @A@ + by the group operation until @A@ becomes closed with respect + to the operation.) + +\bigskip + +\item{5.} Write an \APL\ function @INV@ that returns for a group @G@ + the vector of inverse elements as a vector $S(N)\to S(N)$ so + that the index of the inverse of $x_i$ is @(INV G)[I]@. + +\bigskip + +\item{6.} Let $(G,\theta)$ be a group and let $A$ be a subset of $G$. Program + the following algorithm in \APL\ to find the subgroup @H@ + generated by @A@. Compare the perfomance of this algorithm + with the algorithm in Problem 4. + \medskip + + \itemitem{a)} put $H$ and $Y$ equal to $\{e\}$. + + \itemitem{b)} let $Y$ be $YA\smallsetminus H$. + + \itemitem{c)} if $Y=\emptyset$, stop. + + \itemitem{d)} put $H$ equal to $H\cup Y$ and + go to (b). + + \medskip +\item{} ($e$ is the neutral element and $YA\smallsetminus H$ + is the set--theoretical difference of $YA$ and $H$. + The product $YA$ is the set $\{y\theta a: y\in Y, a\in A\}$.) + +\bigskip + +\item{7.} Write an \APL\ function @PROD@ that returns for given groups + $(G_1,\theta_1)$ ja $(G_2,\theta_2)$ the {\sl direct product} + $(G_1\times G_2,\theta_1\times\theta_2)$ as a group table. + (The binary operation in the product is $(x,y)\theta_1\times\theta_2 + (z,w) = (x\theta_1 z,y\theta_2 w)$). + +\bigskip + +\vfill\eject + +%========================================================================== +% Solutions to above sample exercises +%========================================================================== + +%\advance\vsize by 3truecm + +\choosett{apl} + +\noindent +\header%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\vskip 1cm + +\noindent +As the index of the neutral element we use the index origin \BX@IO@ which +usually has the value @0@. Then $S(N)= +\{0,\dots,N-1\}$, given by the vector \IO@N@. +An example on groups are the cyclic groups $({\bf Z}_n,+)$ +the group tables of which are generated by the \APL\ function @ZNPLUS@: + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + @DL Z_ZNPLUS N;@BXIO +[1] @BXIO_0 +[2] Z_N@AB(@ION)@SO.+@ION + @DL +\endtt +}\smallskip + +\item{1.} The matrices represent binary operations of $S(N)$, + since they are $N\times N$-matrices with elements from + $S(N)$. They are all associative and also commutative except for + the case (b). This can be seen by the function @TEST@: + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + @DL Z_TEST B +[1] " B IS A BINARY OPERATION. THE FUNCTION RETURNS A BOOLEAN 2-VECTOR +[2] " (B ASSOCIATIVE, B COMMUTATIVE) +[3] Z_(&/&/&/B[B;]=B[;B]),&/&/B=@TRB + @DL +\endtt +}\smallskip + +\item{2.} + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + @DL P_X GPOWER N;I +[1] " G GLOBAL +[2] P_@BXIO @DM I_0 +[3] TEST:@GO(NJ_J+1)/CORE +[6] @GO(N>I_I+1)/JLOOP + @DL +\endtt +} + +Example: + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + (ZNPLUS 2) PROD ZNPLUS 10 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 1 2 3 4 5 6 7 8 9 0 11 12 13 14 15 16 17 18 19 10 + 2 3 4 5 6 7 8 9 0 1 12 13 14 15 16 17 18 19 10 11 + 3 4 5 6 7 8 9 0 1 2 13 14 15 16 17 18 19 10 11 12 + 4 5 6 7 8 9 0 1 2 3 14 15 16 17 18 19 10 11 12 13 + 5 6 7 8 9 0 1 2 3 4 15 16 17 18 19 10 11 12 13 14 + 6 7 8 9 0 1 2 3 4 5 16 17 18 19 10 11 12 13 14 15 + 7 8 9 0 1 2 3 4 5 6 17 18 19 10 11 12 13 14 15 16 + 8 9 0 1 2 3 4 5 6 7 18 19 10 11 12 13 14 15 16 17 + 9 0 1 2 3 4 5 6 7 8 19 10 11 12 13 14 15 16 17 18 +10 11 12 13 14 15 16 17 18 19 0 1 2 3 4 5 6 7 8 9 +11 12 13 14 15 16 17 18 19 10 1 2 3 4 5 6 7 8 9 0 +12 13 14 15 16 17 18 19 10 11 2 3 4 5 6 7 8 9 0 1 +13 14 15 16 17 18 19 10 11 12 3 4 5 6 7 8 9 0 1 2 +14 15 16 17 18 19 10 11 12 13 4 5 6 7 8 9 0 1 2 3 +15 16 17 18 19 10 11 12 13 14 5 6 7 8 9 0 1 2 3 4 +16 17 18 19 10 11 12 13 14 15 6 7 8 9 0 1 2 3 4 5 +17 18 19 10 11 12 13 14 15 16 7 8 9 0 1 2 3 4 5 6 +18 19 10 11 12 13 14 15 16 17 8 9 0 1 2 3 4 5 6 7 +19 10 11 12 13 14 15 16 17 18 9 0 1 2 3 4 5 6 7 8 +\endtt +} + +\end diff --git a/fonts/apl/readme b/fonts/apl/readme new file mode 100644 index 0000000000..4e429b26a5 --- /dev/null +++ b/fonts/apl/readme @@ -0,0 +1,28 @@ +Thank you for your letter of 27 February. The original purpose +of our APL font and macros was to solve the immediate problem +of writing documents with APL code. Therefore, they are free for +anyone who finds them useful. Some people have requested the font +and we have sent them the files appended below (with CMAPL10 and +two conversion programs for downloading pixel files, not given here). +Further, we have nothing against giving our net address to the +users because it would be useful to hear about extensions made +to the system. + +The files APLDEF.TEX and TUGBOAT.TEX are identical with the second +versions sent to you (via BITNET) except for minimal changes (there +are some corrections and extensions in APLDEF.TEX, and in +TUGBOAT.TEX one APL line was corrected.) We think the files are +in a "final" form (at least we are not planning any changes). + +Our original purpose was to publish the second version, but the only +difference was really the removal of the tilde space character (this +resulted in more complex 1-character macros, but the user cannot +see any difference; moreover, TeX runs only about 14% slower). Thus, +we feel that there is no reason to publish a list of errata in +TUGboat, because any user would inevitably have to use the new +version (the old one has not been released). + +We are adding a file containing sample examples on the use of the +APL mnemonics. + +Aarno Hohti diff --git a/fonts/apl/readme.txt b/fonts/apl/readme.txt new file mode 100644 index 0000000000..4d939552a3 --- /dev/null +++ b/fonts/apl/readme.txt @@ -0,0 +1,129 @@ +Thank you for your letter of 27 February. The original purpose +of our APL font and macros was to solve the immediate problem +of writing documents with APL code. Therefore, they are free for +anyone who finds them useful. Some people have requested the font +and we have sent them the files appended below (with CMAPL10 and +two conversion programs for downloading pixel files, not given here). +Further, we have nothing against giving our net address to the +users because it would be useful to hear about extensions made +to the system. + +The files APLDEF.TEX and TUGBOAT.TEX are identical with the second +versions sent to you (via BITNET) except for minimal changes (there +are some corrections and extensions in APLDEF.TEX, and in +TUGBOAT.TEX one APL line was corrected.) We think the files are +in a "final" form (at least we are not planning any changes). + +Our original purpose was to publish the second version, but the only +difference was really the removal of the tilde space character (this +resulted in more complex 1-character macros, but the user cannot +see any difference; moreover, TeX runs only about 14% slower). Thus, +we feel that there is no reason to publish a list of errata in +TUGboat, because any user would inevitably have to use the new +version (the old one has not been released). + +We are adding a file containing sample examples on the use of the +APL mnemonics. + +Aarno Hohti + + + +%================================================================= +% R E A D M E . T X T +%================================================================= + + These files contain the necessary material for producing +APL documents with TeX. It should be pointed out that as written +in an article published in TUGboat, the system as such can be +described as a straightforward solution to the problem of making +nice documents containing APL code. Instead of trying to achieve +a completed result, we tell the reader how to use existing MetaFont +character descriptions as far as possible to provide an APL font +of reasonably fine quality. Further development is left to the users. +Combined with suitable TeX macros using Digital's mnemonics -- chosen +because of the popularity of the interpreter among APL users +(it is really the only one used at our site) -- the font can be used +smoothly enough. Furthermore, if combined with an APL workspace +providing functions for an automatic conversion of APL workspaces +into TeX code, the system can be used to merge pre-existing +APL code into documents without the pain of re-writing the code +in Digital's 2-letter mnemonics. + To produce pixel files from the MetaFont file CMAPL10.MF, +you have to run MetaFont in your local machine. By typing METAFONT +you should get the prompt symbol '*'. It may be necessary to use +the form + + METAFONT\INPUT_DIRECTORY = XXXXXX + +where XXXXXX is the global name of the directory where the basic +CMMF definitions can be found. +The following discussion will then get MetaFont to produce a generic +font file CMAPL10.360GF: + + * \relax; + * \mode = imagen; + * \mag = 1.2; + * input cmapl10 + +Here \mode = imagen was used to get a pixel file for a laserprinter +with the resolution 200 times 200 pixels per square inch. It is +possible that the definition of 'imagen' is different at your local +site; in the case of error ask the person who installed your local +MetaFont. Notice that \mag = 1.2 is needed in case you want to get +magnified pixels. The final pixel (because of the resolution 200) +files will then be named CMAPL10.1800PXL (or whatever you choose +to call them). If you want to produce 'small' pixel files for example +for a screen previewer, use \mag = xxx with an appropriate constant xxx. +(You can check the form of characters obtained on a teletype terminal +by using the program GFTYPE.) Finally, you get a pixel file from +CMAPL10.xxxGF by running the program GF(TO)PXL.EXE, which should be +found together with MetaFont. + Some people want to use their pixel files on a PC (the +laserprinter is connected to a PC or for previewing purposes). In +that case the pixel files must be downloaded from the host. We never +use programs like Kermit for transferring the binary file but +first convert it to hex form, load the file down as a text file and +then convert it back. It is IMPORTANT to notice that pixel files in +VAXes (say) are composed of 512 byte blocks. The pixel file itself +is ended by the pixel_id, which is either 1001 (rasters are in word packed +form) or 1002 (rasters are in byte packed form). Some programs running +on PCs assume that the last 4 bytes of the pixel file really +represent the pixel_id. Hence, the pixel files downloaded from the host +should be CLEANed from garbage (the programs CONVERT and CLEAN are +given for convenience and to fix the definition of what they should do). + MetaFont also produces the file CMAPL10.TFM containing the +metric information of the characters in the font. These are needed +by TeX, and they can be downloaded as such (at least if you are +using Micro-TeX or PCTeX). + + In order to use the mnemonics, the macros in APLSTYLE are +needed. There are basically two ways of merging APL code. There are +standard macros called VERBATIM, which enable the user to produce +'typewriter-like' output. As APL is modelled on a typewriter style, +too, it has been reasonable to extend VERBATIM to accept different +typewriter-like fonts. The escape sequence \choosett enables you to +choose the font you want to use. Thus, \choosett{tentt} swithces +the standard font CMTT10 on, whereas \choosett{apl} chooses the font +APL, defined in APLSTYLE by '\font\apl = cmapl10'. First, you can +insert APL code into text lines. In this case you can call any +APL symbol either by its 2-letter mnemonic (for example \BX produces the +box symbol) if there is no symbol for it OR otherwise by its name +surrounded by two @'s. (The @ character swithces into the current +typewriter style.) Thus, @A_B@ produces 'A <-- B' in APL style, because +'_' is the name of '<--' in Digital's mnemonics. Secondly, you can +insert APL code in 'screenlike' mode. The code is to be delimited +by the pair \begintt - \endtt. Example: + +\begintt + @DL Z_ZNPLUS N;@BXIO % Here '@' replaces '\' as the escape +[1] @BXIO_0 % character +[2] Z_N@AB(@ION)@SO.+@ION + @DL +\endtt + +Please note that in this case the material between \begintt -- \endtt +is considered by TeX as a vertical box that cannot be divided between +pages. Thus, if you have a long APL function, it might produce +a message of underfull vbox. + diff --git a/fonts/apl/sample.tex b/fonts/apl/sample.tex new file mode 100644 index 0000000000..85481d7c94 --- /dev/null +++ b/fonts/apl/sample.tex @@ -0,0 +1,124 @@ + +%============================================================================ +% S A M P L E . T E X +%============================================================================ + +%=================================================================== +% Sample problems; solutions give examples on using APL style in TeX +% Taken from the course ``Mathematics on the Computer'', Fall 87 +%=================================================================== + +\magnification = \magstep1 + +\advance\vsize by 3truecm + +\input mssymb % for some math symbols only! This is the new + % symbol font for some standard and non-standard + % mathematical symbols. It is only used here for + % blackboard bold letters. If you dont have it, + % just define \def\Bbb{} etc. + +\input aplstyle + +\choosett{apl} + +\font\sans = amss10 +\font\sltt = amsltt10 + +\def\header{{\sans Sample problems 9.\ 10.\ 1987}} +% some of them come from Sims' ``Abstract Algebra, A Computational Approach'' +\def\APL{{\sltt APL}} + +\nopagenumbers +\tolerance = 300 +\noindent +\header + +\vskip 2cm + +\item{1.} Let $N>1$ be an integer. Show that each of the following + matrices represents a binary operation on + $S(N)$ (we set locally \BX@IO_0@.) Which of them are + associative, which commutative? + \medskip + + \itemitem{a)} @(@\IO@N)@\SO@.@\CE\IO@N@ + + \itemitem{b)} \AB@(@\IO@N)@\SO@.-@\IO@N@ + + \itemitem{c)} @N@\AB@(@\IO@N)@\SO@.+@\IO@N@ + + \itemitem{d)} @N@\AB@(@\IO@N)@\SO@.#@\IO@N@ + + \medskip +\item{} Here @x@\CE@y@ is $\max(x,y)$, @x@\AB@y@ is + $y\bmod x$ and \AB@x@ is the absolute value of $x$. + +\bigskip + +\item{2.} Write an \APL\ function @GPOWER@ that computes for a group + @G@ (global variable) the $n$-th power of a given element $x$. + (If $S(M)$ is a representation vector of @G@, then + @GPOWER@ is a map $S(M)\times \Bbb Z\to S(M)$. Simply + use iteration.) + +\bigskip + +\item{3.} (Continuing problem 2.) A faster algorithm is obtained by + decomposing $x^n$ into its 2--base form + $x^n = x^{i_0}\times x^{2i_1}\times + x^{4i_2}\times ... \times x^{{2^k}i_k}$, where $i_j\in\{0,1\}$. Show + that the complexity of this algorithm is $O(\log_2(n))$. + (Show that the number of necessary multiplications does + not exceed $2\log_2(n)$). How would you write the corresponding + function in \APL? (Note that the binary representation of $n$ + can be obtained by applying iteratively the procedure $n\bmod 2$.) + +\bigskip + +\item{4.} Write an \APL\ function @GTSGP@ that computes for a given group @G@ + (global variable) the subgroup generated by a given subset $A$. The + function @GTSGP@ has one argument (the vector @A@) and returns + a subset of the set $S(N)$ (as a vector). (Extend the set @A@ + by the group operation until @A@ becomes closed with respect + to the operation.) + +\bigskip + +\item{5.} Write an \APL\ function @INV@ that returns for a group @G@ + the vector of inverse elements as a vector $S(N)\to S(N)$ so + that the index of the inverse of $x_i$ is @(INV G)[I]@. + +\bigskip + +\item{6.} Let $(G,\theta)$ be a group and let $A$ be a subset of $G$. Program + the following algorithm in \APL\ to find the subgroup @H@ + generated by @A@. Compare the perfomance of this algorithm + with the algorithm in Problem 4. + \medskip + + \itemitem{a)} put $H$ and $Y$ equal to $\{e\}$. + + \itemitem{b)} let $Y$ be $YA\smallsetminus H$. + + \itemitem{c)} if $Y=\emptyset$, stop. + + \itemitem{d)} put $H$ equal to $H\cup Y$ and + go to (b). + + \medskip +\item{} ($e$ is the neutral element and $YA\smallsetminus H$ + is the set--theoretical difference of $YA$ and $H$. + The product $YA$ is the set $\{y\theta a: y\in Y, a\in A\}$.) + +\bigskip + +\item{7.} Write an \APL\ function @PROD@ that returns for given groups + $(G_1,\theta_1)$ ja $(G_2,\theta_2)$ the {\sl direct product} + $(G_1\times G_2,\theta_1\times\theta_2)$ as a group table. + (The binary operation in the product is $(x,y)\theta_1\times\theta_2 + (z,w) = (x\theta_1 z,y\theta_2 w)$). + +\bigskip + +\vfill\eject diff --git a/fonts/apl/solutions.tex b/fonts/apl/solutions.tex new file mode 100644 index 0000000000..85e3730545 --- /dev/null +++ b/fonts/apl/solutions.tex @@ -0,0 +1,198 @@ + +%========================================================================== +% Solutions to above sample exercises +%========================================================================== + +%\advance\vsize by 3truecm + +\choosett{apl} + +\noindent +\header%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\vskip 1cm + +\noindent +As the index of the neutral element we use the index origin \BX@IO@ which +usually has the value @0@. Then $S(N)= +\{0,\dots,N-1\}$, given by the vector \IO@N@. +An example on groups are the cyclic groups $({\bf Z}_n,+)$ +the group tables of which are generated by the \APL\ function @ZNPLUS@: + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + @DL Z_ZNPLUS N;@BXIO +[1] @BXIO_0 +[2] Z_N@AB(@ION)@SO.+@ION + @DL +\endtt +}\smallskip + +\item{1.} The matrices represent binary operations of $S(N)$, + since they are $N\times N$-matrices with elements from + $S(N)$. They are all associative and also commutative except for + the case (b). This can be seen by the function @TEST@: + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + @DL Z_TEST B +[1] " B IS A BINARY OPERATION. THE FUNCTION RETURNS A BOOLEAN 2-VECTOR +[2] " (B ASSOCIATIVE, B COMMUTATIVE) +[3] Z_(&/&/&/B[B;]=B[;B]),&/&/B=@TRB + @DL +\endtt +}\smallskip + +\item{2.} + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + @DL P_X GPOWER N;I +[1] " G GLOBAL +[2] P_@BXIO @DM I_0 +[3] TEST:@GO(NJ_J+1)/CORE +[6] @GO(N>I_I+1)/JLOOP + @DL +\endtt +} + +Example: + +\hskip\parskip\vbox{\hsize=15truecm +\begintt + (ZNPLUS 2) PROD ZNPLUS 10 + 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 + 1 2 3 4 5 6 7 8 9 0 11 12 13 14 15 16 17 18 19 10 + 2 3 4 5 6 7 8 9 0 1 12 13 14 15 16 17 18 19 10 11 + 3 4 5 6 7 8 9 0 1 2 13 14 15 16 17 18 19 10 11 12 + 4 5 6 7 8 9 0 1 2 3 14 15 16 17 18 19 10 11 12 13 + 5 6 7 8 9 0 1 2 3 4 15 16 17 18 19 10 11 12 13 14 + 6 7 8 9 0 1 2 3 4 5 16 17 18 19 10 11 12 13 14 15 + 7 8 9 0 1 2 3 4 5 6 17 18 19 10 11 12 13 14 15 16 + 8 9 0 1 2 3 4 5 6 7 18 19 10 11 12 13 14 15 16 17 + 9 0 1 2 3 4 5 6 7 8 19 10 11 12 13 14 15 16 17 18 +10 11 12 13 14 15 16 17 18 19 0 1 2 3 4 5 6 7 8 9 +11 12 13 14 15 16 17 18 19 10 1 2 3 4 5 6 7 8 9 0 +12 13 14 15 16 17 18 19 10 11 2 3 4 5 6 7 8 9 0 1 +13 14 15 16 17 18 19 10 11 12 3 4 5 6 7 8 9 0 1 2 +14 15 16 17 18 19 10 11 12 13 4 5 6 7 8 9 0 1 2 3 +15 16 17 18 19 10 11 12 13 14 5 6 7 8 9 0 1 2 3 4 +16 17 18 19 10 11 12 13 14 15 6 7 8 9 0 1 2 3 4 5 +17 18 19 10 11 12 13 14 15 16 7 8 9 0 1 2 3 4 5 6 +18 19 10 11 12 13 14 15 16 17 8 9 0 1 2 3 4 5 6 7 +19 10 11 12 13 14 15 16 17 18 9 0 1 2 3 4 5 6 7 8 +\endtt +} + +\end + + diff --git a/fonts/apl/tugboat.tex b/fonts/apl/tugboat.tex new file mode 100644 index 0000000000..87b1461a1c --- /dev/null +++ b/fonts/apl/tugboat.tex @@ -0,0 +1,530 @@ + +%============================================================================= +% T U G B O A T . T E X +%============================================================================= +%======================================================================== +% A TeX file for the paper on APL-TeX (new version, not published) +% +% A.Hohti/O.Kanerva (University of Helsinki) April 1987 +%======================================================================== +% +% +% Version of August 26, 1987 at 15:00 +% +% +%======================================================================== +\input aplstyle % the file containing the APL definitions +%======================================================================== +% +% +\magnification=\magstep1 % for weak eyes! +% +% +%======================================================================== +\font\bigbf=ambx10 % for titles +\font\sltt=amsltt10 % for file contents inside text +\font\manual=manfnt at 10pt % for major METAFONT logo +\font\minual=manfnt at 9pt % for minor METAFONT logo +\input ninesize % abstract, references +%======================================================================== +% +\def\METAFONT{{\manual META}\-{\manual FONT}} +\def\metafont{{\minual META}\-{\minual FONT}} +% +%======================================================================== +% stylistic definitions +\def\section#1{\vskip0pt plus .1\vsize + \penalty-250\vskip0pt plus-.1\vsize\bigskip + \noindent{\bf #1.\ }\nobreak\message{#1}} +\def\abstract#1{\bigskip\centerline{\hbox{ + \vbox{\hsize=4.75truein{\ninepoint \noindent ABSTRACT.\enspace#1}}}}} +\def\APL{{\sl APL}} +% this definition is from the TeXbook, Ex. 21.3 : +\def\boxit#1{\vbox{\hrule \hbox{\vrule \kern2pt + \vbox{\kern2pt#1\kern2pt}\kern2pt\vrule}\hrule}} +% A macro for making references and blocks. +% +\newdimen\refindent\newdimen\plusindent +\newdimen\refskip\newdimen\tempindent +\newdimen\extraindent +\newcount\refcount +% +% \refskip has to be set by the user! Otherwise \parindent is +% used, in accordance with \item. +% +\refcount=0 +\def\ref#1:#2.-#3\par{\ninepoint % switch to nine point fonts +\advance\refcount by 1 +\setbox0=\hbox{[\number\refcount]}\refindent=\wd0 +\plusindent=\refskip\extraindent=\refskip +\advance\plusindent by -\refindent\tempindent=\parindent % +\parindent=0pt\par\hangindent\extraindent % + [\number\refcount]\hskip\plusindent #1:{\sl#2},#3 +\parindent=\tempindent} +% +\refskip=\parindent +% +%======================================================================== + % HEADER +\null +\vskip2truecm +% + \centerline{\bigbf GENERATING AN \APL\ FONT} +% +\vskip.75truecm +% + \centerline{\sl Aarno Hohti and Okko Kanerva} +% +\vskip.5truecm +% + \centerline{\sl University of Helsinki} +\vskip.5truecm +\abstract{The \APL\ language is well known for its peculiar + symbols which have inhibited the use of this language + in many programming environments. Making \APL\ + documents of good quality has been difficult and + expensive. We describe here a simple way how to + use \metafont\ to generate an \APL\ font for \TeX\ + by using existing font definitions as far as possible.} +\vskip.5truecm +%======================================================================== +% +\section{Introduction} +This note describes an interesting exercise in using +\METAFONT\ to produce new typefaces by combining letters +from standard fonts. As we know, the \APL\ language [6] of +Kenneth Iverson has never gained the popularity it deserves +which is largely due to its strange symbol set. Indeed, +true \APL\ users require a special keyboard to support +the nonstandard but powerful operator symbols. Moreover, +putting \APL\ into print has always been a problem, and +modern low cost computerized typesetting programs do +not usually support \APL\ style. \TeX\ can be used to +produce high quality printouts for technical text, +and it would be desirable to have a possibility to +mix in \APL\ code. The companion program of +\TeX ---\METAFONT ---provides a full means for a simple generation +of an \APL\ font for \TeX, and the purpose of this +note is to inform other people about the result we +have obtained at the University of Helsinki. Let us note +that there are at least three other \APL\ fonts available +for small computer environments. Indeed, the newsletter +\APL\ {\it Quote Quad\/}\footnote{*}{{\ninepoint Newsletter of SIGAPL, +the Special Interest Group for \APL. {\it Quote Quad\/} has the same +status in the world of \APL\ as TUGboat in \TeX{nical} world.}} +is produced by using TROFF, and there +exists a Postscript \APL\ font for the Apple Laserwriter [5] and +another font for the TEXT typesetting system [2]. + +Consider the following usual kind of function definition in \APL: +\choosett{apl} +\begintt + @DLS_SUMSQ N;I + [1] S_I_0 + [2] @GO(N@@ROI)/LOOP + @endsym + } + $$\boxit{\boxit{\box0}}$$ + \centerline{\sevenrm An APL function for polynomial multiplication} +\endtt +% +gives the output +% +\choosett{apl} +\setbox0=\vbox{\hsize=5.7truein +\begintt + [0] Z_A1 PROD A2;A;I;V + [1] "RETURNS THE PRODUCT OF THE POLYNOMIALS A1 AND A2 + [2] "THE ARGUMENTS ARE GIVEN AS COEFFICIENT ARRAYS + [3] I_@ROA1 + [4] Z_A1@SO.#A2 + [5] LOOP:V_@ROZ @DM V[(@ROI)+1]_V[1] + [6] V_@ROZ_Z,[(@ROI)+1]V@RO0 + [7] A_(1+-@IOV[1])@SO.#((@NT(@IO@ROV)@EP(1,(@ROI)+1))/V)@RO1 + [8] Z_+/[1]A@RV[(@ROI)+1]Z + [9] ((@RO@ROZ)>@ROI)/LOOP +\endtt + } +$$\boxit{\boxit{\box0}}$$ +\centerline{\sevenrm An APL function for polynomial multiplication} +% +\section{User extension} +A modern user of a computerized typesetting facility will probably +ask if it is possible to extend or modify fonts coming with the +system. As with [5], where the font has an {\it analytic\/} and a +{\it bitmapped\/} variant, we can distinguish between the need of modifying +{\it cmapl10\/} via \METAFONT\ and modification of the pixel files. +\APL\ symbols of various ``blackness'' or ``thickness'' may be desirable. +Indeed, in [3] the user input is written with boldface \APL\ symbols +and the answers from the interpreter with thin ones. Furthermore, +certain screen previewers use specific small size pixel files, and +do not support the \APL\ font. + +The modification of the font by changing the values of some global +variables in the preamble of the \METAFONT\ file is easy and can be +done by following how it is done in standard fonts such as +{\it cmbx10\/} etc. This is the recommended way, too. However, if +\METAFONT\ is not available, then one must attack the pixel files. +For direct hand editing, we use a program that converts a pixel +file into a (bitmapped) text file acceptable to any standard screen +editor, and another program reading the edited file back into +a \TeX\ pixel file. Scaling fonts down to a desired size can be +done in a similar (but automatic) manner; this facility is needed +by a previewer (written by the first author) not using runtime +scaling. + + +\section{References} +\bigskip +{ +\ref Digital Equipment Corporation: VAX-11 \APL\ Reference Manual.- + 1983. + +\ref Feldberg, Ian: TEXT: Publication-Quality Characters Come + to \APL\ Graphics.- Proceedings of the 1986 \APL\ Conference, + SIGAPL, pp.\ 306--313. + +\ref Gilman, Leonard, and Allen J.\ Rose: \APL, An Interactive + Approach.- John Wiley \& Sons, Inc., 1984. + +\ref Grenander, Ulf: Mathematical Experiments on the Computer.- + Academic Press, 1982. + +\ref Howland, John E.: Typesetting \APL\ Using a Macintosh.- + Proceedings of the 1986 \APL\ Conference, SIGAPL, pp.\ 301--305. + +\ref Iverson, Kenneth: A Programming Language.- Wiley, New York, 1962. + + + } + +\bigskip +\section{The address} +\bigskip +{\ninepoint\obeylines +\hskip\refskip University of Helsinki +\hskip\refskip Department of Mathematics +\hskip\refskip Hallituskatu 15 +\hskip\refskip SF--00100 HELSINKI +\hskip\refskip FINLAND +} + +\end + diff --git a/fonts/apl/tugboat2.tex b/fonts/apl/tugboat2.tex new file mode 100644 index 0000000000..05a6398b72 --- /dev/null +++ b/fonts/apl/tugboat2.tex @@ -0,0 +1,534 @@ + +%============================================================================= +% T U G B O A T . T E X +%============================================================================= +%======================================================================== +% A TeX file for the paper on APL-TeX (new version, not published) +% +% A.Hohti/O.Kanerva (University of Helsinki) April 1987 +%======================================================================== +% +% +% Version of August 26, 1987 at 15:00 +% +% +%======================================================================== +\input aplstyle % the file containing the APL definitions +%======================================================================== +% +% +\magnification=\magstep1 % for weak eyes! +% +% +%======================================================================== +\font\bigbf=ambx10 % for titles +\font\sltt=amsltt10 % for file contents inside text +\font\manual=manfnt at 10pt % for major METAFONT logo +\font\minual=manfnt at 9pt % for minor METAFONT logo +\input ninesize % abstract, references +%======================================================================== +% +\def\METAFONT{{\manual META}\-{\manual FONT}} +\def\metafont{{\minual META}\-{\minual FONT}} +% +%======================================================================== +% stylistic definitions +\def\section#1{\vskip0pt plus .1\vsize + \penalty-250\vskip0pt plus-.1\vsize\bigskip + \noindent{\bf #1.\ }\nobreak\message{#1}} +\def\abstract#1{\bigskip\centerline{\hbox{ + \vbox{\hsize=4.75truein{\ninepoint \noindent ABSTRACT.\enspace#1}}}}} +\def\APL{{\sl APL}} +% this definition is from the TeXbook, Ex. 21.3 : +\def\boxit#1{\vbox{\hrule \hbox{\vrule \kern2pt + \vbox{\kern2pt#1\kern2pt}\kern2pt\vrule}\hrule}} +% A macro for making references and blocks. +% +\newdimen\refindent\newdimen\plusindent +\newdimen\refskip\newdimen\tempindent +\newdimen\extraindent +\newcount\refcount +% +% \refskip has to be set by the user! Otherwise \parindent is +% used, in accordance with \item. +% +\refcount=0 +\def\ref#1:#2.-#3\par{\ninepoint % switch to nine point fonts +\advance\refcount by 1 +\setbox0=\hbox{[\number\refcount]}\refindent=\wd0 +\plusindent=\refskip\extraindent=\refskip +\advance\plusindent by -\refindent\tempindent=\parindent % +\parindent=0pt\par\hangindent\extraindent % + [\number\refcount]\hskip\plusindent #1:{\sl#2},#3 +\parindent=\tempindent} +% +\refskip=\parindent +% +%======================================================================== + % HEADER +\null +\vskip2truecm +% + \centerline{\bigbf GENERATING AN \APL\ FONT} +% +\vskip.75truecm +% + \centerline{\sl Aarno Hohti and Okko Kanerva} +% +\vskip.5truecm +% + \centerline{\sl University of Helsinki} +\vskip.5truecm +\abstract{The \APL\ language is well known for its peculiar + symbols which have inhibited the use of this language + in many programming environments. Making \APL\ + documents of good quality has been difficult and + expensive. We describe here a simple way how to + use \metafont\ to generate an \APL\ font for \TeX\ + by using existing font definitions as far as possible.} +\vskip.5truecm +%======================================================================== +% +\section{Introduction} +This note describes an interesting exercise in using +\METAFONT\ to produce new typefaces by combining letters +from standard fonts. As we know, the \APL\ language [6] of +Kenneth Iverson has never gained the popularity it deserves +which is largely due to its strange symbol set. Indeed, +true \APL\ users require a special keyboard to support +the nonstandard but powerful operator symbols. Moreover, +putting \APL\ into print has always been a problem, and +modern low cost computerized typesetting programs do +not usually support \APL\ style. \TeX\ can be used to +produce high quality printouts for technical text, +and it would be desirable to have a possibility to +mix in \APL\ code. The companion program of +\TeX ---\METAFONT ---provides a full means for a simple generation +of an \APL\ font for \TeX, and the purpose of this +note is to inform other people about the result we +have obtained at the University of Helsinki. Let us note +that there are at least three other \APL\ fonts available +for small computer environments. Indeed, the newsletter +\APL\ {\it Quote Quad\/}\footnote{*}{{\ninepoint Newsletter of SIGAPL, +the Special Interest Group for \APL. {\it Quote Quad\/} has the same +status in the world of \APL\ as TUGboat in \TeX{nical} world.}} +is produced by using TROFF, and there +exists a Postscript \APL\ font for the Apple Laserwriter [5] and +another font for the TEXT typesetting system [2]. + +Consider the following usual kind of function definition in \APL: +\choosett{apl} +\begintt + @DLS_SUMSQ N;I + [1] S_I_0 + [2] @GO(N@@ROI)/LOOP + @endsym + } + $$\boxit{\boxit{\box0}}$$ + \centerline{\sevenrm An APL function for polynomial multiplication} +\endtt +% +gives the output +% +\choosett{apl} +\setbox0=\vbox{\hsize=5.7truein +\begintt + [0] Z_A1 PROD A2;A;I;V + [1] "RETURNS THE PRODUCT OF THE POLYNOMIALS A1 AND A2 + [2] "THE ARGUMENTS ARE GIVEN AS COEFFICIENT ARRAYS + [3] I_@ROA1 + [4] Z_A1@SO.#A2 + [5] LOOP:V_@ROZ @DM V[(@ROI)+1]-1 + [6] V_@ROZ_Z,[(@ROI)+1]V@RO0 + [7] A_(1+-@IOV[1])@SO.#((@NT(@IO@ROV)@EP(1,(@ROI)+1))/V)@RO1 + [8] Z_+/[1]A@RV[(@ROI)+1]Z + [9] ((@RO@ROZ)>@ROI)/LOOP +\endtt + } +$$\boxit{\boxit{\box0}}$$ +\centerline{\sevenrm An APL function for polynomial multiplication} +% +\section{User extension} +A modern user of a computerized typesetting facility will probably +ask if it is possible to extend or modify fonts coming with the +system. As with [5], where the font has an {\it analytic\/} and a +{\it bitmapped\/} variant, we can distinguish between the need of modifying +{\it cmapl10\/} via \METAFONT\ and modification of the pixel files. +\APL\ symbols of various ``blackness'' or ``thickness'' may be desirable. +Indeed, in [3] the user input is written with boldface \APL\ symbols +and the answers from the interpreter with thin ones. Furthermore, +certain screen previewers use specific small size pixel files, and +do not support the \APL\ font. + +The modification of the font by changing the values of some global +variables in the preamble of the \METAFONT\ file is easy and can be +done by following how it is done in standard fonts such as +{\it cmbx10\/} etc. This is the recommended way, too. However, if +\METAFONT\ is not available, then one must attack the pixel files. +For direct hand editing, we use a program that converts a pixel +file into a (bitmapped) text file acceptable to any standard screen +editor, and another program reading the edited file back into +a \TeX\ pixel file. Scaling fonts down to a desired size can be +done in a similar (but automatic) manner; this facility is needed +by a previewer (written by the first author) not using runtime +scaling. + + +\section{References} +\bigskip +{ +\ref Digital Equipment Corporation: VAX-11 \APL\ Reference Manual.- + 1983. + +\ref Feldberg, Ian: TEXT: Publication-Quality Characters Come + to \APL\ Graphics.- Proceedings of the 1986 \APL\ Conference, + SIGAPL, pp.\ 306--313. + +\ref Gilman, Leonard, and Allen J.\ Rose: \APL, An Interactive + Approach.- John Wiley \& Sons, Inc., 1984. + +\ref Grenander, Ulf: Mathematical Experiments on the Computer.- + Academic Press, 1982. + +\ref Howland, John E.: Typesetting \APL\ Using a Macintosh.- + Proceedings of the 1986 \APL\ Conference, SIGAPL, pp.\ 301--305. + +\ref Iverson, Kenneth: A Programming Language.- Wiley, New York, 1962. + + + } + +\bigskip +\section{The address} +\bigskip +{\ninepoint\obeylines +\hskip\refskip University of Helsinki +\hskip\refskip Department of Mathematics +\hskip\refskip Hallituskatu 15 +\hskip\refskip SF--00100 HELSINKI +\hskip\refskip FINLAND +} + +\end + + +%============================================================================ +% +%============================================================================ diff --git a/fonts/apl/versatim.tex b/fonts/apl/versatim.tex new file mode 100644 index 0000000000..c2ff320a7e --- /dev/null +++ b/fonts/apl/versatim.tex @@ -0,0 +1,66 @@ + +%============================================================================= +% V E R S A T I M . T E X +%============================================================================= +% +% +\newskip\verbatimindent \verbatimindent=0cm +\newskip\ttglue{\tt \global\ttglue=.5em plus.25em minus.15em} +\def\@{\char'100 } +% +\outer\def\begindisplay{\obeylines\startdisplay} +{\obeylines\gdef\startdisplay#1 + {\catcode`\^^M=5$$#1\halign\bgroup&\hskip\verbatimindent##\hfil\cr}} +\outer\def\enddisplay{\crcr\egroup$$} +% +\chardef\other=12 +\def\ttverbatim{\begingroup \catcode`\\=\other \catcode`\{=\other + \catcode`\}=\other \catcode`\$=\other \catcode`\&=\other + \catcode`\#=\other \catcode`\%=\other \catcode`\~=\other + \catcode`\_=\other \catcode`\^=\other\catcode`\*=\other\catcode`\==\other +% +\ifapl +\catcode`\A=12 +\catcode`\B=12 +\catcode`\C=12 +\catcode`\D=12 +\catcode`\E=12 +\catcode`\F=12 +\catcode`\G=12 +\catcode`\H=12 +\catcode`\I=12 +\catcode`\J=12 +\catcode`\K=12 +\catcode`\L=12 +\catcode`\M=12 +\catcode`\N=12 +\catcode`\O=12 +\catcode`\P=12 +\catcode`\Q=12 +\catcode`\R=12 +\catcode`\S=12 +\catcode`\T=12 +\catcode`\U=12 +\catcode`\V=12 +\catcode`\W=12 +\catcode`\X=12 +\catcode`\Y=12 +\catcode`\Z=12 +\fi +% + \obeyspaces \obeylines \tt} +{\obeyspaces\gdef {\ }} +% +\def\begintt{$$\let\par=\endgraf \ttverbatim \parskip=0pt + \catcode`\@=0 \parindent=\verbatimindent \rightskip=-5pc \ttfinish} +{\catcode`\@=0 @catcode`@\=\other % @ is temporary escape character + @obeylines % end of line is active + @gdef@ttfinish#1^^M#2\endtt{#1@vbox{#2}@endgroup$$}} +% +\catcode`\@=\active +{\obeylines\gdef@{\ttverbatim\spaceskip=\ttglue\let^^M=\ \let@=\endgroup}} + + +\def\beginlines{\par\begingroup\nobreak\medskip\parindent=0pt + \kern1pt\nobreak \obeylines \everypar{\strut}} +\def\endlines{\kern1pt\endgroup\medbreak\noindent} -- cgit v1.2.3