%%% ==================================================================== %%% @TeX-file{ %%% author = "Alan Jeffrey", %%% version = "0.01", %%% date = "29 March 1993", %%% time = "22:56:17 GMT", %%% filename = "T1.mac", %%% address = "School of Cognitive and Computing Sciences %%% University of Sussex %%% Brighton BN1 9QH %%% UK", %%% telephone = "+44 273 606755 x 3238", %%% FAX = "+44 273 678188", %%% checksum = "30602 271 727 7582", %%% email = "alanje@cogs.sussex.ac.uk", %%% codetable = "ISO/ASCII", %%% keywords = "AFM, virtual fonts, fonts, PostScript, TeX", %%% supported = "yes", %%% abstract = "These are the macros used by fontinst.tex to %%% generate fonts in the T1 (Cork) encoding.", %%% docstring = "The checksum field above contains a CRC-16 %%% checksum as the first value, followed by the %%% equivalent of the standard UNIX wc (word %%% count) utility output of lines, words, and %%% characters. This is produced by Robert %%% Solovay's checksum utility.", %%% package = "fontinst", %%% dependencies = "fontinst.tex", %%% } %%% ==================================================================== % % 29 Mar 1993, v0.01: Created file. % In the T1.fud file you can say \topaccent{Aacute}{A}{acute}{0.5} % to make a character with an accent on top of it, with the % `visual centre' of A taken to be half-way. \def\topaccent#1#2#3{{ \getchar{#2} \cdimen\charht \advance\cdimen by -\xheight\afmunits \bdimen\charwd \acount\startfont \bcount\stopfont \atoks\map \getchar{#1} \adimen#3\charwd \advance\adimen by -.5\bdimen \bdimen\charht \advance\bdimen by -\xheight\afmunits \global\advance\charht by \cdimen \settoken\map{ (PUSH) (MOVERIGHT \vplreal\adimen) (MOVEUP \vplreal\bdimen) \the\atoks (POP) \ifnum\bcount=\startfont\else (SELECTFONT \vplint\startfont) \fi \the\map } }} % You can say \defchar{Ccedilla}{\botaccent{C}{cedilla}{0.6}} to % make a character with an accent below it. \def\botaccent#1#2#3{{ \getchar{#2} \cdimen\chardp \bdimen\charwd \acount\startfont \bcount\stopfont \atoks\map \getchar{#1} \adimen#3\charwd \advance\adimen by -.5\bdimen \bdimen\chardp \global\advance\chardp by \cdimen \settoken\map{ (PUSH) (MOVERIGHT \vplreal\adimen) (MOVEDOWN \vplreal\bdimen) \the\atoks (POP) \ifnum\bcount=\startfont\else (SELECTFONT \vplint\startfont) \fi \the\map } }} % There are two ways to make a double character. % The first is intended for characters such as which should have % the width of plus the width of . To make a pair with % the moved left by .1 of its width, say: % % \defchar{fi}{\doublechar{f}{i}{.1}} \def\doublechar#1#2#3{{ \getchar{#1} \adimen\charwd \bdimen\charht \cdimen\chardp \acount\startfont \bcount\stopfont \atoks\map \getchar{#2} \global\advance\charwd by \adimen \adimen#3\adimen \ifnum\charht<\bdimen \global\charht\bdimen \fi \ifnum\chardp<\cdimen \global\chardp\cdimen \fi \global\startfont\acount \settoken\map{ \the\atoks \ifnum\bcount=\startfont\else (SELECTFONT \vplint\startfont) \fi \ifnum\adimen=0 \else (MOVELEFT \vplreal\adimen) \fi \the\map } }} % The second way to make a double character tries to cram the % characters into the width of the first character by moving the % second character left. To make a pair % with the moved left by 60% of its width in a monospaced % font, say: % % \defchar{Lcaron}{\cramchar{L}{quoteright}{.6}} \def\cramchar#1#2#3{{ \getchar{#1} \adimen#3\charwd \bdimen\charht \cdimen\chardp \acount\startfont \bcount\stopfont \atoks\map \getchar{#2} \ifnum\charht<\bdimen \global\charht\bdimen \fi \ifnum\chardp<\cdimen \global\chardp\cdimen \fi \global\startfont\acount \settoken\map{ \the\atoks \ifnum\bcount=\startfont\else (SELECTFONT \vplint\startfont) \fi (PUSH) (MOVELEFT \vplreal\adimen) \the\map (POP) } }} % \shrinkchar{FOO} produces a character shrunk by \shrinkamount with % sidebearings of \shrinkbearings (given in AFM units). If we're % producing a monospaced font, then the sidebearings are calculated to % maintain the spacing. THIS IS VERY INEFFICIENT AT THE MOMENT since % it loads in each character twice when building a monoweight font. \newcount\shrinkbearings \shrinkbearings 50 \def\shrinkamount{0.7} \def\shrinkchar#1{{ \iffixedpitch \getchar{#1} \adimen\charwd \fi { \afmunits=\shrinkamount\afmunits \getchar{#1} } \iffixedpitch \advance\adimen by -\charwd \divide\adimen by 2 \else \adimen\shrinkbearings\afmunits \fi \global\advance\charwd by 2\adimen \settoken\map{ (MOVERIGHT \vplreal\adimen) \the\map (MOVERIGHT \vplreal\adimen) } }} % \inferiorchar{CHAR} sets a shrunk character CHAR, with no % sidebearings, lowered by \inferiorshift AFM units. \newcount\inferiorshift \inferiorshift=150 \def\inferiorchar#1{{ \shrinkbearings=0 \shrinkchar{#1} \adimen=\inferiorshift\afmunits \advance\chardp by \adimen \advance\charht by -\adimen \ifnum\charht<0 \charht=0pt \fi \settoken\map{ (MOVEDOWN \noexpand\vplreal\adimen) \noexpand\the\map (MOVEUP \noexpand\vplreal\adimen) } }} % \superiorchar{CHAR} sets a shrunk character CHAR, with no % sidebearings, lowered by \superiorshift AFM units. \newcount\superiorshift \superiorshift=300 \def\superiorchar#1{{ \shrinkbearings=0 \shrinkchar{#1} \adimen=\superiorshift\afmunits \advance\charht by \adimen \advance\chardp by -\adimen \ifnum\chardp<0 \chardp=0pt \fi \noexpand\settoken\map{ (MOVEUP \noexpand\vplreal\adimen) \noexpand\the\map (MOVEDOWN \noexpand\vplreal\adimen) } }} % \fractionchar{FIRST}{SECOND}{THIRD} builds a character by: % % * placing FIRST % * moving left by .5 of SECOND's width % * placing SECOND % * moving left by .5 of SECOND's width % * placing THIRD % % For example, \fractionchar{onesuperior}{fraction}{twoinferior} is a % reasonable fake for . \def\fractionchar#1#2#3{{ \getchar{#1} \adimen\charwd \bdimen\charht \cdimen\chardp \acount\startfont \bcount\stopfont \atoks\map \getchar{#2} \global\charwd.5\charwd \ifnum\charht>\bdimen \bdimen\charht \fi \ifnum\chardp>\cdimen \cdimen\chardp \fi \edef\temp{ \the\atoks \ifnum\bcount=\startfont\else (SELECTFONT \vplint\startfont) \fi (MOVELEFT \vplreal\charwd) \the\map (MOVELEFT \vplreal\charwd) } \atoks\expandafter{\temp} \bcount=\stopfont \getchar{#3} \global\advance\charwd by \adimen \ifnum\charht<\bdimen \global\charht\bdimen \fi \ifnum\chardp<\cdimen \global\chardp\cdimen \fi \settoken\map{ \the\atoks \ifnum\bcount=\startfont\else (SELECTFONT \vplint\startfont) \fi \the\map } \global\startfont\acount }} \endinput