Skip to content

Commit

Permalink
Manually merge branch 'gh478' into ltnew33
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankMittelbach committed May 17, 2021
2 parents 79ecdaf + 13cc212 commit 29315f8
Showing 1 changed file with 75 additions and 1 deletion.
76 changes: 75 additions & 1 deletion base/doc/ltnews33.tex
Expand Up @@ -124,7 +124,7 @@
\tubcommand{\input{tubltmac}}

\publicationmonth{June}
\publicationyear{2021 --- Draft Version 3a}
\publicationyear{2021 --- Draft Version 3b}

\publicationissue{33}

Expand Down Expand Up @@ -477,6 +477,80 @@ \subsection{Poor man's \cs{textasteriskcentered}}
\githubissue{502}


\subsection{A note on the \texttt{TS1} encoding}

The \enquote{text symbol encoding} (\texttt{TS1}) was originally
designed at the Cork Conference as a companion to the \texttt{T1}
encoding. In it various symbols that are not subject to hyphenation
got assembled and the \pkg{textcomp} package was developed to make
them accessible. Unfortunately the \TeX{} community was a bit too
enthusiastic and included several symbols only available in a few
\TeX{} fonts and some, such as the capital accents, not available at
all but developed as part of the reference font implementation.

In hindsight that was a very bad idea because it meant that other
existing fonts (at the time) and later new fonts that got developed
were unable to provide the full set of glyphs that made up the
\texttt{TS1} encoding. For existing free PostScript fonts people to
the extra effort and produced virtual fonts that faked (some) of
the missing glyphs. But this was and is a time consuming effort so it
was done only for a few basic fonts. But even then, only some fonts
included all glyphs from \texttt{TS1} so the \pkg{textcomp} already
back then contained a long list, dividing fonts into 5 categories
according to which glyphs were implemented and which were missing.

A couple of releases back the functionality of the \pkg{textcomp}
package got integrated into the core code of the \LaTeX{} kernel so
that its glyph definitions, e.g., \cs{textcopyright}, \cs{texteuro} or
\cs{textyen}, are now automatically available without the need to load
an additional package in the preamble.

At the time this happened many new free fonts had appeared and
unfortunately the chaos around the question \enquote{which glyphs of
the \texttt{TS1} encoding are implemented by which font} had
increased with it. Not only did one find many new holes it was next to
impossible to order the set of fonts into a reasonable set of
sub-encodings that are contained in each other in a single sequence.

In the end we decided on nine or ten sub-encodings with a reasonable
number of font in each so that all font implemented all glyphs of the
sub-encoding they got mapped to. Thus when typesetting with a font one
could be sure that a command like \cs{textcopyleft} would either
typeset the requested character (if the glyph was part of the
sub-encoding the font belonged to) or it would raise an error, saying
that the glyph is unavailable in that fact. The mapping would ensure
that \LaTeX{} always errs on the side of caution, because it might
claim a glyph is unavailable even though in fact it is.

For example, the old \texttt{pcr} (PostScript Courier) font (as well
as most other older PS fonts) is mapped to sub-encoding 5 and
therefore claims that \cs{textasciigrave} is unavailable even though
in fact for Courier this is not true. If one uses such a font and this
becomes an issue then there are a couple (suboptimal) possibilities.
For one, one can alter the mapping of Courier and pretend that belongs
to a fuller sub-encoding, e.g.
\begin{verbatim}
\DeclareEncodingSubset{TS1}{pcr}{2}
\end{verbatim}
The downside is, that \LaTeX{} then believes other glyphs that are in fact
unavailable are also there, so that it is important to check that the
final document doesn't have some missing glyphs.

An alternative is to pretend that \cs{textasciigrave} can always be
taken from the \texttt{TS1} encoding (no questions asked):
\begin{verbatim}
\DeclareTextSymbolDefault{\textasciigrave}{TS1}
\end{verbatim}
Again there is a danger that this is not true when it is used with a
different font and would then generate a missing glyph.

Finally, and possibly the best solution, if not impossible for other
reasons, is to simply use a different font, for example, to use the
\TeX{} Gyre Cursor font (a reimplementation of Courier but with a
much more complete glyph set).





\section{New or improved commands}
Expand Down

0 comments on commit 29315f8

Please sign in to comment.