[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch for bigdoc.tex, fontchart.sty



I wrote:

> First impression:  
>
> * There's something really wrong with the grayscale font charts 
>   in bigdoc.dvi.

OK, I traced down the problem and hacked fontchar.sty and bigdoc.tex
to fix it.  The problem was that 0-0 was used as a termination
condition when processing the argument list of \grayarea, but 
an extra trailing 0-0 ended up in the print-out in some chases,
messing up the font tables completely.

While I was at it, I also fixed some other problems with the font
charts: The \hexnum macro was broken and the \centerlargechars 
feature was missing.  I also ajdusted the width of the table cells
to get more uniform output as we used to get with testfont.tex.

Cheers, Ulrik.

P.S.  There was a Mathematica 3.0 presentation at our university
today.  It appears that none of their sales representatives have 
a clue as to the status of their font licensing.  They advised
me to get in touch with them by e-mail about specific questions.


*** bigdoc.tex.orig	Mon Nov 24 22:20:49 1997
--- bigdoc.tex	Thu Nov 27 01:52:20 1997
***************
*** 2,7 ****
--- 2,8 ----
  \usepackage{fullpage,mflogo,multicol}
  \usepackage{fontchart}
  \usepackage[amssymb,extraops]{newmath}
+ \setcounter{errorcontextlines}{10}
  
  \input{versionhdr}
  \begin{document}
***************
*** 304,309 ****
--- 305,312 ----
  displayed. This additional information is relevant only to font designers and
  will be given somewhere else.
  
+ \clearpage
+ 
  \makeatletter
  % pieces from fontdoc.sty
  \newcount\slot@number
***************
*** 360,365 ****
--- 363,369 ----
  \useexamplefont{ecrm1000}
  \setdefaultslotcomment{The symbol `\slotexample'.}
  
+ \begin{multicols}{2}
  \subsection{MC -- Math Core}
  
  % things which the raw files need
***************
*** 371,377 ****
  \let\largerradical\variablelarger
  
  \useexamplefont{xma1000}
- \begin{multicols}{2}
  \inputraw{MCraw.etx}
  \end{multicols}
  
--- 375,380 ----
***************
*** 487,522 ****
  variants of each glyphs. We have also created extensible fonts containing
  more larger variants. 
  
  \section{The cm layout, normal version}
  
! \bigskip
! 
! \fontchart[0-256]{xma1000}\newpage\grayarea{90-127,127-256}
! \fontchart[0-172]{xmb1000}\newpage\grayarea{0-0}
  \fontchart[0-256]{xmc1000}\newpage
  \fontchart[0-256]{xmd1000}\newpage
! \fontchart[0-256]{xme1000}\newpage\grayarea{63-127,127-256}
! \fontchart[0-144]{xmf1000}\newpage\grayarea{0-0}
  
  \section{The cm layout, bold version}
  
! \fontchart[0-256]{xmab1000}\newpage\grayarea{90-127,127-256}
! \fontchart[0-172]{xmbb1000}\newpage\grayarea{0-0}
  \fontchart[0-256]{xmcb1000}\newpage
  \fontchart[0-256]{xmdb1000}\newpage
! \fontchart[0-256]{xmeb1000}\newpage\grayarea{63-127,127-256}
! \fontchart[0-144]{xmfb1000}\newpage\grayarea{0-0}
  
  \section{The Euler layout, normal version}
  
! \fontchart[0-256]{xea1000}\newpage\grayarea{90-127,127-256}
! \fontchart[0-172]{xeb1000}\newpage\grayarea{0-0}
  \fontchart[0-256]{xec1000}\newpage
  
  \section{The Euler layout, bold version}
  
! \fontchart[0-256]{xeab1000}\newpage\grayarea{90-127,127-256}
! \fontchart[0-172]{xebb1000}\newpage\grayarea{0-0}
  \fontchart[0-256]{xecb1000}\newpage
  
  \section{The concrete layout, normal version}
--- 490,538 ----
  variants of each glyphs. We have also created extensible fonts containing
  more larger variants. 
  
+ \clearpage
  \section{The cm layout, normal version}
  
! \normalchars\grayarea{0-0}
! \fontchart[0-256]{xma1000}\newpage
! \centerlargechars\grayarea{90-127,127-256,0-0}
! \fontchart[0-172]{xmb1000}\newpage
! \normalchars\grayarea{0-0}
  \fontchart[0-256]{xmc1000}\newpage
  \fontchart[0-256]{xmd1000}\newpage
! \fontchart[0-256]{xme1000}\newpage
! \centerlargechars\grayarea{63-127,127-256,0-0}
! \fontchart[0-144]{xmf1000}\newpage
  
  \section{The cm layout, bold version}
  
! \normalchars\grayarea{0-0}
! \fontchart[0-256]{xmab1000}\newpage
! \centerlargechars\grayarea{90-127,127-256,0-0}
! \fontchart[0-172]{xmbb1000}\newpage
! \normalchars\grayarea{0-0}
  \fontchart[0-256]{xmcb1000}\newpage
  \fontchart[0-256]{xmdb1000}\newpage
! \fontchart[0-256]{xmeb1000}\newpage
! \centerlargechars\grayarea{63-127,127-256,0-0}
! \fontchart[0-144]{xmfb1000}\newpage
  
  \section{The Euler layout, normal version}
  
! \normalchars\grayarea{0-0}
! \fontchart[0-256]{xea1000}\newpage
! \centerlargechars\grayarea{90-127,127-256,0-0}
! \fontchart[0-172]{xeb1000}\newpage
! \normalchars\grayarea{0-0}
  \fontchart[0-256]{xec1000}\newpage
  
  \section{The Euler layout, bold version}
  
! \normalchars\grayarea{0-0}
! \fontchart[0-256]{xeab1000}\newpage
! \centerlargechars\grayarea{90-127,127-256,0-0}
! \fontchart[0-172]{xebb1000}\newpage
! \normalchars\grayarea{0-0}
  \fontchart[0-256]{xecb1000}\newpage
  
  \section{The concrete layout, normal version}
*** fontchart.sty.orig	Sat Nov 22 02:09:46 1997
--- fontchart.sty	Thu Nov 27 01:45:56 1997
***************
*** 5,79 ****
  \RequirePackage{colortbl}
  \RequirePackage{multirow}
  
! \newcounter{chnum}
  \def\thegrayarea{0-0,}
! \def\grayarea#1{\def\thegrayarea{#1,0-0,}}
  \newif\ifingrayarea
! \def\checkgrayarea{\global\ingrayareafalse\expandafter\@checkga\thegrayarea}
  \def\@checkga#1-#2,{%
    \ifnum#1=#2%
      \let\next\relax
    \else
      \let\next\@checkga
!     \ifnum#1<\value{chnum}%
!       \ifnum#2>\value{chnum}% 
!         \global\ingrayareatrue
!       \fi 
!     \fi
    \fi   
    \next}
  
  \newlength{\cellwidth} 
! \setlength{\cellwidth}{(\textwidth-2cm)/8}
! \newcommand{\setchar}{\testfont\expandafter\char\value{chnum}}
  \newcommand{\tc}{%
    \ifingrayarea
    \multicolumn{1}{>{\columncolor[gray]{.9}}c|}{\setchar}%
!   \else\setchar
    \fi
!   \addtocounter{chnum}{1}%
    \checkgrayarea}
! \newcommand{\oct}[1]{\textrm{\'{}\kern-.2em\it#1\/\kern.05em}} % octal constant
! \newcommand{\hex}[1]{\textrm{\H{}\tt#1}} % hexadecimal constant
  \newcommand{\chartstrut}{\lower4.5pt\vbox to14pt{}}
! \newcount\tmpcount
  \newcommand{\octnum}{%
!   \tmpcount=\value{chnum}% 
!   \divide\tmpcount by 64\relax
!   \xdef\xx{\the\tmpcount}%
!   \multiply\tmpcount by-64\relax 
!   \advance\tmpcount by\value{chnum}%
!   \divide\tmpcount by 8\relax
!   \xdef\yy{\the\tmpcount}%
!   \oct{\xx\yy x}}
  \newcommand{\hexnum}{%
!   \tmpcount=\value{chnum}%
!   \advance\tmpcount by -8\relax
!   \divide\tmpcount by 16\relax
!   \xdef\xx{\the\tmpcount}%
!   \hex{\xx x}}
! \newcommand{\nobreakcline}[1]{\cline{#1}\noalign{\unskip\penalty10000}}
  \newcommand{\tworows}{%
!   \chartstrut\octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\multirow{2}{1cm}{\hexnum}\\* 
!   \nobreakcline{1-9}\chartstrut\octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\\\hline}
  \newcommand{\therows}{%
!   \expandafter\ifnum\lastchar>\value{chnum}  
!   \chartstrut\octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\multirow{2}{1cm}{\hexnum}\\* 
!   \nobreakcline{1-9}\chartstrut\octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\\\hline
    \expandafter\therows
    \fi}
  \newcommand{\fontchart}[1][0-256]{\fontchart@#1:}
  \def\fontchart@#1-#2:#3{%
!   \setcounter{chnum}{#1}%
!   \def\lastchar{#2}%
!   \font\testfont=#3%
    \renewcommand{\multirowsetup}{\centering}%
    \ingrayareafalse
!   \begin{longtable}{c|*{8}{c|}c}
!     \chartstrut&\oct0&\oct1&\oct2&\oct3&\oct4&\oct5&\oct6&\oct7&\\\hline\endhead
!     \chartstrut&\hex8&\hex9&\hex A&\hex B&\hex C&\hex D&\hex E&\hex F&\\\endfoot
      \therows
    \end{longtable}}
  
  
  
--- 5,112 ----
  \RequirePackage{colortbl}
  \RequirePackage{multirow}
  
! \newcount\chnum
! 
  \def\thegrayarea{0-0,}
! \def\grayarea#1{\def\thegrayarea{#1,}}
  \newif\ifingrayarea
! \def\checkgrayarea{%
!   \global\ingrayareafalse
!   \expandafter\@checkga\thegrayarea}
  \def\@checkga#1-#2,{%
    \ifnum#1=#2%
      \let\next\relax
    \else
      \let\next\@checkga
!     \ifnum#1<\chnum\ifnum#2>\chnum
!       \global\ingrayareatrue
!     \fi\fi
    \fi   
    \next}
  
+ \setlength{\@tempdima}{\textwidth}
+ \addtolength{\@tempdima}{-20\tabcolsep}
+ \addtolength{\@tempdima}{-10\arrayrulewidth}
+ \divide\@tempdima by 10
+ 
  \newlength{\cellwidth} 
! \setlength{\cellwidth}{\@tempdima}
! 
  \newcommand{\tc}{%
    \ifingrayarea
    \multicolumn{1}{>{\columncolor[gray]{.9}}c|}{\setchar}%
!   \else
!   \multicolumn{1}{c|}{\setchar}%
    \fi
!   \global\advance\chnum\@ne
    \checkgrayarea}
! 
! \newcommand{\setchar}{%
!   \setbox0=\hbox{\testfont\char\chnum}%
!   \ifdim\ht0>7.5pt\reposition
!   \else\ifdim\dp0>2.5pt\reposition\fi\fi
!   \hbox to\cellwidth{\hss\box0\hss}}
! 
! \def\centerlargechars{\def\reposition{%
!     \setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}}
! \def\normalchars{\def\reposition{%
!     \setbox0=\vbox{\kern2pt\box0}%
!     \dimen@=\dp0\advance\dimen@ 2pt \dp0=\dimen@}}
! \normalchars
! 
! \newcommand{\oct}[1]{{\rm\'{}\kern-.2em\it#1\/\kern.05em}}
! \newcommand{\hex}[1]{{\rm\H{}\tt#1}}
  \newcommand{\chartstrut}{\lower4.5pt\vbox to14pt{}}
! 
! \def\setdigs#1"#2{\gdef\h{#2}}
  \newcommand{\octnum}{%
!   \@tempcnta=\chnum 
!   \divide\@tempcnta by 64
!   \xdef\0{\the\@tempcnta}%
!   \multiply\@tempcnta by-64 
!   \advance\@tempcnta by\chnum
!   \divide\@tempcnta by 8
!   \xdef\1{\the\@tempcnta}%
!   \hbox to \cellwidth{\hss\oct{\0\1x}\hss}}
  \newcommand{\hexnum}{%
!   \@tempcnta=\chnum
!   \advance\@tempcnta by-8
!   \divide\@tempcnta by 16
!   \chardef\tmpchar=\@tempcnta
!   \expandafter\setdigs\meaning\tmpchar
!   \hbox to \cellwidth{\hss\hex{\h x}\hss}}
! 
! \newcommand{\nobreakcline}[1]{\cline{#1}\noalign{\unskip\penalty\@M}}
  \newcommand{\tworows}{%
!   \chartstrut\octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&
!   \multirow{2}{1cm}{\hexnum}\\*
!   \nobreakcline{1-9}
!   \chartstrut\octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\\\hline}
  \newcommand{\therows}{%
!   \ifnum\lastchar>\chnum  
!   \chartstrut\octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&
!   \multirow{2}{1cm}{\hexnum}\\* 
!   \nobreakcline{1-9}\chartstrut
!   \octnum&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\tc&\\\hline
    \expandafter\therows
    \fi}
  \newcommand{\fontchart}[1][0-256]{\fontchart@#1:}
  \def\fontchart@#1-#2:#3{%
!   \def\firstchar{#1}\def\lastchar{#2}%
!   \chnum=#1%
!   \font\testfont=#3
    \renewcommand{\multirowsetup}{\centering}%
    \ingrayareafalse
!   \begin{longtable}{c|c|c|c|c|c|c|c|c|c}
!     \chartstrut
!     &\oct0&\oct1&\oct2&\oct3&\oct4&\oct5&\oct6&\oct7&\\\hline\endhead
!     \chartstrut
!     &\hex8&\hex9&\hex A&\hex B&\hex C&\hex D&\hex E&\hex F&\\\endfoot
      \therows
    \end{longtable}}
+ 
+ 
+