summaryrefslogtreecommitdiff
path: root/systems/tex-extensions/clasen/hz/hz.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /systems/tex-extensions/clasen/hz/hz.tex
Initial commit
Diffstat (limited to 'systems/tex-extensions/clasen/hz/hz.tex')
-rw-r--r--systems/tex-extensions/clasen/hz/hz.tex104
1 files changed, 104 insertions, 0 deletions
diff --git a/systems/tex-extensions/clasen/hz/hz.tex b/systems/tex-extensions/clasen/hz/hz.tex
new file mode 100644
index 0000000000..3ff4432261
--- /dev/null
+++ b/systems/tex-extensions/clasen/hz/hz.tex
@@ -0,0 +1,104 @@
+\documentclass[preprint]{ltugboat}
+\usepackage{shortvrb}
+\usepackage{url}
+
+\providecommand{\meta}[1]{\ensuremath{\langle\textit{#1}\rangle}}
+\makeatletter
+\providecommand{\eTeX}{$\m@th\varepsilon$-\TeX}
+\makeatother
+\hyphenation{pa-ra-me-ter}
+
+\emergencystretch=4mm
+\overfullrule=0pt
+\title{Why \TeX\ can't set the Gutenberg bible}
+\author{Matthias Clasen}
+%\address{}
+\netaddress{maclas@gmx.de}
+\setcounter{page}{1}
+
+\begin{document}
+\maketitle
+\MakeShortVerb{\|}
+
+\section{Introduction}
+
+\TeX's paragraph breaking algorithm is one of its virtues. It usually
+achieves a fairly uniform grey value throughout the page. If it can't achieve
+completely uniform spacing, the excess space is distributed among the
+interword spaces in the line.
+
+Thus \TeX\ doesn't use one technique for uniform spacing which was invented
+as far back as Gutenberg: variation of the letter width to make up excess
+space.
+
+I propose a minimalist extension of \TeX\ to enable it to use letters of
+variable width. The extension is to associate \textit{variants} with
+fonts. If \TeX\ is about to set character~|c| from font~|f|, it looks for
+character~|c| in all variants associated with~|f| and chooses the one
+which ``fits best in the current situation''. I.\,e.\ in a tight line,
+a narrow variant will be chosen, while a wide variant would be preferable
+in a loose line. The variability of the character width also influences the
+calculation of the badness during the paragraph breaking. This is the true
+strength of the extension: like |\emergencystretch|, it adds flexibility
+during paragraph breaking and thus increases the number of feasible
+breakpoints, but without tearing ugly holes in the shape of the paragraph.
+
+I call this a minimalist extension, because it completely ignores the
+questions of suitable font technology for automatic generation of font
+variants from existing fonts. From the point of view taken here, font
+variants are just separate |tfm| files which are only required to contain
+characters in the same positions. Furthermore \TeX\ assumes that the
+widths vary consistently between the variants, i.\,e.\ if variant~|f|
+contains \emph{one} character which is wider than the corresponding
+character in variant~|f'|, then \emph{all} characters from~|f| should
+be at least as wide as their counterparts in~|f'|.
+
+\section{Implementation}
+
+The changes to \TeX{} the program sketched above are realized in the
+change file |hz.ch|. It implements the new primitive
+\[\cs{fontvariant}\meta{font$_1$}=\meta{font$_2$}\]
+which declares \meta{font$_2$} to be a variant of \meta{font$_1$}
+(where \meta{font$_1$} and \meta{font$_2$} must be font identifiers).
+Font variants can only be removed \textit{en bloc}, by using
+|\nullfont| as \meta{font$_2$}.
+
+\TeX\ will use the fontvariants and allow the |\fontvariant| primitive only
+when the new integer parameter |\hzstate| has a positive value. Setting
+|\hzstate| to zero does \emph{not} remove the font variants previously
+declared.
+
+\TeX\ uses the font variants only when it looks for the width of a character.
+All other |tfm| informations, in particular kerning and ligaturing, are always
+taken from the base font.
+
+\section{Installation}
+
+ The change files are written for \TeX~3.1459. But it should need only
+ cosmetic changes to get them to work with other versions of \TeX3.
+
+ To make the change files for \TeX{} work, you have to apply the change file
+ |pre.ch| first. I have only tried these files with |web2c|, and
+ for that you need to surround the |web2c| change file with |pre-web2c.ch| and
+ |post-web2c.ch|. You also need the additional change file
+ |hz-post-web2c.ch|. If you want to use this change together with the
+ change for fixed-point arithmetic (|glue.ch|), then you also need
+ the file |hz-glue.ch|.
+
+ All this boils down to the command line
+
+\begin{verbatim}
+mv tex.ch tex.ch.orig
+tie -c tex.ch tex.web pre.ch hz.ch \
+ hz-glue.ch pre-web2c.ch \
+ tex.ch.orig post-web2c.ch \
+ hz-post-web2c.ch
+\end{verbatim}
+
+ \makesignature
+
+ \bibliographystyle{plain}
+ \bibliography{etex}
+
+\end{document}
+