% Macros for producing the FSF order form

% Copyright (c) 1994 Charles Hannum.  All rights reserved.
%
% You may do anything you wish with this, so long as the above copyright
% notice and this disclaimer remain.


\newskip\writingskip
\newskip\bigwritingskip
\newskip\circleskip
\newskip\littleskip
\newskip\beforesectionskip
\newskip\beforesubsectionskip
\newskip\sectionskip
\newskip\subsectionskip

\newdimen\quantitywidth
\newdimen\amountwidth
\newdimen\separatorwidth
\newdimen\handruleheight
\newdimen\normalruleheight
\newdimen\totalruleheight

\newif\ifmanualsonly
\newif\ifbulletin


\def\cdromsize{
  \hsize=4.25in
  \vsize=4.21875in

  \font\rm=pplr at9pt\rm
  \font\it=pplri at9pt
  \font\bf=pplb at9pt
  \font\hd=pplb at18pt
  \font\tl=pplb at13.5pt
  \font\tt=phvr at9pt
  \font\sy=psyr at9pt
  %\def\about{{\sy\char126}}

  %\font\rm=cmr8\rm
  %\font\it=cmti8
  %\font\bf=cmbx8
  %\font\hd=cmbx12 scaled\magstep1
  %\font\tl=cmbx12
  %\font\tt=cmtt8
  %\font\sy=cmsy7
  %\textfont2=\sy
  %\def\about{$\sim$}
  \def\about{}

  \baselineskip=9.1pt
  \lineskip=0pt
  \writingskip=2.7pt plus1pt
  \bigwritingskip=8pt
  \littleskip=2pt plus1pt
  \beforesectionskip=4pt plus6pt
  \beforesubsectionskip=.5\beforesectionskip
  \sectionskip=8pt plus2pt
  \subsectionskip=.5\sectionskip

  \quantitywidth=1.3pc
  \amountwidth=2pc
  \separatorwidth=1pc

  \handruleheight=.4pt
  \normalruleheight=.2pt
  \totalruleheight=.8pt

  \manualsonlytrue
  \bulletinfalse

  \finishsetup
}

\def\bulletinsize{
  \hsize=4.25in
  \vsize=7.4in
  \voffset=-0.15in

  \font\rm=cmr8\rm
  \font\it=cmsl8
  \font\bf=cmbx8
  \font\hd=cmbx12 scaled\magstep1
  \font\tl=cmbx12
  \font\tt=cmtt8
  \font\sy=cmsy7
  %\textfont2=\sy
  %\def\about{$\sim$}
  \def\about{}
  \def\cdrom{CD-ROM}

  \baselineskip=9.1pt
  \lineskip=0pt
  \writingskip=2.1pt plus1pt
  \bigwritingskip=9pt
  \circleskip=2.1pt plus1pt
  \littleskip=3pt plus1pt
  \beforesectionskip=6pt plus6pt
  \beforesubsectionskip=.5\beforesectionskip
  \sectionskip=10pt plus2pt
  \subsectionskip=.5\sectionskip

  \quantitywidth=1.3pc
  \amountwidth=2pc
  \separatorwidth=1pc

  \handruleheight=.4pt
  \normalruleheight=.2pt
  \totalruleheight=.8pt

  \manualsonlyfalse
  \bulletintrue

  \finishsetup
}

\widowpenalty=3000
\clubpenalty=3000
\hyphenpenalty=6000
\exhyphenpenalty=6000
\parindent=0pt
\parskip=0pt
\nopagenumbers

\def\inch{\char"7D}
% This is really only for the tape table.
\def\dollar{\enspace \$ \kern .05em}

% For telephone numbers and zipcodes, put `+' and `-' in \tt.
\def\plus{{\tt+}}
\def\dash{{\tt-}}
{
  \catcode'053=\active
  \catcode`\-=\active
  \global\def\number{%
    \catcode'053=\active%
    \catcode`\-=\active%
    \let+\plus%
    \let-\dash%
  }
}

% For section and subsection titles.
\def\section#1{\vskip\beforesectionskip{\tl #1}\par\penalty10000}
\def\subsection#1{\vskip\beforesubsectionskip{\it #1}\par\penalty10000}

% For fill-in entries
\def\hrulefill#1{\leaders\hrule height#1\hfill\vrule width0pt}
\def\handentry{\hrulefill\handruleheight\par}
\def\fillin{\par\begingroup\advance\parskip by\bigwritingskip\rightskip=0pt plus1fil}
\def\endfillin{\par\endgroup}


% DANGER WILL ROBINSON.
% All of the following hair is for typesetting individual item prices.  It
% would be wonderful to use an \halign, but we need to insert section and
% subsection headers, and \halign simply won't deal without serious klugery.

\newbox\digitbox
\newbox\wholebox
% We need to actually set the \wholebox and \digitbox *after* the paper size
% has been selected.
\def\finishsetup{
  \setbox\digitbox=\hbox{\bf 0000}
  \setbox\wholebox=\pricebox{\digitbox}
}

\def\quantityline{\vrule width\quantitywidth height\normalruleheight depth0pt}

\def\amountline{{\bf\$}\thinspace\vrule width\amountwidth height\normalruleheight depth0pt\hskip\separatorwidth}

\def\totalline{{\bf\$}\thinspace\vrule width\amountwidth height\totalruleheight depth0pt\hskip\separatorwidth}

\def\dobox#1#2{\vskip\writingskip{\hangindent=\wd\wholebox\hangafter=1\leavevmode#1#2\par}}

\def\pricebox#1{\hbox{\quantityline{\thinspace}{\bf @ \$\hbox to\wd\digitbox{\hfil#1} = }\amountline}}
\def\doprice#1#2{\dobox{\pricebox{#1}}{#2}}

\def\plusbox{\hbox to\wd\wholebox{\hfil{\bf+} \amountline}}
\def\doplus#1{\dobox{\plusbox}{#1}}

\def\totalbox#1{\hbox to\wd\wholebox{\hfil{\bf #1} \totalline}}
\def\dototal#1#2{\penalty10000\vskip\littleskip\penalty10000\dobox{\totalbox{#1}}{#2}\vskip\littleskip}


% The end.
