diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/pkfix-helper |
Initial commit
Diffstat (limited to 'support/pkfix-helper')
-rw-r--r-- | support/pkfix-helper/README | 59 | ||||
-rw-r--r-- | support/pkfix-helper/encoding-samples.pdf | bin | 0 -> 653290 bytes | |||
-rw-r--r-- | support/pkfix-helper/encoding-samples.tex | 517 | ||||
-rwxr-xr-x | support/pkfix-helper/pkfix-helper | 1481 | ||||
-rw-r--r-- | support/pkfix-helper/pkfix-helper.1 | 516 | ||||
-rw-r--r-- | support/pkfix-helper/pkfix-helper.pdf | bin | 0 -> 68233 bytes |
6 files changed, 2573 insertions, 0 deletions
diff --git a/support/pkfix-helper/README b/support/pkfix-helper/README new file mode 100644 index 0000000000..7682a6ccad --- /dev/null +++ b/support/pkfix-helper/README @@ -0,0 +1,59 @@ + +---------------------------------------+ + | PKFIX-HELPER | + | | + | Help pkfix process PostScript files | + | produced by ancient versions of dvips | + | | + | Scott Pakin, scott+pkfh@pakin.org | + +---------------------------------------+ + + +Description +=========== + +pkfix is a useful utility for replacing resolution-dependent bitmapped +fonts in a dvips-produced PostScript file with the corresponding +resolution-independent vector fonts. Unfortunately, pkfix needs to +parse certain PostScript comments that appear only in files produced +by dvips versions later than 5.58 (ca. 1996); it fails to work on +PostScript files produced by older versions of dvips. + +pkfix-helper is a program that attempts to insert newer-dvips comments +into an older-dvips PostScript file, thereby making the file suitable +for processing by pkfix. pkfix-helper can sometimes process documents +fully autonomously but does require the user to verify and, if needed, +correct its decisions. + + +Installation +============ + +pkfix-helper has essentially the same requirements as pkfix. To run +it, you will need: + + * Perl (http://www.cpan.org/) + * Ghostscript (http://www.cs.wisc.edu/~ghost/) + * tftopl (comes with most TeX distributions) + +Simply copy pkfix-helper to somewhere in your search path (e.g., +/usr/local/bin/) and you should be good to go. You may also want to +install and/or print the documentation (pkfix-helper.pdf and +encoding-samples.pdf) and install the Unix man page (pkfix-helper.1). +At a minimum, you should *read* the documentation; pkfix-helper usage +is neither completely automatic nor completely intuitive. + + +Copyright and license +===================== + +Copyright (C) 2011, Scott Pakin + +This file may be distributed and/or modified under the conditions of +the LaTeX Project Public License, either version 1.3c of this license +or (at your option) any later version. The latest version of this +license is in: + + http://www.latex-project.org/lppl.txt + +and version 1.3c or later is part of all distributions of LaTeX +version 2006/05/20 or later. diff --git a/support/pkfix-helper/encoding-samples.pdf b/support/pkfix-helper/encoding-samples.pdf Binary files differnew file mode 100644 index 0000000000..3c73e8870b --- /dev/null +++ b/support/pkfix-helper/encoding-samples.pdf diff --git a/support/pkfix-helper/encoding-samples.tex b/support/pkfix-helper/encoding-samples.tex new file mode 100644 index 0000000000..70032dd3ac --- /dev/null +++ b/support/pkfix-helper/encoding-samples.tex @@ -0,0 +1,517 @@ +\documentclass{article} +\usepackage[compat2]{geometry} +\usepackage{array} +\usepackage{multicol} +\usepackage{dblfloatfix} +\usepackage{textcomp} +\usepackage{microtype} +\usepackage{hyperref} + +% Specify some document metadata. +\title{Samples of common \TeX\ font encodings} +\author{Scott Pakin \\ \textit{scott+pkfh@pakin.org}} +\hypersetup{% + pdftitle={Samples of common TeX font encodings}, + pdfauthor={Scott Pakin <scott+pkfh@pakin.org>}, + pdfsubject={Encoding samples to help identify font candidates}, + pdfkeywords={pkfix-helper, LaTeX, encodings, text, math, italics, symbols, + extension, Adobe, lines, circles} +} + +% Define some commands to set raw (i.e., not NFSS) fonts. +\newcommand{\applyfont}{} +\newcommand{\setrawfont}[1]{% + \fname{#1}% + \gdef\applyfont{\font\samplefont=#1 at 10pt\samplefont}% +} +\newcommand{\infont}[2]{{% + \font\samplefont=#1\samplefont + #2% +}}% + +% Keep certain names from straddling multiple lines. +\newcommand*{\pkfh}{\mbox{\textsf{pkfix-helper}}} +\newcommand*{\fname}[1]{\mbox{\textit{#1}}} +\newcommand*{\Xy}{\mbox{\kern-.1em X\kern-.3em\lower.4ex\hbox{Y\kern-.15em}}} + +% Put a little more space between columns. +\setlength{\columnsep}{1.5em} + + +\begin{document} +\maketitle + +\begin{multicols}{2} +The \pkfh\ program occasionally needs help from the user in selecting +an appropriate \textsc{tfm} file to match a Type~3 font found in a +PostScript document. This document assists with the task of +identifying fonts by presenting character-by-character comparisons of +all~256 character positions in a selection of common \TeX\ fonts. The +following encodings are represented: + +\begin{itemize} + \item \TeX\ text (e.g.,~\fname{cmr10}) + \item \TeX\ math italic (e.g.,~\fname{cmmi10}) + \item \TeX\ math symbols (e.g.,~\fname{cmsy10}, \fname{msam10}, and + \fname{msbm10}---each of which provides different symbols) + \item \LaTeX\ symbols (e.g.,~\fname{lasy10}) + \item \TeX\ math extension (e.g.,~\fname{cmex10}) + \item \TeX\ base~1 encoding (e.g.,~\fname{ptmr8r}) + \item Adobe standard encoding (e.g.,~\fname{rptmr}) + \item Adobe symbol encoding (e.g.,~\fname{rpsyr}) + \item \TeX\ extended ASCII (e.g.,~\fname{cmtex10}) + \item extended \TeX\ font encoding (e.g.,~\fname{ecrm1000}) + \item \TeX\ text companion symbols (e.g.,~\fname{tcrm1000}) + \item \TeX\ text subset (e.g.,~\fname{eufm10}, which provides fraktur + letters for mathematical typesetting) + \item unspecified (e.g.,~\fname{stmary10}; \fname{wasy10} is + also included here although it erroneously claims to be \TeX\ text) +\end{itemize} + +The following encodings are not shown in this document because the +glyphs they provide exhibit little variety and are therefore +relatively easy to identify: + +\begin{itemize} + \item \LaTeX\ line (e.g.,~\fname{line10})---line segments and arrowheads + in different lengths and orientations + \item \LaTeX\ circle (e.g.,~\fname{lcircle10})---circles and + 90\textdegree\ arcs in different sizes + \item \Xy\ line segments (e.g.,~\fname{xyline10})---line segments + in different orientations + \item \Xy\ miscellaneous (e.g.,~\fname{xymisc})---90\textdegree\ + arcs in different sizes + \item \Xy\ quarter circles (e.g.,~\fname{xyqc10})---small 90\textdegree\ + arcs in different orientations + \item \Xy-pic 1/8 circles (e.g.,~\fname{xycirc10})---45\textdegree\ + arcs in different sizes + \item \Xy-pic directional (e.g.,~\fname{xyatip10}, \fname{xybsql10}, + \fname{xybtip10}, and many others)---small-degree arcs in different + orientations + \item \Xy-pic semidirectional (e.g.,~\fname{xydash10})---short line + segments in different orientations +\end{itemize} + +To use the tables that appear below, first produce ``before'' and +``after'' font sheets using \pkfh's \verb|--ps| and \verb|--tex| +options. (See the \pkfh\ documentation for details.) For each font +in which the ``after'' characters are completely different from the +``before'' characters---as opposed to merely the wrong selection of +font size, weight, or slant---make a note of the font that \pkfh\ +announced it had selected. Find the table and column in which the +``before'' symbol exists and the ``after'' symbol is associated with +the font selected by \pkfh. The font associated with the ``before'' +symbol is what should be specified in a \verb|--force| option to +\pkfh. For example, consider the observations shown in +Figure~\ref{fig:pkfh-observations}. We find that the ``after'' +character, ``\infont{cmmib10}{\char17}'', is associated with +\fname{cmmi10} (the same typeface used for \fname{cmmib10} but in book +weight) at character position~17. The ``before'' character, +``\infont{cmsy9}{\char17}'', is also present in position~17 and is +associated with \fname{cmsy10}. Therefore, we should re-run \pkfh\ +with the \verb|--force="Fj=cmsy10 @ 1.2X"| option to force it to +associate document font~\fname{Fj} with \fname{cmsy10} instead of +\fname{cmmib10}. + +Once the correct typeface is identified, the font size may need +adjusting. In the preceding example, \verb|--force="Fj=cmsy9"| may +produce less mismatch for \texttt{cmmib10~@ 1.2X} than does +\verb|--force="Fj=cmsy10 @| \verb|1.2X"|. Making such a determination +requires human involvement. A suggested approach is first to let +\pkfh\ identify the size and scale automatically by specifying +\verb|--force="Fj=cmsy*@*"|. If doing so produces a poor match or +selects an unlikely scale factor, then the user should manually adjust +the font size and/or scale factor. \end{multicols} + +\begin{figure*}[bp] + \centering + \begin{tabular}{|ll|} + \hline + \pkfh: & \texttt{Processing Fj ... done (cmmib10 @ 1.2X, mismatch=0.00073)} \\[2ex] + \texttt{--ps} file: & \infont{cmb10 at 12pt}{Fj:}\qquad + \infont{cmsy9}{\char17} \\ + \texttt{--tex} file: & \infont{cmb10 at 12pt}{Fj:}\qquad + \infont{cmmib10}{\char17} \\ + \hline + \end{tabular} + \caption{Sample observations of \pkfh\ output and output files} + \label{fig:pkfh-observations} +\end{figure*} + +\clearpage + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{0}& \multicolumn{1}{c}{1}& \multicolumn{1}{c}{2}& \multicolumn{1}{c}{3}& \multicolumn{1}{c}{4}& \multicolumn{1}{c}{5}& \multicolumn{1}{c}{6}& \multicolumn{1}{c}{7}& \multicolumn{1}{c}{8}& \multicolumn{1}{c}{9}& \multicolumn{1}{c}{10}& \multicolumn{1}{c}{11}& \multicolumn{1}{c}{12}& \multicolumn{1}{c}{13}& \multicolumn{1}{c}{14}& \multicolumn{1}{c}{15}\\ + \cline{2-17} + \setrawfont{cmr10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{cmmi10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{cmsy10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{msam10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{msbm10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{lasy10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{cmex10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{ptmr8r} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{rptmr} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{rpsyr} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{cmtex10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{ecrm1000} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{tcrm1000} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{eufm10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{stmary10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \setrawfont{wasy10} & \char0 & \char1 & \char2 & \char3 & \char4 & \char5 & \char6 & \char7 & \char8 & \char9 & \char10 & \char11 & \char12 & \char13 & \char14 & \char15 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{16}& \multicolumn{1}{c}{17}& \multicolumn{1}{c}{18}& \multicolumn{1}{c}{19}& \multicolumn{1}{c}{20}& \multicolumn{1}{c}{21}& \multicolumn{1}{c}{22}& \multicolumn{1}{c}{23}& \multicolumn{1}{c}{24}& \multicolumn{1}{c}{25}& \multicolumn{1}{c}{26}& \multicolumn{1}{c}{27}& \multicolumn{1}{c}{28}& \multicolumn{1}{c}{29}& \multicolumn{1}{c}{30}& \multicolumn{1}{c}{31}\\ + \cline{2-17} + \setrawfont{cmr10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{cmmi10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{cmsy10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{msam10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{msbm10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{lasy10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{cmex10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{ptmr8r} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{rptmr} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{rpsyr} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{cmtex10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{ecrm1000} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{tcrm1000} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{eufm10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{stmary10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \setrawfont{wasy10} & \char16 & \char17 & \char18 & \char19 & \char20 & \char21 & \char22 & \char23 & \char24 & \char25 & \char26 & \char27 & \char28 & \char29 & \char30 & \char31 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + +\end{tabular} +\end{center} + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{32}& \multicolumn{1}{c}{33}& \multicolumn{1}{c}{34}& \multicolumn{1}{c}{35}& \multicolumn{1}{c}{36}& \multicolumn{1}{c}{37}& \multicolumn{1}{c}{38}& \multicolumn{1}{c}{39}& \multicolumn{1}{c}{40}& \multicolumn{1}{c}{41}& \multicolumn{1}{c}{42}& \multicolumn{1}{c}{43}& \multicolumn{1}{c}{44}& \multicolumn{1}{c}{45}& \multicolumn{1}{c}{46}& \multicolumn{1}{c}{47}\\ + \cline{2-17} + \setrawfont{cmr10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{cmmi10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{cmsy10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{msam10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{msbm10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{lasy10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{cmex10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{ptmr8r} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{rptmr} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{rpsyr} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{cmtex10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{ecrm1000} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{tcrm1000} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{eufm10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{stmary10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \setrawfont{wasy10} & \char32 & \char33 & \char34 & \char35 & \char36 & \char37 & \char38 & \char39 & \char40 & \char41 & \char42 & \char43 & \char44 & \char45 & \char46 & \char47 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{48}& \multicolumn{1}{c}{49}& \multicolumn{1}{c}{50}& \multicolumn{1}{c}{51}& \multicolumn{1}{c}{52}& \multicolumn{1}{c}{53}& \multicolumn{1}{c}{54}& \multicolumn{1}{c}{55}& \multicolumn{1}{c}{56}& \multicolumn{1}{c}{57}& \multicolumn{1}{c}{58}& \multicolumn{1}{c}{59}& \multicolumn{1}{c}{60}& \multicolumn{1}{c}{61}& \multicolumn{1}{c}{62}& \multicolumn{1}{c}{63}\\ + \cline{2-17} + \setrawfont{cmr10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{cmmi10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{cmsy10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{msam10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{msbm10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{lasy10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{cmex10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{ptmr8r} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{rptmr} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{rpsyr} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{cmtex10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{ecrm1000} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{tcrm1000} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{eufm10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{stmary10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \setrawfont{wasy10} & \char48 & \char49 & \char50 & \char51 & \char52 & \char53 & \char54 & \char55 & \char56 & \char57 & \char58 & \char59 & \char60 & \char61 & \char62 & \char63 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + +\end{tabular} +\end{center} + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{64}& \multicolumn{1}{c}{65}& \multicolumn{1}{c}{66}& \multicolumn{1}{c}{67}& \multicolumn{1}{c}{68}& \multicolumn{1}{c}{69}& \multicolumn{1}{c}{70}& \multicolumn{1}{c}{71}& \multicolumn{1}{c}{72}& \multicolumn{1}{c}{73}& \multicolumn{1}{c}{74}& \multicolumn{1}{c}{75}& \multicolumn{1}{c}{76}& \multicolumn{1}{c}{77}& \multicolumn{1}{c}{78}& \multicolumn{1}{c}{79}\\ + \cline{2-17} + \setrawfont{cmr10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{cmmi10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{cmsy10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{msam10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{msbm10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{lasy10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{cmex10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{ptmr8r} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{rptmr} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{rpsyr} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{cmtex10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{ecrm1000} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{tcrm1000} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{eufm10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{stmary10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \setrawfont{wasy10} & \char64 & \char65 & \char66 & \char67 & \char68 & \char69 & \char70 & \char71 & \char72 & \char73 & \char74 & \char75 & \char76 & \char77 & \char78 & \char79 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{80}& \multicolumn{1}{c}{81}& \multicolumn{1}{c}{82}& \multicolumn{1}{c}{83}& \multicolumn{1}{c}{84}& \multicolumn{1}{c}{85}& \multicolumn{1}{c}{86}& \multicolumn{1}{c}{87}& \multicolumn{1}{c}{88}& \multicolumn{1}{c}{89}& \multicolumn{1}{c}{90}& \multicolumn{1}{c}{91}& \multicolumn{1}{c}{92}& \multicolumn{1}{c}{93}& \multicolumn{1}{c}{94}& \multicolumn{1}{c}{95}\\ + \cline{2-17} + \setrawfont{cmr10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{cmmi10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{cmsy10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{msam10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{msbm10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{lasy10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{cmex10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{ptmr8r} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{rptmr} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{rpsyr} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{cmtex10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{ecrm1000} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{tcrm1000} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{eufm10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{stmary10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \setrawfont{wasy10} & \char80 & \char81 & \char82 & \char83 & \char84 & \char85 & \char86 & \char87 & \char88 & \char89 & \char90 & \char91 & \char92 & \char93 & \char94 & \char95 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + +\end{tabular} +\end{center} + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{96}& \multicolumn{1}{c}{97}& \multicolumn{1}{c}{98}& \multicolumn{1}{c}{99}& \multicolumn{1}{c}{100}& \multicolumn{1}{c}{101}& \multicolumn{1}{c}{102}& \multicolumn{1}{c}{103}& \multicolumn{1}{c}{104}& \multicolumn{1}{c}{105}& \multicolumn{1}{c}{106}& \multicolumn{1}{c}{107}& \multicolumn{1}{c}{108}& \multicolumn{1}{c}{109}& \multicolumn{1}{c}{110}& \multicolumn{1}{c}{111}\\ + \cline{2-17} + \setrawfont{cmr10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{cmmi10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{cmsy10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{msam10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{msbm10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{lasy10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{cmex10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{ptmr8r} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{rptmr} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{rpsyr} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{cmtex10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{ecrm1000} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{tcrm1000} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{eufm10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{stmary10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \setrawfont{wasy10} & \char96 & \char97 & \char98 & \char99 & \char100 & \char101 & \char102 & \char103 & \char104 & \char105 & \char106 & \char107 & \char108 & \char109 & \char110 & \char111 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{112}& \multicolumn{1}{c}{113}& \multicolumn{1}{c}{114}& \multicolumn{1}{c}{115}& \multicolumn{1}{c}{116}& \multicolumn{1}{c}{117}& \multicolumn{1}{c}{118}& \multicolumn{1}{c}{119}& \multicolumn{1}{c}{120}& \multicolumn{1}{c}{121}& \multicolumn{1}{c}{122}& \multicolumn{1}{c}{123}& \multicolumn{1}{c}{124}& \multicolumn{1}{c}{125}& \multicolumn{1}{c}{126}& \multicolumn{1}{c}{127}\\ + \cline{2-17} + \setrawfont{cmr10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{cmmi10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{cmsy10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{msam10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{msbm10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{lasy10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{cmex10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{ptmr8r} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{rptmr} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{rpsyr} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{cmtex10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{ecrm1000} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{tcrm1000} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{eufm10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{stmary10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \setrawfont{wasy10} & \char112 & \char113 & \char114 & \char115 & \char116 & \char117 & \char118 & \char119 & \char120 & \char121 & \char122 & \char123 & \char124 & \char125 & \char126 & \char127 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + +\end{tabular} +\end{center} + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{128}& \multicolumn{1}{c}{129}& \multicolumn{1}{c}{130}& \multicolumn{1}{c}{131}& \multicolumn{1}{c}{132}& \multicolumn{1}{c}{133}& \multicolumn{1}{c}{134}& \multicolumn{1}{c}{135}& \multicolumn{1}{c}{136}& \multicolumn{1}{c}{137}& \multicolumn{1}{c}{138}& \multicolumn{1}{c}{139}& \multicolumn{1}{c}{140}& \multicolumn{1}{c}{141}& \multicolumn{1}{c}{142}& \multicolumn{1}{c}{143}\\ + \cline{2-17} + \setrawfont{cmr10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{cmmi10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{cmsy10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{msam10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{msbm10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{lasy10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{cmex10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{ptmr8r} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{rptmr} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{rpsyr} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{cmtex10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{ecrm1000} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{tcrm1000} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{eufm10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{stmary10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \setrawfont{wasy10} & \char128 & \char129 & \char130 & \char131 & \char132 & \char133 & \char134 & \char135 & \char136 & \char137 & \char138 & \char139 & \char140 & \char141 & \char142 & \char143 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{144}& \multicolumn{1}{c}{145}& \multicolumn{1}{c}{146}& \multicolumn{1}{c}{147}& \multicolumn{1}{c}{148}& \multicolumn{1}{c}{149}& \multicolumn{1}{c}{150}& \multicolumn{1}{c}{151}& \multicolumn{1}{c}{152}& \multicolumn{1}{c}{153}& \multicolumn{1}{c}{154}& \multicolumn{1}{c}{155}& \multicolumn{1}{c}{156}& \multicolumn{1}{c}{157}& \multicolumn{1}{c}{158}& \multicolumn{1}{c}{159}\\ + \cline{2-17} + \setrawfont{cmr10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{cmmi10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{cmsy10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{msam10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{msbm10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{lasy10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{cmex10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{ptmr8r} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{rptmr} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{rpsyr} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{cmtex10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{ecrm1000} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{tcrm1000} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{eufm10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{stmary10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \setrawfont{wasy10} & \char144 & \char145 & \char146 & \char147 & \char148 & \char149 & \char150 & \char151 & \char152 & \char153 & \char154 & \char155 & \char156 & \char157 & \char158 & \char159 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + +\end{tabular} +\end{center} + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{160}& \multicolumn{1}{c}{161}& \multicolumn{1}{c}{162}& \multicolumn{1}{c}{163}& \multicolumn{1}{c}{164}& \multicolumn{1}{c}{165}& \multicolumn{1}{c}{166}& \multicolumn{1}{c}{167}& \multicolumn{1}{c}{168}& \multicolumn{1}{c}{169}& \multicolumn{1}{c}{170}& \multicolumn{1}{c}{171}& \multicolumn{1}{c}{172}& \multicolumn{1}{c}{173}& \multicolumn{1}{c}{174}& \multicolumn{1}{c}{175}\\ + \cline{2-17} + \setrawfont{cmr10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{cmmi10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{cmsy10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{msam10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{msbm10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{lasy10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{cmex10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{ptmr8r} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{rptmr} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{rpsyr} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{cmtex10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{ecrm1000} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{tcrm1000} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{eufm10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{stmary10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \setrawfont{wasy10} & \char160 & \char161 & \char162 & \char163 & \char164 & \char165 & \char166 & \char167 & \char168 & \char169 & \char170 & \char171 & \char172 & \char173 & \char174 & \char175 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{176}& \multicolumn{1}{c}{177}& \multicolumn{1}{c}{178}& \multicolumn{1}{c}{179}& \multicolumn{1}{c}{180}& \multicolumn{1}{c}{181}& \multicolumn{1}{c}{182}& \multicolumn{1}{c}{183}& \multicolumn{1}{c}{184}& \multicolumn{1}{c}{185}& \multicolumn{1}{c}{186}& \multicolumn{1}{c}{187}& \multicolumn{1}{c}{188}& \multicolumn{1}{c}{189}& \multicolumn{1}{c}{190}& \multicolumn{1}{c}{191}\\ + \cline{2-17} + \setrawfont{cmr10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{cmmi10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{cmsy10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{msam10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{msbm10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{lasy10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{cmex10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{ptmr8r} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{rptmr} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{rpsyr} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{cmtex10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{ecrm1000} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{tcrm1000} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{eufm10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{stmary10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \setrawfont{wasy10} & \char176 & \char177 & \char178 & \char179 & \char180 & \char181 & \char182 & \char183 & \char184 & \char185 & \char186 & \char187 & \char188 & \char189 & \char190 & \char191 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + +\end{tabular} +\end{center} + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{192}& \multicolumn{1}{c}{193}& \multicolumn{1}{c}{194}& \multicolumn{1}{c}{195}& \multicolumn{1}{c}{196}& \multicolumn{1}{c}{197}& \multicolumn{1}{c}{198}& \multicolumn{1}{c}{199}& \multicolumn{1}{c}{200}& \multicolumn{1}{c}{201}& \multicolumn{1}{c}{202}& \multicolumn{1}{c}{203}& \multicolumn{1}{c}{204}& \multicolumn{1}{c}{205}& \multicolumn{1}{c}{206}& \multicolumn{1}{c}{207}\\ + \cline{2-17} + \setrawfont{cmr10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{cmmi10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{cmsy10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{msam10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{msbm10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{lasy10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{cmex10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{ptmr8r} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{rptmr} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{rpsyr} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{cmtex10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{ecrm1000} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{tcrm1000} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{eufm10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{stmary10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \setrawfont{wasy10} & \char192 & \char193 & \char194 & \char195 & \char196 & \char197 & \char198 & \char199 & \char200 & \char201 & \char202 & \char203 & \char204 & \char205 & \char206 & \char207 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{208}& \multicolumn{1}{c}{209}& \multicolumn{1}{c}{210}& \multicolumn{1}{c}{211}& \multicolumn{1}{c}{212}& \multicolumn{1}{c}{213}& \multicolumn{1}{c}{214}& \multicolumn{1}{c}{215}& \multicolumn{1}{c}{216}& \multicolumn{1}{c}{217}& \multicolumn{1}{c}{218}& \multicolumn{1}{c}{219}& \multicolumn{1}{c}{220}& \multicolumn{1}{c}{221}& \multicolumn{1}{c}{222}& \multicolumn{1}{c}{223}\\ + \cline{2-17} + \setrawfont{cmr10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{cmmi10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{cmsy10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{msam10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{msbm10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{lasy10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{cmex10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{ptmr8r} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{rptmr} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{rpsyr} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{cmtex10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{ecrm1000} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{tcrm1000} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{eufm10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{stmary10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \setrawfont{wasy10} & \char208 & \char209 & \char210 & \char211 & \char212 & \char213 & \char214 & \char215 & \char216 & \char217 & \char218 & \char219 & \char220 & \char221 & \char222 & \char223 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + +\end{tabular} +\end{center} + +\begin{center} +\begin{tabular}{l|*{16}{>{\applyfont}c|}} + \multicolumn{1}{l}{} & \multicolumn{1}{c}{224}& \multicolumn{1}{c}{225}& \multicolumn{1}{c}{226}& \multicolumn{1}{c}{227}& \multicolumn{1}{c}{228}& \multicolumn{1}{c}{229}& \multicolumn{1}{c}{230}& \multicolumn{1}{c}{231}& \multicolumn{1}{c}{232}& \multicolumn{1}{c}{233}& \multicolumn{1}{c}{234}& \multicolumn{1}{c}{235}& \multicolumn{1}{c}{236}& \multicolumn{1}{c}{237}& \multicolumn{1}{c}{238}& \multicolumn{1}{c}{239}\\ + \cline{2-17} + \setrawfont{cmr10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{cmmi10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{cmsy10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{msam10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{msbm10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{lasy10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{cmex10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{ptmr8r} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{rptmr} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{rpsyr} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{cmtex10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{ecrm1000} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{tcrm1000} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{eufm10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{stmary10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \setrawfont{wasy10} & \char224 & \char225 & \char226 & \char227 & \char228 & \char229 & \char230 & \char231 & \char232 & \char233 & \char234 & \char235 & \char236 & \char237 & \char238 & \char239 \\ + \cline{2-17} + \multicolumn{17}{c}{} \\ + + \multicolumn{1}{l}{} & \multicolumn{1}{c}{240}& \multicolumn{1}{c}{241}& \multicolumn{1}{c}{242}& \multicolumn{1}{c}{243}& \multicolumn{1}{c}{244}& \multicolumn{1}{c}{245}& \multicolumn{1}{c}{246}& \multicolumn{1}{c}{247}& \multicolumn{1}{c}{248}& \multicolumn{1}{c}{249}& \multicolumn{1}{c}{250}& \multicolumn{1}{c}{251}& \multicolumn{1}{c}{252}& \multicolumn{1}{c}{253}& \multicolumn{1}{c}{254}& \multicolumn{1}{c}{255}\\ + \cline{2-17} + \setrawfont{cmr10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{cmmi10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{cmsy10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{msam10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{msbm10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{lasy10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{cmex10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{ptmr8r} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{rptmr} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{rpsyr} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{cmtex10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{ecrm1000} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{tcrm1000} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{eufm10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{stmary10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \setrawfont{wasy10} & \char240 & \char241 & \char242 & \char243 & \char244 & \char245 & \char246 & \char247 & \char248 & \char249 & \char250 & \char251 & \char252 & \char253 & \char254 & \char255 \\ + \cline{2-17} +\end{tabular} +\end{center} + +\end{document} diff --git a/support/pkfix-helper/pkfix-helper b/support/pkfix-helper/pkfix-helper new file mode 100755 index 0000000000..3578293120 --- /dev/null +++ b/support/pkfix-helper/pkfix-helper @@ -0,0 +1,1481 @@ +#! /usr/bin/env perl + +############################################# +# Help pkfix decipher fonts in a PostScript # +# file produced by an ancient dvips # +# # +# By Scott Pakin <scott+pkfh@pakin.org> # +############################################# + +use File::Spec; +use File::Temp qw (tempfile); +use File::Basename; +use Getopt::Long; +use Pod::Usage; +use warnings; +use strict; + +# Define some global variables. +my $progname = basename $0; # Name of this program +our $VERSION = "1.4"; # Version number of this program +my %name2chars; # Map from a font name to a character list +my $GS = $ENV{"GS"} || "gs"; # Name of the Ghostscript interpreter +my $TFTOPL = $ENV{"TFTOPL"} || "tftopl"; # Name of the TFM to PL converter +my $dpi = 300; # Number of dots per inch used to generate bitmapped characters +my @tfmlist; # List of TFM files to use +my %fontmatch; # Map from a font name to its best match +my $xinc = 36; # Width of font name in PostScript points +my $yinc = 24; # Height of font in PostScript points +my $init_yinc = 36; # Space after title +my %tfmfontwidth; # Map from font name to character number to character width +my %tfm2size; # Map from font name to design size +my %tfmmissing; # Set of TFM files we looked for but didn't find +my ($dvips_xscale, $dvips_yscale); # Scaling factors from Dvips's PostScript CTM +my $discard_output = $^O eq "MSWin32" ? "> NUL:" : "> /dev/null 2>&1"; # Command suffix to discard all output + +# Define the global variables that the user can modify from the command line. +my $wanthelp = 0; # 1=user wants to see the program's documentation +my $wantversion = 0; # 1=user wants to see the program's version number +my $verbose = 1; # 0=quiet; 1=verbose output; 2=more verbose output +my @forced_fonts; # Font mappings the user asserts are correct +my @exclude_res; # Regexps for fonts to exclude +my @extra_tfms; # Extra TFM files to use +my %retained_t3s; # Type 3 fonts to retain as is +my $sample_file_ps; # Name of a PostScript file of font samples to write +my $sample_file_tex; # Name of a TeX file of font samples to write +my $single_font_use = 0; # 1=one use per font; 0=allow repetitions +my $samples_per_page = 25; # Number of font samples to print per page +my $tfm_cache_file; # Name of a file in which to cache font metrics +my $any_scale = 0; # 0=1X, 1.1X, 1.2X, ...; 1=any scale is allowed + +########################################################################### + +# Read %tfm2size, %tfmfontwidth, and %tfmmissing from a file named by +# $tfm_cache_file. +sub read_tfm_cache_file +{ + open(CACHEFILE, "<", $tfm_cache_file) || do { + print STDERR "Ignoring TFM cache file $tfm_cache_file ($!).\n" if $verbose; + return; + }; + print STDERR "Reading TFM data from $tfm_cache_file ... " if $verbose; + my $numlines = 0; + while (my $oneline = <CACHEFILE>) { + chomp $oneline; + my @fields = split " ", $oneline; + die "${progname}: Internal error" if $#fields == -1; + my $tfm = shift @fields; + if ($#fields == -1) { + # No metrics -- TFM file must not have been found. + $tfmmissing{$tfm} = 1; + } + else { + # Parse and store the TFM data. + $tfm2size{$tfm} = shift @fields; + my %widths = @fields; + $tfmfontwidth{$tfm} = \%widths; + } + $numlines++; + } + close CACHEFILE; + print STDERR "done ($numlines entries).\n" if $verbose; +} + + +# Write %tfm2size, %tfmfontwidth, and %tfmmissing to a file named by +# $tfm_cache_file. +sub write_tfm_cache_file +{ + my $numlines = 0; + print STDERR "Writing TFM data to $tfm_cache_file ... " if $verbose; + open(CACHEFILE, ">", $tfm_cache_file) || die "${progname}: Failed to create $tfm_cache_file ($!)\n"; + while (my ($tfm, $size) = each %tfm2size) { + my @widths = %{$tfmfontwidth{$tfm}}; + print CACHEFILE "$tfm $size @widths\n"; + $numlines++; + } + foreach my $tfm (keys %tfmmissing) { + print CACHEFILE "$tfm\n"; + $numlines++; + } + close CACHEFILE; + print STDERR "done ($numlines entries).\n" if $verbose; +} + + +# Given the base name of a .tfm file, process the file and return the +# font's design size and a mapping from character number to character +# width. +sub tfm2widths ($) +{ + my $tfmname = $_[0]; # Name of the TFM file + my $designsize; # Design size of the font + my %num2width; # Resultant mapping + my $plname; # Name of PL file; some tftopl programs can't write to stdout. + my $plfile; # Filehandle corresponding to $plname + + # First see if the information is already cached. + if (defined $tfm2size{$tfmname}) { + print STDERR " Processing $tfmname ... cached.\n" if $verbose >= 2; + return [$tfm2size{$tfmname}, %{$tfmfontwidth{$tfmname}}]; + } + if (defined $tfmmissing{$tfmname}) { + print STDERR " Processing $tfmname ... cached as not found.\n" if $verbose >= 2; + return [$designsize, %num2width]; + } + + # The information is not cached -- read it from a file. + ($plfile, $plname) = tempfile (DIR => File::Spec->tmpdir(), SUFFIX => ".pl"); + close $plfile; + if (!system "$TFTOPL $tfmname $plname $discard_output") { + print STDERR " Processing $tfmname ... " if $verbose >= 2; + open (PLFILE, "<$plname") || die "${progname}: Unable to open $tfmname ($!)\n"; + my $charnum; # Current character number + while (my $oneline = <PLFILE>) { + # Store the current character width. + $oneline =~ /\(CHARWD R (\S+)\)/ && do { + $num2width{$charnum} = $1 * $designsize; + next; + }; + + # Store the current character number. + $oneline =~ /\(CHARACTER (\S) (\S+)/ && do { + if ($1 eq "O") { + # Octal character number + $charnum = oct $2; + } + elsif ($1 eq "C") { + # ASCII character number + $charnum = ord $2; + } + else { + die "${progname}: Unknown TFM character type \"$1\"\n"; + } + next; + }; + + # Store the font design size. + $oneline =~ /\(DESIGNSIZE R (\S+)\)/ && do { + $designsize = $1 + 0.0; + next; + }; + } + close PLFILE; + print STDERR "done.\n" if $verbose >= 2; + } + else { + print STDERR " Discarding $tfmname (not found).\n" if $verbose >= 3; + } + unlink $plname; + return [$designsize, %num2width]; +} + + +# Given two character maps, one for a document font and one for a TFM +# file, return the optimal scale factor for the TFM file to best match +# the document font. +sub optimal_scale ($$) +{ + my %docmap = %{$_[0]}; # Map for a document font + my %tfmmap = %{$_[1]}; # Map for a TFM font + my $doc_dot_tfm = 0.0; # Sum of $docmap{$c}*$tfmmap{$c} for all $c + my $tfm_dot_tfm = 0.0; # Sum of $tfmmap{$c}**2 for all $c + + while (my ($char, $docwidth) = each %docmap) { + my $tfmwidth = $tfmmap{$char}; + return undef if !defined $tfmwidth; # Match is impossible. + $doc_dot_tfm += $docwidth * $tfmwidth; + $tfm_dot_tfm += $tfmwidth**2; + } + return 1.0 if $tfm_dot_tfm == 0.0; # Handle TFM characters that all have zero width. + my $optscale = $doc_dot_tfm / $tfm_dot_tfm; + unless ($any_scale) { + # Allow only values >= 1.0 and only multiples of 0.1. + return 1.0 if $optscale < 1.0; + $optscale = int($optscale*10 + 0.5) / 10; + } + return $optscale; +} + + +# Compare two character maps and return their mismatch (smaller is +# better). The third, optional, argument is a scale factor for the +# TFM file. +sub compare_maps ($$;$) +{ + my %docmap = %{$_[0]}; # Map for a document font + my %tfmmap = %{$_[1]}; # Map for a TFM font + my $scale = $_[2] || 1.0; # Scale for each TFM width + my $sqdiff = 0; # Sum of squares of differences + + while (my ($char, $docwidth) = each %docmap) { + my $tfmwidth = $tfmmap{$char}; + return 10**9 if !defined $tfmwidth; # Match is impossible. + $sqdiff += ($docwidth - $tfmwidth*$scale) ** 2; + } + return $sqdiff; +} + + +# Given a Type 3 font definition, surround it with DVIPSBitmapFont comments. +sub write_comments ($$) +{ + my ($fontname, $fontdef) = @_; + return $fontdef if !defined $fontmatch{$fontname}; # Font should not be substituted + my $tfm = $fontmatch{$fontname}->{"tfm"}; + my $scale = $fontmatch{$fontname}->{"scale"}; + my $origsize = $tfm2size{$tfm}; + my $begincomment = sprintf '%%DVIPSBitmapFont: %s %s %.5g %d', + $fontname, $tfm, $origsize*$scale, 1+$#{$name2chars{$fontname}}; + my $endcomment = '%EndDVIPSBitmapFont'; + return "\n" . $begincomment . "\n" . $fontdef . "\n" . $endcomment . "\n"; +} + + +# Escape an array of characters for PostScript's benefit. +sub psify (@) +{ + my @ps_chars; + foreach my $onechar (@_) { + my $charnum = ord $onechar; + if ($onechar =~ /[\\()]/) { + push @ps_chars, "\\" . $onechar; + } + elsif ($charnum >= 32 && $charnum <= 126) { + push @ps_chars, $onechar; + } + else { + push @ps_chars, sprintf "\\%03o", $charnum; + } + } + return @ps_chars; +} + + +# Escape an array of characters for TeX's benefit. +sub texify (@) +{ + my @texchars; + foreach my $onechar (@_) { + if ($onechar =~ m|[\000-\037\\{}\177-\377]|) { + push @texchars, sprintf '\char"%02X{}', ord $onechar; + } + else { + push @texchars, $onechar; + } + } + return join "", @texchars; +} + + +# Parse a font specification into a list of hashes of information. +sub parse_font_spec ($) +{ + my $spec = $_[0]; + my $parse_error = "${progname}: Unable to parse font specification \"$spec\"\n"; + + if ($spec =~ /^\s*([-\w\*]+)(.*)$/o) { + my $tfm = $1; # Name of tfm file (e.g., "cmr10") + my $scale_info = $2; # Concatenation of scale type and scale factor + my $scale_type; # "X"=multiply, "@"=assign + my $scale_amount; # How much to scale the TFM file, "*"=automatic + + # Parse the different scale types. + if ($scale_info =~ /^\s*$/o) { + # Empty + $scale_type = 'X'; + $scale_amount = 1.0; + } + elsif ($scale_info =~ /^\s*\@\s*([\d.]+)\s*X\s*$/io) { + # "@ <number> X" + $scale_type = 'X'; + $scale_amount = $1 + 0.0; + } + elsif ($scale_info =~ /^\s*\@\s*([\d.]+)\s*(pt|bp)\s*$/io) { + # "@ <number> pt" or "@ <number> bp" + $scale_type = '@'; + $scale_amount = $1; + $scale_amount *= 72.0/72.27 if $2 eq "bp"; # Convert to TeX points + } + elsif ($scale_info =~ /^\s*\@\s*\*\s*$/o) { + # "@ *" + $scale_type = 'X'; + $scale_amount = "*" + } + else { + die $parse_error; + } + + # If the tfm file contains a "*", replace the "*" with a + # variety of font sizes. + my @fontlist; + if ($tfm =~ /\*/) { + foreach my $fsize (5..17) { + my $full_tfm = $tfm; + $full_tfm =~ s/\*/$fsize/g; + push @fontlist, {"tfm" => $full_tfm, + "scale_type" => $scale_type, + "scale" => $scale_amount}; + } + } + else { + push @fontlist, {"tfm" => $tfm, + "scale_type" => $scale_type, + "scale" => $scale_amount}; + } + return \@fontlist; + } + die $parse_error; +} + + +# Return all of the unique items in a given list. +sub unique_items (@) +{ + my %item_hash; + foreach my $item (@_) { + $item_hash{$item} = 1; + } + return keys %item_hash; +} + +########################################################################### + +# Parse the command line. +Getopt::Long::Configure ("bundling"); +GetOptions ("h|help" => \$wanthelp, + "v|verbose+" => \$verbose, + "V|version" => \$wantversion, + "q|quiet" => sub {$verbose = 0}, + "f|force=s" => \@forced_fonts, + "i|include=s" => \@extra_tfms, + "x|exclude=s" => \@exclude_res, + "k|keep=s" => sub {$retained_t3s{$_[1]} = 1}, + "t|tex=s" => \$sample_file_tex, + "p|ps=s" => \$sample_file_ps, + "s|spp=i" => \$samples_per_page, + "C|cache=s" => \$tfm_cache_file, + "a|any-scale!" => \$any_scale, + "1|no-repeats" => \$single_font_use) || pod2usage(2); +if ($wantversion) { + print "pkfix-helper $VERSION\n"; + exit 0; +} +if ($wanthelp) { + pod2usage (-verbose => $verbose, + -exitval => "NOEXIT"); + print "Report bugs to scott+pkfh\@pakin.org.\n" if $verbose == 1; + exit 0; +} +my $infilename = $#ARGV>=0 ? $ARGV[0] : "-"; +my $outfilename = $#ARGV>=1 ? $ARGV[1] : "-"; +die "${progname}: Samples per page must be at least 1 ($samples_per_page was specified)\n" if $samples_per_page < 1; + +# Convert any user-specified TFMs to the appropriate internal format. +foreach my $tfm (@extra_tfms) { + my $font_spec = parse_font_spec $tfm; + push @tfmlist, @$font_spec; +} + +# Parse the list of forced font mappings. +foreach my $mapstr (@forced_fonts) { + $mapstr =~ /^(\w+)\s*=\s*(.*)$/ || die "${progname}: Unable to parse font specification \"$mapstr\"\n"; + my $parsed_font_spec = parse_font_spec $2; + if (defined $fontmatch{$1}) { + # Append to an existing font match. + $fontmatch{$1} = [@{$fontmatch{$1}}, @$parsed_font_spec]; + } + else { + # Define a new font match, + $fontmatch{$1} = $parsed_font_spec; + } +} + +# Construct a list of (possibly nonexistent) TFM files to try. These +# should be in order of decreasing likelihood. Each entry in the list +# is of the form {full name, scale factor}. +@exclude_res = ('^\s*$') if $#exclude_res == -1; +foreach my $size_scale ([10, 1.0], + [12, 1.0], + [10, 1.1], + [17, 1.0], + [ 9, 1.0], + [ 8, 1.0], + [ 7, 1.0], + [ 6, 1.0], + [ 5, 1.0], + [10, 1.2], + # The following are common cmbx12 section headings. + [12, 14.40/12], + [12, 17.28/12], + [12, 20.74/12], + [12, 24.88/12]) { + my ($pointsize, $scale) = @$size_scale; + FONTLOOP: + foreach my $basefont (qw (cmr cmb cmtt cmbsy cmbx cmbxsl cmbxti + cmcsc cmex cmitt cmmi cmmib cmsl cmsltt + cmss cmssbx cmssi cmsy cmti lasy lasyb + msam msbm cmssdc cmtcsc)) { + my $friendly_name = sprintf "%s%d \@ %.5gX", $basefont, $pointsize, $scale; + foreach my $regexp (@exclude_res) { + next FONTLOOP if $friendly_name =~ $regexp; + } + push @tfmlist, {"tfm" => $basefont . $pointsize, + "scale_type" => "X", + "scale" => $scale}; + } +} + +# Read the entire input file. +$| = 1; +if ($verbose) { + printf STDERR "Reading %s ... ", $infilename eq "-" ? "standard input" : $infilename; +} +my $entirefile; +{ + local $/ = undef; + open (INFILE, "<$infilename") || die "open(\"$infilename\"): $!\n"; + binmode INFILE; + $entirefile = <INFILE>; + close INFILE; +} +print STDERR "done.\n" if $verbose; + +# Rename the fonts in each subdocument (figure). +my @fontrenames; +my $fignum = 1; +my $numrenamed = 0; +while ($entirefile =~ /(\%\%BeginDocument: (.*?)\n.*?\%\%EndDocument)/gs) { + my $figure = $1; + my $newfigure = $1; + my $figname = $2; + if ($verbose >= 2) { + if ($fignum == 1) { + print STDERR "Renaming all fonts encountered in included documents:\n"; + } + print STDERR " $figname\n"; + } + while ($figure =~ m|/(\S+)\s+\d+\s+\d+\s+df(.*?>[^<>]*?[DI])\s+E|gs) { + my $fontname = $1; # Name of current font (e.g., "Fa") + $newfigure =~ s,(?<=/)$fontname\b,${fontname}_$fignum,gs; + $newfigure =~ s,\b$fontname(?=\(),${fontname}_$fignum,gs; + $numrenamed++; + if ($verbose >= 2) { + printf STDERR " %s --> %s_%d\n", $fontname, $fontname, $fignum; + } + } + if ($figure ne $newfigure) { + # Remove the font-defining dictionary from the the subdocument + # as it may confuse pkfix. Store it so we can later reinsert + # it into the main document's font-defining dictionary. + my $texdict = ""; + if ($newfigure =~ s/TeXDict begin \d+ \d+ \d+ \d+ \d+ \(.*?\)\s+\@start(.*?)end//gs) { + $texdict = $1; + } + else { + warn "${progname}: Failed to extract a font-defining TeXDict from $figname\n"; + } + push @fontrenames, [$figure, $newfigure, $texdict]; + } + $fignum++; +} +if ($verbose && $entirefile =~ /\%\%BeginDocument:/s) { + print STDERR "Number of Type 3 fonts encountered in included documents: $numrenamed\n"; +} +foreach my $ren (@fontrenames) { + my ($before, $after, $notused) = @$ren; + $entirefile =~ s/\Q$before\E/$after/gs; +} + +# If the document contains a subdocument with (now renamed) font +# definitions, hoist those definitions adjacent to the main document's +# font definitions so pkfix can find them. +if (@fontrenames) { + if ($entirefile =~ /(TeXDict begin (\d+) (\d+) (\d+) (\d+) (\d+) \(.*?\)\s+\@start.*?)(?=end)/s) { + my $fontdict = $1; + my $morefonts = ""; + foreach my $ren (@fontrenames) { + $morefonts .= $ren->[2]; + } + $entirefile =~ s/(\Q$fontdict\E)/$1$morefonts/s; + } + else { + warn "${progname}: Failed to find a font-defining TeXDict\n"; + } +} + +# Construct a mapping from each document font name to a list of valid +# characters in that font. +while ($entirefile =~ m|/(\S+)\s+\d+\s+\d+\s+df(.*?>[^<>]*?[DI])\s+E|gs) { + my $fontname = $1; # Name of current font (e.g., "Fa") + my $fontbody = $2; # List of character definitions as hexadecimal strings + my $charnum = 0; # Current character number + my @charlist = (); # List of valid characters in PostScript-friendly format + + while ($fontbody =~ /<[0-9A-F\s]+>(.*?[DI])/gs) { + # Put the current character number in $charnum then append the + # corresponding character to @charlist. + my @chardef = split " ", $1; + if ($chardef[$#chardef] eq "I") { + $charnum++; + } + else { + $charnum = $chardef[$#chardef-1]; + } + push @charlist, chr $charnum; + } + $name2chars{$fontname} = \@charlist; +} +my @sortedfontnames = sort {$#{$name2chars{$b}} <=> $#{$name2chars{$a}} + || $a cmp $b} keys %name2chars; +if ($verbose) { + printf STDERR "Total number of Type 3 fonts encountered: %d\n", 1+$#sortedfontnames; + if ($verbose >= 2) { + foreach my $fontname (@sortedfontnames) { + printf STDERR " %-5.5s -- %3d character(s)\n", $fontname, 1+$#{$name2chars{$fontname}}; + } + } +} +die "${progname}: No Type 3 fonts were encountered in the input file\n" if $#sortedfontnames==-1; + +# Determine the number of dots per inch used to generate the bitmaps. +if ($entirefile =~ /dpi=(\d+)/i + || $entirefile =~ /Resolution (\d+)dpi/i) { + $dpi = $1 + 0; + printf STDERR "Bitmapped fonts are typeset at $dpi DPI.\n" if $verbose; +} +else { + warn "${progname}: Could not determine the target printer resolution; assuming $dpi DPI\n"; +} + +# Insert some helper code after the tex.pro ProcSet. +my $output_width_ps = $entirefile; # PostScript code to output character widths +my $showfontnamecode = <<"SHOWFONTNAME"; +\%\%BeginProcSet: $progname.pro +TeXDict begin + +% char0 char1 PRINT-WIDTH - +% +% Output the name of the current font (font-name-string), its character +% number (char0), and the character's width in PostScript points. + +/print-width { + pop + (FONT: ) print font-name-string print + ( CHAR: ) print 8 string cvs print + ( XPOS: ) print currentpoint pop 80 string cvs print + (\\n) print +} bind def + +% font-name sample-string PRINT-CHAR-WIDTHS - +% +% Store the name of font-name in the string font-name-string. Then, select +% font-name and, for each character of test-string, call print-width +% to output its width. + +/print-char-widths { + /sample-string exch def + /font-name exch def + font-name 8 string cvs /font-name-string exch def + font-name cvx exec {print-width} sample-string kshow +} bind def + +end +\%\%EndProcSet +SHOWFONTNAME + ;#' +if ($output_width_ps !~ s/\%\%BeginProcSet: tex\w*\.pro.*?\%\%EndProcSet/$&\n$showfontnamecode/s) { + print STDERR "No tex.pro ProcSet was found. We have to guess where to inject PostScript code.\n" if $verbose >= 3; + die "${progname}: Unable to inject prologue code\n" if $output_width_ps !~ s/TeXDict begin\s+\d+\s+\d+\s+bop/\n$showfontnamecode\n$&/s; +} + +# Define some code to display the width of every valid character in +# every bitmapped font. Fonts are displayed in decreasing order of +# the number of characters used. +my $displaycode = "\%\%Page: 1 1\nTeXDict begin\n1 0 bop\n"; +foreach my $fontnum (0 .. $#sortedfontnames) { + # Duplicate the last character of the sample string so kshow can + # process the final character delta. + my $fontname = $sortedfontnames[$fontnum]; + my @charlist = psify @{$name2chars{$fontname}}; + my $samplestring = join("", @charlist) . $charlist[$#charlist]; + + # Typeset the string starting at horizontal offset 0. + $displaycode .= sprintf "0 0 moveto\n"; + $displaycode .= "/$fontname ($samplestring) print-char-widths\n"; +} + +# Dvips scales the page. Determine the scaling it uses. +$displaycode .= <<'ENDDISPLAYCODE'; +(CURRENTMATRIX: ) print +matrix currentmatrix == +(\n) print +eop +end +ENDDISPLAYCODE + ; + +# Replace the bulk of the PostScript file with the display code. +if ($output_width_ps !~ s/\%\%Page:.*(\%\%Trailer)/$displaycode$1/s) { + print STDERR 'No %%Page and/or %%Trailer comments were found. We have to guess where to inject PostScript code.', "\n" if $verbose >= 3; + die "${progname}: Unable to inject display code\n" if $output_width_ps !~ s/TeXDict begin\s+\d+\s+\d+\s+bop.*eop\s+end/\n$displaycode\n/s; +} + +# Output the modified PostScript code to a temporary file, run +# Ghostscript on the temporary file, and process Ghostscript's output. +my ($psfile, $psfilename) = tempfile ("pkfix-helper-XXXXXX", + DIR => File::Spec->tmpdir(), + SUFFIX => ".ps"); +binmode $psfile; +print $psfile $output_width_ps; +close $psfile; +undef $output_width_ps; +my %fontwidth; # Map from font name to character number to character width +my @previnfo = ("", 0.0); # Previous font name and final character position +my $gscmd = "$GS -q -dNOPAUSE -dBATCH -dNODISPLAY $psfilename"; +print STDERR "Finding character widths ... " if $verbose >= 1; +print STDERR "\n Invoking: $gscmd\n" if $verbose >= 2; +print STDERR "done.\n" if $verbose >= 1; +open (GSCMD, "$gscmd|") || die "${progname}: failed to fork ($!)\n"; +while (my $oneline = <GSCMD>) { + if ($oneline =~ /FONT: (\S+)\s*CHAR: (\d+)\s*XPOS: (\S+)/o) { + my ($fontname, $charnum, $xpos) = ($1, $2, $3); + my $width = $xpos + 0.0; + $width -= $previnfo[1] if $fontname eq $previnfo[0]; + $fontwidth{$fontname}->{$charnum} = $width * 72.27 / $dpi; + @previnfo = ($fontname, $xpos); + } + elsif ($oneline =~ /CURRENTMATRIX: \[\s*([-\d.]+)\s+[-\d.]+\s+[-\d.]+\s+([-\d.]+)\s+[-\d.]+\s+[-\d.]+\s*\]/o) { + $dvips_xscale = $1 * 1.0; + $dvips_yscale = $2 * -1.0; + } +} +close GSCMD || die "${progname}: failed to run $GS ($!)\n"; +unlink $psfilename; +die "${progname}: No character-width information was found\n" if !%fontwidth; + +# Read TFM font metrics from a cache file if specified. +read_tfm_cache_file() if defined $tfm_cache_file; + +# Read each TFM file and store its design size and character widths. +print STDERR "Reading TFM files ... " if $verbose; +print STDERR "\n" if $verbose >= 2; +foreach my $tfm (sort {$a cmp $b} + unique_items map {$_->{"tfm"}} (@tfmlist, map {@$_} values %fontmatch)) { + my ($designsize, %num2widths) = @{tfm2widths $tfm}; + if (%num2widths) { + $tfmfontwidth{$tfm} = \%num2widths; + $tfm2size{$tfm} = $designsize * 1.0; + } + else { + $tfmmissing{$tfm} = 1; + } +} + +# Remove nonexistent fonts from @tfmlist and replace all absolute +# ("@") scaling with relative ("X") scaling. +my @goodtfmlist; +foreach my $tfminfo (@tfmlist) { + my $tfm = $tfminfo->{"tfm"}; + next if !defined ($tfmfontwidth{$tfm}); + $tfminfo->{"designsize"} = $tfm2size{$tfm}; + if ($tfminfo->{"scale_type"} eq "@") { + # Convert absolute to relative sizes. + $tfminfo->{"scale_type"} = "X"; + $tfminfo->{"scale"} /= $tfminfo->{"designsize"}; + } + push @goodtfmlist, $tfminfo; +} +@tfmlist = @goodtfmlist; +undef @goodtfmlist; + +# Do the same for all user-specified font mappings but abort if none +# of the specified possibilities represent a valid TFM file. +while (my ($fontname, $tfmlist) = each %fontmatch) { + my $anyvalid = 0; + foreach my $tfminfo (@$tfmlist) { + my $tfm = $tfminfo->{"tfm"}; + next if !defined ($tfmfontwidth{$tfm}); + $tfminfo->{"designsize"} = $tfm2size{$tfm}; + if ($tfminfo->{"scale_type"} eq "@") { + # Convert absolute to relative sizes. + $tfminfo->{"scale_type"} = "X"; + $tfminfo->{"scale"} /= $tfminfo->{"designsize"}; + } + $anyvalid = 1; + } + if (!$anyvalid) { + print STDERR "failed.\n" if $verbose; + die "${progname}: Unable to utilize any of the TFM files specified for font $fontname\n"; + } +} + +# Report the number of fonts in our repertoire. +my $numtfms = keys %tfm2size; +my $numfonts = 1 + $#tfmlist; +print STDERR "done ($numtfms TFMs in $numfonts scaling variations).\n" if $verbose; +die "${progname}: No TFM files were processed successfully\n" if !$numtfms; + +# Write the TFM font metrics to a a cache file if specified. +write_tfm_cache_file() if defined $tfm_cache_file; + +# Compare every document font (ordered by decreasing number of +# characters utilized) to every TFM file (in increasing order of +# obscurity). +print STDERR "Matching fonts:\n" if $verbose; +foreach my $fontname (@sortedfontnames) { + my @besttfms; # Best matching TFM file(s), sizes, and scales + my $bestmatch = 10**9; # Best matching value + + # Don't substitute the font if we were told not to. + if (defined $retained_t3s{$fontname}) { + print STDERR " Retaining $fontname as a bitmapped font.\n" if $verbose == 1; + next; + } + + # Determine the list of eligible fonts to compare against. + my @eligible_tfms; + foreach my $tfminfo ($fontmatch{$fontname} ? @{$fontmatch{$fontname}} : @tfmlist) { + if ($tfminfo->{"scale"} eq "*") { + # Replace "*" with the best scaling factor we can find. + next if !defined $tfmfontwidth{$tfminfo->{"tfm"}}; + my $newscale = optimal_scale $fontwidth{$fontname}, $tfmfontwidth{$tfminfo->{"tfm"}}; + if (defined $newscale) { + # Replace the "*" with the optimal multiplier. + my %newtfminfo = %$tfminfo; + $newtfminfo{"scale"} = $newscale; + push @eligible_tfms, \%newtfminfo; + } + else { + # Fonts are incomparable. + my $tfm = $tfminfo->{"tfm"}; + print STDERR " Not scaling $tfm; ${fontname}'s character set is not a subset of ${tfm}'s.\n" if $verbose >= 2; + } + } + else { + # The desired scaling factor is specified explicitly. + push @eligible_tfms, $tfminfo; + } + } + die "${progname}: No fonts are eligible to match $fontname\n" if !@eligible_tfms; + + # Try each TFM file in increasing order of obscurity. + print STDERR " Processing $fontname ... " if $verbose == 1; + foreach my $tfminfo (@eligible_tfms) { + my $tfm = $tfminfo->{"tfm"}; + next if !defined $tfmfontwidth{$tfm}; + my $scale = $tfminfo->{"scale"}; + printf STDERR " Comparing %s and %s \@ %.5gX ... ", $fontname, $tfm, $scale if $verbose >= 2; + my $match = compare_maps $fontwidth{$fontname}, $tfmfontwidth{$tfm}, $scale; + if ($bestmatch > $match) { + # We found a closer match than what we had before. + $bestmatch = $match; + @besttfms = ($tfminfo); + } + elsif ($bestmatch == $match) { + # We found an equal match to what we had before. + push @besttfms, $tfminfo; + } + printf STDERR "done (mismatch=%.5f).\n", $match if $verbose >= 2; + } + + # Select the first of the best matches. + $fontmatch{$fontname} = $besttfms[0]; + my $besttfminfo = $fontmatch{$fontname}; + my $besttfm = $besttfminfo->{"tfm"}; + my $bestscale = $besttfminfo->{"scale"}; + if ($verbose >= 2) { + if ($#besttfms == 0) { + # Single winner + printf STDERR " Best match for %s is %s \@ %.5gX with mismatch=%.5f.\n\n", + $fontname, $besttfm, $bestscale, $bestmatch; + } + else { + # Tie for first place + printf STDERR " Best match for %s is %s \@ %.5gX (tied among %s) with mismatch=%.5f.\n\n", + $fontname, $besttfm, $bestscale, + join("/", map {sprintf "%s\@%.5gX", $_->{"tfm"}, $_->{"scale"}} @besttfms), + $bestmatch; + } + } + elsif ($verbose == 1) { + printf STDERR "done (%s \@ %.5gX, mismatch=%.5f).\n", $besttfm, $bestscale, $bestmatch; + } + warn "${progname}: Best match for $fontname is rather poor\n" if $bestmatch>=1.0; + + # Optionally remove the font from @goodtfmlist. + if ($single_font_use) { + @tfmlist = grep {$_->{"tfm"} ne $besttfm + || $_->{"scale"} != $bestscale} @tfmlist; + } +} + +# Insert %DVIPSBitmapFont comments around every Type 3 font definition. +my $commented_ps = $entirefile; +my $infilename_ps = $infilename; # PostScript version of $infilename +$infilename_ps =~ s/([\(\)\\])/\\$1/g; +$commented_ps =~ s|^\%(End)?DVIPSBitmapFont.*$||gm; # Remove existing comments (if any) +$commented_ps =~ s|/(\S+)\s+\d+\s+\d+\s+df.*?>[^<]*?[DI]\s+E|write_comments($1, $&)|gse; +if ($commented_ps !~ /\%\%EndProlog/) { + # pkfix fails silently if it doesn't see an %%EndProlog. + print STDERR "No %%EndProlog comment was found. Adding one.\n" if $verbose >= 3; + $commented_ps =~ s|TeXDict begin\s+\d+\s+\d+\s+bop|\%\%EndProlog\n$&|s; +} + +# Help pkfix handle ancient versions of dvips by artificially making +# dvips look newer. +$commented_ps =~ s|(\%\%Creator: dvips\S*) \S+|$1 5.62|; # pkfix rejects dvips <= 5.58 +if ($commented_ps =~ s|(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+\@start|$1 $2 $3 $4 $5 ($infilename_ps) \@start|gx) { + # pkfix expects *six* arguments to @start, not five as in old + # versions of dvips. + $commented_ps =~ s|/\@start\s*\{|$& pop |; +} +if ($commented_ps !~ /^%DVIPSParameters:.*dpi=([\dx]+)/) { + # Tell pkfix what resolution to use. + my $dvips_params = "\%DVIPSParameters: dpi=$dpi"; + if ($commented_ps !~ s|^\%\%EndComments.*$|$&\n$dvips_params|m) { + # Comments must have been stripped. + $commented_ps =~ s|\n|\n$dvips_params\n|; + } +} + +# Write the modified PostScript code to the specified file. +open (OUTFILE, ">$outfilename") || die "${progname}: Unable to open $outfilename ($!)\n"; +print OUTFILE $commented_ps; +close OUTFILE; +undef $commented_ps; + +# If the user requested a PostScript font sample, produce that. +if (defined $sample_file_ps) { + # Insert some helper code at an appropriate place in the file. + my $sample_ps = $entirefile; + my $showfontnamecode = <<"SHOWFONTNAME"; +\%\%BeginProcSet: $progname.pro +TeXDict begin + +% font-name sample-string PRINT-FONT-SAMPLE - +% +% Store the name of font-name in the string font-name-string. Then, +% output font-name-string in Times Bold in case the user wants to view +% the font samples. Next, select font-name and output the sample +% string. Finally, move the cursor to the next line in preparation for +% the next invocation of print-font-sample. +/print-font-sample { + /sample-string exch def + /font-name exch def + font-name 8 string cvs /font-name-string exch def + gsave + /Times-Bold 12 selectfont + font-name-string show (:) show + grestore + gsave + 42 0 rmoveto + font-name cvx exec + currentfont bitmap-font-transform makefont setfont + sample-string show + grestore + 0 -24 rmoveto +} def + +\% Define a transformation matrix for dvips bitmapped fonts. We _could_ +\% do this dynamically but there seems to be a bug in GhostView (v3.6.1) +\% or GhostScript (ESP v7.07.1) that causes the page layout to change +\% with rescaling. To avoid problems we simply hardwire the scaling +\% factor. +/bitmap-font-transform [$dvips_xscale 0.0 0.0 $dvips_yscale 0 0] def + +end +\%\%EndProcSet +SHOWFONTNAME + ; + if ($sample_ps !~ s/\%\%BeginProcSet: tex\w*\.pro.*\%\%EndProcSet/$&\n$showfontnamecode/s) { + print STDERR "No tex.pro ProcSet was found. We have to guess where to inject PostScript code.\n" if $verbose >= 3; + die "${progname}: Unable to inject prologue code\n" if $sample_ps !~ s/TeXDict begin\s+\d+\s+\d+\s+bop/\n$showfontnamecode\n$&/s; + } + + # Generate code to output a sample of each font in turn. + my $displaycode = <<"PAGEHEADER"; +\%\%Page: 1 1 +TeXDict begin +1 0 bop + +\% Display a page title. +0 0 moveto +initmatrix +gsave + /Helvetica 18 selectfont + (Fonts used by $infilename_ps) show +grestore +0 -$init_yinc rmoveto + +\% Display samples of each document font in decreasing order of the number +\% of characters utilized from the font. +PAGEHEADER +; + my $pageno = 1; + foreach my $fontnum (0 .. $#sortedfontnames) { + my $fontname = $sortedfontnames[$fontnum]; + my $samplestring = join("", psify @{$name2chars{$fontname}}); + $displaycode .= "/$fontname ($samplestring) print-font-sample\n"; + if ($fontnum % $samples_per_page == $samples_per_page-1 + && $fontnum != $#sortedfontnames) { + # Insert a page break after every $samples_per_page font samples. + $pageno++; + $displaycode .= <<"PAGETRANSITION"; +eop +end +\%\%Page: $pageno $pageno +TeXDict begin +$pageno @{[$pageno-1]} bop +0 0 moveto +initmatrix +PAGETRANSITION +; + } + } + $displaycode .= "eop\nend\n"; + if ($sample_ps !~ s/\%\%Page:.*(\%\%Trailer)/$displaycode$1/s) { + print STDERR 'No %%Page and/or %%Trailer comments were found. We have to guess where to inject PostScript code.', "\n" if $verbose >= 3; + die "${progname}: Unable to inject display code\n" if $sample_ps !~ s/TeXDict begin\s+\d+\s+\d+\s+bop.*eop\s+end/\n$displaycode\n/s; + } + + # Write the PostScript file. + open (SAMPLE_PS, ">$sample_file_ps") || die "${progname}: Unable to open $sample_file_ps ($!)\n"; + binmode SAMPLE_PS; + print SAMPLE_PS $sample_ps; + close SAMPLE_PS; + undef $sample_ps; +} + +# If the user requested a TeX font sample, produce that. +if (defined $sample_file_tex) { + my $oneline; # One line to write to the TeX file. + + open (SAMPLE_TEX, ">$sample_file_tex") || die "${progname}: Unable to open $sample_file_tex ($!)\n"; + select (SAMPLE_TEX); + $| = 1; + select (STDOUT); + format SAMPLE_TEX = +% ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~ +$oneline +. + $oneline = <<"TEX_HEADER"; +This file was generated by $0. DO NOT EDIT. Edit $progname instead. +Note that this is a Plain TeX document. Compile it with tex, *not* +latex. +TEX_HEADER + ; + write SAMPLE_TEX; + print SAMPLE_TEX <<'TEX_BOILERPLATE'; + +% Make printable all special characters between +% \makeprintable...\endmakeprintable except for "\", "{", and "}". +\def\makeprintable{% + \begingroup + \def\do##1{\catcode`##1=12}% + \dospecials + \catcode`\\=0\relax + \catcode`\{=1\relax + \catcode`\}=2\relax +} +\let\endmakeprintable=\endgroup + +% Put a piece of text at specific PostScript coordinates. +\newdimen\xofs +\newdimen\yofs +\def\put(#1,#2)#{% + \leavevmode + \begingroup + \makeprintable + \xofs=#1bp + \yofs=#2bp + \afterassignment\puthelper + \toks0=% +} +\def\puthelper{% + \lower\yofs + \rlap{\hskip\xofs\the\toks0}% + \endmakeprintable + \endgroup +} + +% We use Times Bold at 12 point for font names. +\font\timesbXII=ptmb at 12bp + +% Don't add extra space to paragraphs. +\parindent=0pt +\parskip=0pt + +% Output the document's title. +\font\somefont=phvr at 18bp +TEX_BOILERPLATE + ; + # Output the document's title. + my $infilename_tex = texify split "", $infilename; + print SAMPLE_TEX '\put(0, 0){\somefont New fonts to use for ', "$infilename_tex}\n"; + + # Output samples of each font in turn. + print SAMPLE_TEX "\n\% Output font samples.\n"; + my $firstfontnum = 0; + foreach my $fontnum (0 .. $#sortedfontnames) { + # Output a single font sample. + my $fontname = $sortedfontnames[$fontnum]; + my $samplestring = texify @{$name2chars{$fontname}}; + my $yoffset = ($fontnum-$firstfontnum)*$yinc + $init_yinc; + printf SAMPLE_TEX "\\put(0, %d){\\timesbXII %s:}%%\n", $yoffset, $fontname; + my $tfm = $fontmatch{$fontname}->{"tfm"}; + my $scale = $fontmatch{$fontname}->{"scale"}; + my $size = $tfm2size{$tfm}; + printf SAMPLE_TEX "\\font\\somefont=%s%s\\somefont\n", + $tfm, $scale==1.0 ? "" : sprintf(" at %.5gbp", $scale*$size); + printf SAMPLE_TEX "\\put(%d, %d){%s}%%\n", $xinc, $yoffset, $samplestring; + + if ($fontnum % $samples_per_page == $samples_per_page-1) { + # Insert a page break after every $samples_per_page font samples. + print SAMPLE_TEX "\\vskip 0pt plus 1fill\\eject\n"; + $firstfontnum = $fontnum; + } + } + + # Complete the TeX file. + print SAMPLE_TEX "\n\\bye\n"; + close SAMPLE_TEX; +} + +########################################################################### + +__END__ + +=head1 NAME + +pkfix-helper - preprocess dvips-produced PostScript documents before passing them to pkfix + + +=head1 SYNOPSIS + +pkfix-helper +[B<--help>] +[B<--verbose>] +[B<--force>=I<name>=I<fontspec>] +[B<--ps>=I<filename.ps>] +[B<--tex>=I<filename.tex>] +[B<--cache>=I<filename>] +[B<--include>=I<fontspec>] +[B<--exclude>=I<regexp>] +[B<--keep>=I<fontspec>] +[B<--quiet>] +[B<--no-repeats>] +[B<--spp>=I<number>] +[I<input.ps> [I<output.ps>]] + + +=head1 DESCRIPTION + +=head2 Motivation + +PostScript documents created with old versions of B<dvips> almost +invariably utilize bitmapped (PostScript S<Type 3>) fonts. The +problem with bitmapped fonts is that they target a specific device +resolution; a PostScript file produced using S<300 DPI> fonts will +look grainy on a S<600 DPI> printer. Even worse, I<all> bitmapped +fonts look grainy when zoomed in on screen. The solution is to use +vector (PostScript S<Type 1>) fonts, which are resolution-independent +and appear crisp at any size or scale. + +While it is no longer difficult to configure B<dvips> to use vector +fonts, it is not always possible to rerun B<dvips> on an old F<.dvi> +file. The F<.dvi> file and document source may have been lost; or, +the source may no longer compile because packages it depends upon may +no longer be available. + +Heiko Oberdiek's B<pkfix> script replaces bitmapped fonts in +B<dvips>-produced PostScript files with the corresponding vector +fonts. It works by parsing the PostScript comments with which +B<dvips> surrounds bitmapped-font definitions. For example, a font +definition beginning with the comment C<%DVIPSBitmapFont: Fi cmss10 11 +28> and ending with a matching C<%EndDVIPSBitmapFont> is known to +define font C<Fi> as C<cmss10> (Computer Modern Sans Serif at a design +size of S<10 points>) scaled to S<C<11> points>. Only the C<28> +characters actually used by the document are defined. B<pkfix> then +replaces the font definition with one that defines C<Fi> using the +same set of characters but taken from the F<cmss10.pfb> vector font +file. + +Unfortunately, B<pkfix> works only with versions of B<dvips> newer +than v5.58 S<(ca. 1996)>. Naturally, the older a PostScript document, +the less likely its sources still exist and can still be recompiled. +Older versions of B<dvips> lack C<%DVIPSBitmapFont> comments and +various other PostScript comments on which B<pkfix> relies. Without +PostScript comments to guide it, B<pkfix> is unable to determine which +vector fonts correspond with which bitmapped fonts. + +=head2 Overview + +The B<pkfix-helper> script is a preprocessor for B<pkfix> that +attempts to determine the association between each document-font name +S<(e.g., C<Fi>)> in a PostScript file and the original font S<(e.g., +C<cmss10>)> and fonts size (e.g., S<C<11> points>). It then +fabricates the PostScript comments that B<pkfix> expects to see so +that B<pkfix> can do its job. + +B<pkfix-helper> works by comparing every document font against every +F<.tfm> font file it knows about (assuming that each such font has a +corresponding F<.pfb> vector version) and selecting the best matching +F<.tfm> file for every document font. B<pkfix-helper> has access only +to the widths of characters and only to those characters actually used +in the document. Also, the program recognizes only a limited set of +the most popular F<.tfm> files and scaling factors. Consequently, the +comparison is imperfect and B<pkfix-helper> may attribute an incorrect +font to a given name. Fonts comprising only one or two characters +actually used in a document are particularly problematic for +B<pkfix-helper> because many fonts may be near-enough matches to fool +the problem. + +B<pkfix-helper> is designed so that a user can guide the +font-selection process by manually designating matching fonts. With a +modicum of diligence and patience a user can correct any mismatched +fonts and help the program provide proper input to B<pkfix>. + + +=head1 OPTIONS + +B<pkfix-helper> accepts on the command line the filename of a +PostScript document to process (with the default being the standard +input device) and the filename of a modified PostScript document to +create (with the default being the standard output device). The +program also accepts the following command-line options: + +=head2 Frequently Used Options + +=over 4 + +=item B<-h>, B<--help> + +Display usage information and exit. The B<--verbose> and B<--quiet> +options can be used to increase and decrease the amount of information +presented. + +=item B<-v>, B<--verbose> + +Increase the amount of status information that B<pkfix-helper> +displays as it runs. Additional instances of B<--verbose> on the +command line further increase the program's verbosity. By default, +only major operations are displayed. A single B<--verbose> +additionally displays information about individual font comparisons. +A second B<--verbose> additionally displays details about some of the +program's internal operations. + +=item B<-f> I<name>=I<fontspec>, B<--force>=I<name>=I<fontspec> + +Force B<pkfix-helper> to associate a specific font with a given font +name appearing the document. I<name> is a two-character B<dvips> font +name such as C<Fa>. I<fontspec> is a font specification such as +C<cmmi8> or S<C<cmsy10 @ 1.1X>>. An asterisk used in the name of the +base font S<(e.g., C<cmti*>)> will automatically try all integral test +font sizes from 5 to 17 points (C<cmti5>, S<C<cmti6>, ...,> +C<cmti17>). An asterisk used as a scale value S<(e.g., C<cmsy10 @ +*>)> will be replaced by the scale value that gives the best match to +the original font's metrics. The B<--force> option can be specified +repeatedly on the command line. + +=item B<-p> I<filename.ps>, B<--ps>=I<filename.ps> + +Create a PostScript file called I<filename.ps> that shows the B<dvips> +name and a font sample of every font used by the input document. + +=item B<-t> I<filename.tex>, B<--tex>=I<filename.tex> + +Create a Plain TeX file called I<filename.tex> that shows the B<dvips> +name and a font sample of every font that B<pkfix-helper> used in the +output document. + +=back + +=head2 Infrequently Used Options + +=over 4 + +=item B<-C> I<filename>, B<--cache>=I<filename> + +Speed up TFM file processing by caching character metrics into file +I<filename>. On some systems it takes a long time to read a TFM file, +spawn F<tftopl> to convert it to PL format, and extract from the PL +data the metrics for each character. The first time B<--cache> is +specified, B<pkfix-helper> proceeds as normal then writes all of the +extracted character metrics to I<filename>. On subsequent runs in +which B<--cache>=I<filename> is specified, B<pkfix-helper> reads the +previously extracted metrics from I<filename>, going through the +F<tftopl>-based process only for TFM files that were not previously +encountered. + +=item B<-q>, B<--quiet> + +Instruct B<pkfix-helper> to produce no output during its run except +for fatal error messages. + +=item B<-1>, B<--no-repeats> + +Prevent B<pkfix-helper> from associating the same I<fontspec> with +more than one B<dvips> font name. + +=item B<-i> I<fontspec>, B<--include>=I<fontspec> + +Add I<fontspec> to the list of font specifications against which +B<pkfix-helper> compares I<every> document font. (In contrast, +B<--force> designates a font specification to use only for a +I<specific> document font.) The B<--include> option can be specified +repeatedly on the command line. + +=item B<-x> I<regexp>, B<--exclude>=I<regexp> + +Remove all font specifications matching regular expression I<regexp> +from B<pkfix-helper>'s list of known fonts. The B<--exclude> option +can be specified repeatedly on the command line. + +=item B<-k> I<fontspec>, B<--keep>=I<fontspec> + +Do not substitute a vector font for bitmapped font I<fontspec> (C<Fa>, +C<Fb>, etc.). This is useful when converting documents that use +obscure bitmapped fonts for which there is no vector equivalent. For +example, it was somewhat common in the past to include graphics such +as university or corporate logos into a document by converting the +bitmapped image into a single-character font and using that font in +LaTeX. B<--keep> prevents such fonts from being replaced. The +B<--keep> option can be specified repeatedly on the command line. + +=item B<-a>, B<--any-scale> + +Allow any value to be used to scale a font when "C<*>" is specified as +the scale factor. Normally, B<pkfix-helper> considers only integer +multiples of 0.1 that are greater than or equal to 1.0 (i.e., +I<fontname>C<@1X>, C<@1.1X>, C<@1.2X>, C<@1.3X>, etc.). + +=item B<-s>, B<--spp> + +Specify the number of font samples per page to print to the files +indicated using the B<--ps> and B<--tex> options. The default +S<value, 25,> should work well in most circumstances. + +=back + + +=head1 DIAGNOSTICS + +=over 4 + +=item C<Best match for I<name> is rather poor> + +The best font B<pkfix-helper> found for B<dvips> font name I<name> has +a mismatch value greater than or equal S<to 1.0>. (The mismatch value +is the sum of the squares of the difference between the character +widths of a document font and a potential replacement font.) Use the +B<--force> option to designate an alternative replacement font or +scaling amount. + +=back + + +=head1 EXAMPLES + +For the purpose of the following examples, assume that F<oldfile.ps> +is the name of a PostScript file produced by an old version of +B<dvips> and utilizing at least one bitmapped font. It's always worth +verifying that B<pkfix> can't convert the file on its own: + + $ pkfix oldfile.ps newfile.ps + PKFIX 1.3, 2005/02/25 - Copyright (c) 2001, 2005 by Heiko Oberdiek. + ==> no fonts converted + +(Alternatively B<pkfix> may issue an error message such as C<!!! +Error: Parse error (@start parameters)!>.) Only when B<pkfix> can't +replace bitmapped fonts with vector fonts is B<pkfix-helper> needed. +In its simplest form, B<pkfix-helper> takes the name of an input file +(F<oldfile.ps> in this example) and the name of an output file +(F<pkfix-oldfile.ps>), which will have the same contents as the input +file but serve as suitable input for B<pkfix>: + + $ pkfix-helper oldfile.ps pkfix-oldfile.ps + Reading oldfile.ps ... done. + Number of Type 3 fonts encountered: 10 + Bitmapped fonts are typeset at 600 DPI. + Finding character widths ... done. + Reading TFM files ... done (103 TFMs in 193 scaling variations). + Matching fonts: + Processing Fi ... done (cmr10 @ 1X, mismatch=0.11683). + Processing Fa ... done (cmti10 @ 1X, mismatch=0.08892). + Processing Fb ... done (cmr8 @ 1X, mismatch=0.07133). + Processing Ff ... done (cmbx12 @ 1.2X, mismatch=0.02948). + Processing Fh ... done (cmtt10 @ 1X, mismatch=0.06895). + Processing Fd ... done (cmmi10 @ 1X, mismatch=0.03966). + Processing Fj ... done (cmbx12 @ 1X, mismatch=0.03972). + Processing Fe ... done (cmbx10 @ 1X, mismatch=0.00762). + Processing Fg ... done (cmsy10 @ 1X, mismatch=0.00875). + Processing Fc ... done (cmr6 @ 1X, mismatch=0.00284). + + $ pkfix pkfix-oldfile.ps newfile.ps + PKFIX 1.3, 2005/02/25 - Copyright (c) 2001, 2005 by Heiko Oberdiek. + *** Font conversion: `cmti10' -> `CMTI10'. + *** Font conversion: `cmr8' -> `CMR8'. + *** Font conversion: `cmr6' -> `CMR6'. + *** Font conversion: `cmmi10' -> `CMMI10'. + *** Font conversion: `cmbx10' -> `CMBX10'. + *** Font conversion: `cmbx12' -> `CMBX12'. + *** Font conversion: `cmsy10' -> `CMSY10'. + *** Font conversion: `cmtt10' -> `CMTT10'. + *** Font conversion: `cmr10' -> `CMR10'. + *** Font conversion: `cmbx12' -> `CMBX12'. + *** Merging font `CMBX12' (2). + ==> 10 converted fonts. + ==> 1 merged font. + +Although B<pkfix-helper> tries to automate as much as possible the +font-detection process, some fonts will invariably be incorrectly +identified. The program outputs a warning message if it I<knows> a +match is bad but the lack of a warning message does not necessarily +indicate that B<pkfix-helper> did a good job. It is therefore +strongly recommended that the user produce "before" and "after" font +sheets: + + $ pkfix-helper -q oldfile.ps pkfix-oldfile.ps \ + --ps=oldfonts.ps --tex=newfonts.tex + + $ tex newfonts.tex + This is TeX, Version 3.14159 (Web2C 7.4.5) + (./newfonts.tex [1] ) + Output written on newfonts.dvi (1 page, 1292 bytes). + Transcript written on newfonts.log. + + $ dvips newfonts.dvi -o newfonts.ps + This is dvips(k) 5.92b Copyright 2002 Radical Eye Software (www.radicaleye.com) + ' TeX output 2006.06.11:1636' -> newfonts.ps + <texc.pro><8r.enc><texps.pro>. <cmr6.pfb><cmsy10.pfb><cmbx10.pfb><cmbx12.pfb> + <cmmi10.pfb><cmtt10.pfb><cmr8.pfb><cmti10.pfb><cmr10.pfb>[1] + +After running the preceding commands, F<oldfonts.ps> shows samples of +the fonts in F<oldfile.ps> and F<newfonts.ps> shows samples of the +replacement fonts that B<pkfix-helper> used to produce +F<pkfix-oldfile.ps>. Print F<oldfonts.ps> and F<newfonts.ps> and +compare them carefully for incorrect fonts and sizes. + +Suppose that the choice of C<cmbx12 @ 1.2X> for font C<Ff> looks +wrong; say the characters look taller in F<oldfonts.ps> than in +F<newfonts.ps>. This is where the trial-and-error stage begins. +Let's hypothesize that C<cmb12> is a better match than C<cmbx12> but +we don't know how much to scale the font. Fortunately, +B<pkfix-helper> allows C<*> to be used as a scaling factor to tell the +program to automatically detect an optimal scaling factor, even if +doing so means choosing a nonstandard font size: + + $ pkfix-helper oldfile.ps pkfix-oldfile.ps --force="Ff=cmb12 @ *" + Reading oldfile.ps ... done. + Number of Type 3 fonts encountered: 10 + Bitmapped fonts are typeset at 600 DPI. + Finding character widths ... done. + Reading TFM files ... failed. + pkfix-helper: Unable to process user-specified TFM file "cmb12" + +Oops, it looks like we don't have a F<cmb12.tfm> file on our system. +Let's try scaling up F<cmb10.tfm> instead: + + $ pkfix-helper oldfile.ps pkfix-oldfile.ps --force="Ff=cmb10 @ *" + Reading oldfile.ps ... done. + Number of Type 3 fonts encountered: 10 + Bitmapped fonts are typeset at 600 DPI. + Finding character widths ... done. + Reading TFM files ... done (103 TFMs in 193 scaling variations). + Matching fonts: + Processing Fi ... done (cmr10 @ 1X, mismatch=0.11683). + Processing Fa ... done (cmti10 @ 1X, mismatch=0.08892). + Processing Fb ... done (cmr8 @ 1X, mismatch=0.07133). + Processing Ff ... done (cmb10 @ 1.5X, mismatch=0.00035). + Processing Fh ... done (cmtt10 @ 1X, mismatch=0.06895). + Processing Fd ... done (cmmi10 @ 1X, mismatch=0.03966). + Processing Fj ... done (cmbx12 @ 1X, mismatch=0.03972). + Processing Fe ... done (cmbx10 @ 1X, mismatch=0.00762). + Processing Fg ... done (cmsy10 @ 1X, mismatch=0.00875). + Processing Fc ... done (cmr6 @ 1X, mismatch=0.00284). + +The match has definitely improved, although S<15 pt.> is certainly an +odd size for a font. Then again, many documents I<do> use nonstandard +sizes so this may in fact be correct. The best way to verify is once +again to produce, print, and compare a pair of font samples and +iterate until all of the fonts look correct. Use one instance of +B<--force> for each font you want to alter. + + +=head1 ENVIRONMENT + +B<pkfix-helper> honors the following environment variables: + +=over 8 + +=item GS + +The name of the Ghostscript interpreter (default: F<gs>) + +=item TFTOPL + +The name of a utility for converting F<.tfm> files to F<.pl> files +(default: F<tftopl>) + +=back + + +=head1 BUGS + +Even when B<pkfix-helper> finds a perfect match S<(i.e., the> correct +font in the correct size) the mismatch value is still typically +nonzero. The same error is probably what causes B<pkfix-helper> +sometimes to consider the wrong font as being a better match than the +correct font. Suggestions for fixing these bugs are welcome. + + +=head1 RESTRICTIONS + +B<pkfix-helper> works only with PostScript files produced by B<dvips>, +not with arbitrary PostScript files. The program has not been tested +with output from versions of B<dvips> older than v5.490 S<(ca. 1992)>; +output from older versions may or may not work. Only bitmapped fonts +loaded by B<dvips> can be analyzed, not bitmapped fonts loaded by +embedded graphics. + +B<pkfix-helper> works by comparing character widths, not the actual +glyphs. Consequently, it is misled by sets of fonts with similar +character widths (at least for those characters used by a given +document). As an extreme example, all Computer Modern Teletype fonts +of a given design size (e.g., C<cmtt10>, C<cmsltt10>, and C<cmitt10>) +use exactly the same widths for all characters. Human assistance is +generally needed to guide B<pkfix-helper>'s font-matching procedures. + + +=head1 NOTES + +Files produced using the B<--tex> option are Plain TeX files and +therefore must be compiled with F<tex> (or a variation such as +F<pdftex>, F<luatex>, etc.), I<not> with F<latex>. + + +=head1 SEE ALSO + +pkfix(1), dvips(1), tex(1), gs(1) + +PostScript Language Reference, Third Edition. +Published by Addison-Wesley, ISBN 0-201-37922-8, +L<http://www.adobe.com/products/postscript/pdfs/PLRM.pdf>. + + +=head1 AUTHOR + +Scott Pakin, I<scott+pkfh@pakin.org> + + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2011, Scott Pakin + +This file may be distributed and/or modified under the conditions of +the LaTeX Project Public License, either version 1.3c of this license +or (at your option) any later version. The latest version of this +license is in L<http://www.latex-project.org/lppl.txt> and version +1.3c or later is part of all distributions of LaTeX version 2006/05/20 +or later. diff --git a/support/pkfix-helper/pkfix-helper.1 b/support/pkfix-helper/pkfix-helper.1 new file mode 100644 index 0000000000..c0c170fdbe --- /dev/null +++ b/support/pkfix-helper/pkfix-helper.1 @@ -0,0 +1,516 @@ +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "PKFIX-HELPER 1" +.TH PKFIX-HELPER 1 "2011-06-11" "v1.4" " " +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +pkfix\-helper \- preprocess dvips\-produced PostScript documents before passing them to pkfix +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +pkfix-helper +[\fB\-\-help\fR] +[\fB\-\-verbose\fR] +[\fB\-\-force\fR=\fIname\fR=\fIfontspec\fR] +[\fB\-\-ps\fR=\fIfilename.ps\fR] +[\fB\-\-tex\fR=\fIfilename.tex\fR] +[\fB\-\-cache\fR=\fIfilename\fR] +[\fB\-\-include\fR=\fIfontspec\fR] +[\fB\-\-exclude\fR=\fIregexp\fR] +[\fB\-\-keep\fR=\fIfontspec\fR] +[\fB\-\-quiet\fR] +[\fB\-\-no\-repeats\fR] +[\fB\-\-spp\fR=\fInumber\fR] +[\fIinput.ps\fR [\fIoutput.ps\fR]] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +.SS "Motivation" +.IX Subsection "Motivation" +PostScript documents created with old versions of \fBdvips\fR almost +invariably utilize bitmapped (PostScript Type\ 3) fonts. The +problem with bitmapped fonts is that they target a specific device +resolution; a PostScript file produced using 300\ \s-1DPI\s0 fonts will +look grainy on a 600\ \s-1DPI\s0 printer. Even worse, \fIall\fR bitmapped +fonts look grainy when zoomed in on screen. The solution is to use +vector (PostScript Type\ 1) fonts, which are resolution-independent +and appear crisp at any size or scale. +.PP +While it is no longer difficult to configure \fBdvips\fR to use vector +fonts, it is not always possible to rerun \fBdvips\fR on an old \fI.dvi\fR +file. The \fI.dvi\fR file and document source may have been lost; or, +the source may no longer compile because packages it depends upon may +no longer be available. +.PP +Heiko Oberdiek's \fBpkfix\fR script replaces bitmapped fonts in +\&\fBdvips\fR\-produced PostScript files with the corresponding vector +fonts. It works by parsing the PostScript comments with which +\&\fBdvips\fR surrounds bitmapped-font definitions. For example, a font +definition beginning with the comment \f(CW\*(C`%DVIPSBitmapFont: Fi cmss10 11 +28\*(C'\fR and ending with a matching \f(CW%EndDVIPSBitmapFont\fR is known to +define font \f(CW\*(C`Fi\*(C'\fR as \f(CW\*(C`cmss10\*(C'\fR (Computer Modern Sans Serif at a design +size of 10\ points) scaled to \f(CW11\fR\ points. Only the \f(CW28\fR +characters actually used by the document are defined. \fBpkfix\fR then +replaces the font definition with one that defines \f(CW\*(C`Fi\*(C'\fR using the +same set of characters but taken from the \fIcmss10.pfb\fR vector font +file. +.PP +Unfortunately, \fBpkfix\fR works only with versions of \fBdvips\fR newer +than v5.58 (ca.\ 1996). Naturally, the older a PostScript document, +the less likely its sources still exist and can still be recompiled. +Older versions of \fBdvips\fR lack \f(CW%DVIPSBitmapFont\fR comments and +various other PostScript comments on which \fBpkfix\fR relies. Without +PostScript comments to guide it, \fBpkfix\fR is unable to determine which +vector fonts correspond with which bitmapped fonts. +.SS "Overview" +.IX Subsection "Overview" +The \fBpkfix-helper\fR script is a preprocessor for \fBpkfix\fR that +attempts to determine the association between each document-font name +(e.g.,\ \f(CW\*(C`Fi\*(C'\fR) in a PostScript file and the original font (e.g.,\ \f(CW\*(C`cmss10\*(C'\fR) and fonts size (e.g., \f(CW11\fR\ points). It then +fabricates the PostScript comments that \fBpkfix\fR expects to see so +that \fBpkfix\fR can do its job. +.PP +\&\fBpkfix-helper\fR works by comparing every document font against every +\&\fI.tfm\fR font file it knows about (assuming that each such font has a +corresponding \fI.pfb\fR vector version) and selecting the best matching +\&\fI.tfm\fR file for every document font. \fBpkfix-helper\fR has access only +to the widths of characters and only to those characters actually used +in the document. Also, the program recognizes only a limited set of +the most popular \fI.tfm\fR files and scaling factors. Consequently, the +comparison is imperfect and \fBpkfix-helper\fR may attribute an incorrect +font to a given name. Fonts comprising only one or two characters +actually used in a document are particularly problematic for +\&\fBpkfix-helper\fR because many fonts may be near-enough matches to fool +the problem. +.PP +\&\fBpkfix-helper\fR is designed so that a user can guide the +font-selection process by manually designating matching fonts. With a +modicum of diligence and patience a user can correct any mismatched +fonts and help the program provide proper input to \fBpkfix\fR. +.SH "OPTIONS" +.IX Header "OPTIONS" +\&\fBpkfix-helper\fR accepts on the command line the filename of a +PostScript document to process (with the default being the standard +input device) and the filename of a modified PostScript document to +create (with the default being the standard output device). The +program also accepts the following command-line options: +.SS "Frequently Used Options" +.IX Subsection "Frequently Used Options" +.IP "\fB\-h\fR, \fB\-\-help\fR" 4 +.IX Item "-h, --help" +Display usage information and exit. The \fB\-\-verbose\fR and \fB\-\-quiet\fR +options can be used to increase and decrease the amount of information +presented. +.IP "\fB\-v\fR, \fB\-\-verbose\fR" 4 +.IX Item "-v, --verbose" +Increase the amount of status information that \fBpkfix-helper\fR +displays as it runs. Additional instances of \fB\-\-verbose\fR on the +command line further increase the program's verbosity. By default, +only major operations are displayed. A single \fB\-\-verbose\fR +additionally displays information about individual font comparisons. +A second \fB\-\-verbose\fR additionally displays details about some of the +program's internal operations. +.IP "\fB\-f\fR \fIname\fR=\fIfontspec\fR, \fB\-\-force\fR=\fIname\fR=\fIfontspec\fR" 4 +.IX Item "-f name=fontspec, --force=name=fontspec" +Force \fBpkfix-helper\fR to associate a specific font with a given font +name appearing the document. \fIname\fR is a two-character \fBdvips\fR font +name such as \f(CW\*(C`Fa\*(C'\fR. \fIfontspec\fR is a font specification such as +\&\f(CW\*(C`cmmi8\*(C'\fR or \f(CW\*(C`cmsy10\ @\ 1.1X\*(C'\fR. An asterisk used in the name of the +base font (e.g.,\ \f(CW\*(C`cmti*\*(C'\fR) will automatically try all integral test +font sizes from 5 to 17 points (\f(CW\*(C`cmti5\*(C'\fR, \f(CW\*(C`cmti6\*(C'\fR,\ ..., +\&\f(CW\*(C`cmti17\*(C'\fR). An asterisk used as a scale value (e.g.,\ \f(CW\*(C`cmsy10\ @\ *\*(C'\fR) will be replaced by the scale value that gives the best match to +the original font's metrics. The \fB\-\-force\fR option can be specified +repeatedly on the command line. +.IP "\fB\-p\fR \fIfilename.ps\fR, \fB\-\-ps\fR=\fIfilename.ps\fR" 4 +.IX Item "-p filename.ps, --ps=filename.ps" +Create a PostScript file called \fIfilename.ps\fR that shows the \fBdvips\fR +name and a font sample of every font used by the input document. +.IP "\fB\-t\fR \fIfilename.tex\fR, \fB\-\-tex\fR=\fIfilename.tex\fR" 4 +.IX Item "-t filename.tex, --tex=filename.tex" +Create a Plain TeX file called \fIfilename.tex\fR that shows the \fBdvips\fR +name and a font sample of every font that \fBpkfix-helper\fR used in the +output document. +.SS "Infrequently Used Options" +.IX Subsection "Infrequently Used Options" +.IP "\fB\-C\fR \fIfilename\fR, \fB\-\-cache\fR=\fIfilename\fR" 4 +.IX Item "-C filename, --cache=filename" +Speed up \s-1TFM\s0 file processing by caching character metrics into file +\&\fIfilename\fR. On some systems it takes a long time to read a \s-1TFM\s0 file, +spawn \fItftopl\fR to convert it to \s-1PL\s0 format, and extract from the \s-1PL\s0 +data the metrics for each character. The first time \fB\-\-cache\fR is +specified, \fBpkfix-helper\fR proceeds as normal then writes all of the +extracted character metrics to \fIfilename\fR. On subsequent runs in +which \fB\-\-cache\fR=\fIfilename\fR is specified, \fBpkfix-helper\fR reads the +previously extracted metrics from \fIfilename\fR, going through the +\&\fItftopl\fR\-based process only for \s-1TFM\s0 files that were not previously +encountered. +.IP "\fB\-q\fR, \fB\-\-quiet\fR" 4 +.IX Item "-q, --quiet" +Instruct \fBpkfix-helper\fR to produce no output during its run except +for fatal error messages. +.IP "\fB\-1\fR, \fB\-\-no\-repeats\fR" 4 +.IX Item "-1, --no-repeats" +Prevent \fBpkfix-helper\fR from associating the same \fIfontspec\fR with +more than one \fBdvips\fR font name. +.IP "\fB\-i\fR \fIfontspec\fR, \fB\-\-include\fR=\fIfontspec\fR" 4 +.IX Item "-i fontspec, --include=fontspec" +Add \fIfontspec\fR to the list of font specifications against which +\&\fBpkfix-helper\fR compares \fIevery\fR document font. (In contrast, +\&\fB\-\-force\fR designates a font specification to use only for a +\&\fIspecific\fR document font.) The \fB\-\-include\fR option can be specified +repeatedly on the command line. +.IP "\fB\-x\fR \fIregexp\fR, \fB\-\-exclude\fR=\fIregexp\fR" 4 +.IX Item "-x regexp, --exclude=regexp" +Remove all font specifications matching regular expression \fIregexp\fR +from \fBpkfix-helper\fR's list of known fonts. The \fB\-\-exclude\fR option +can be specified repeatedly on the command line. +.IP "\fB\-k\fR \fIfontspec\fR, \fB\-\-keep\fR=\fIfontspec\fR" 4 +.IX Item "-k fontspec, --keep=fontspec" +Do not substitute a vector font for bitmapped font \fIfontspec\fR (\f(CW\*(C`Fa\*(C'\fR, +\&\f(CW\*(C`Fb\*(C'\fR, etc.). This is useful when converting documents that use +obscure bitmapped fonts for which there is no vector equivalent. For +example, it was somewhat common in the past to include graphics such +as university or corporate logos into a document by converting the +bitmapped image into a single-character font and using that font in +LaTeX. \fB\-\-keep\fR prevents such fonts from being replaced. The +\&\fB\-\-keep\fR option can be specified repeatedly on the command line. +.IP "\fB\-a\fR, \fB\-\-any\-scale\fR" 4 +.IX Item "-a, --any-scale" +Allow any value to be used to scale a font when "\f(CW\*(C`*\*(C'\fR" is specified as +the scale factor. Normally, \fBpkfix-helper\fR considers only integer +multiples of 0.1 that are greater than or equal to 1.0 (i.e., +\&\fIfontname\fR\f(CW@1X\fR, \f(CW\*(C`@1.1X\*(C'\fR, \f(CW\*(C`@1.2X\*(C'\fR, \f(CW\*(C`@1.3X\*(C'\fR, etc.). +.IP "\fB\-s\fR, \fB\-\-spp\fR" 4 +.IX Item "-s, --spp" +Specify the number of font samples per page to print to the files +indicated using the \fB\-\-ps\fR and \fB\-\-tex\fR options. The default +value,\ 25, should work well in most circumstances. +.SH "DIAGNOSTICS" +.IX Header "DIAGNOSTICS" +.ie n .IP """Best match for \f(CIname\f(CW is rather poor""" 4 +.el .IP "\f(CWBest match for \f(CIname\f(CW is rather poor\fR" 4 +.IX Item "Best match for name is rather poor" +The best font \fBpkfix-helper\fR found for \fBdvips\fR font name \fIname\fR has +a mismatch value greater than or equal to\ 1.0. (The mismatch value +is the sum of the squares of the difference between the character +widths of a document font and a potential replacement font.) Use the +\&\fB\-\-force\fR option to designate an alternative replacement font or +scaling amount. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +For the purpose of the following examples, assume that \fIoldfile.ps\fR +is the name of a PostScript file produced by an old version of +\&\fBdvips\fR and utilizing at least one bitmapped font. It's always worth +verifying that \fBpkfix\fR can't convert the file on its own: +.PP +.Vb 3 +\& $ pkfix oldfile.ps newfile.ps +\& PKFIX 1.3, 2005/02/25 \- Copyright (c) 2001, 2005 by Heiko Oberdiek. +\& ==> no fonts converted +.Ve +.PP +(Alternatively \fBpkfix\fR may issue an error message such as \f(CW\*(C`!!! +Error: Parse error (@start parameters)!\*(C'\fR.) Only when \fBpkfix\fR can't +replace bitmapped fonts with vector fonts is \fBpkfix-helper\fR needed. +In its simplest form, \fBpkfix-helper\fR takes the name of an input file +(\fIoldfile.ps\fR in this example) and the name of an output file +(\fIpkfix\-oldfile.ps\fR), which will have the same contents as the input +file but serve as suitable input for \fBpkfix\fR: +.PP +.Vb 10 +\& $ pkfix\-helper oldfile.ps pkfix\-oldfile.ps +\& Reading oldfile.ps ... done. +\& Number of Type 3 fonts encountered: 10 +\& Bitmapped fonts are typeset at 600 DPI. +\& Finding character widths ... done. +\& Reading TFM files ... done (103 TFMs in 193 scaling variations). +\& Matching fonts: +\& Processing Fi ... done (cmr10 @ 1X, mismatch=0.11683). +\& Processing Fa ... done (cmti10 @ 1X, mismatch=0.08892). +\& Processing Fb ... done (cmr8 @ 1X, mismatch=0.07133). +\& Processing Ff ... done (cmbx12 @ 1.2X, mismatch=0.02948). +\& Processing Fh ... done (cmtt10 @ 1X, mismatch=0.06895). +\& Processing Fd ... done (cmmi10 @ 1X, mismatch=0.03966). +\& Processing Fj ... done (cmbx12 @ 1X, mismatch=0.03972). +\& Processing Fe ... done (cmbx10 @ 1X, mismatch=0.00762). +\& Processing Fg ... done (cmsy10 @ 1X, mismatch=0.00875). +\& Processing Fc ... done (cmr6 @ 1X, mismatch=0.00284). +\& +\& $ pkfix pkfix\-oldfile.ps newfile.ps +\& PKFIX 1.3, 2005/02/25 \- Copyright (c) 2001, 2005 by Heiko Oberdiek. +\& *** Font conversion: \`cmti10\*(Aq \-> \`CMTI10\*(Aq. +\& *** Font conversion: \`cmr8\*(Aq \-> \`CMR8\*(Aq. +\& *** Font conversion: \`cmr6\*(Aq \-> \`CMR6\*(Aq. +\& *** Font conversion: \`cmmi10\*(Aq \-> \`CMMI10\*(Aq. +\& *** Font conversion: \`cmbx10\*(Aq \-> \`CMBX10\*(Aq. +\& *** Font conversion: \`cmbx12\*(Aq \-> \`CMBX12\*(Aq. +\& *** Font conversion: \`cmsy10\*(Aq \-> \`CMSY10\*(Aq. +\& *** Font conversion: \`cmtt10\*(Aq \-> \`CMTT10\*(Aq. +\& *** Font conversion: \`cmr10\*(Aq \-> \`CMR10\*(Aq. +\& *** Font conversion: \`cmbx12\*(Aq \-> \`CMBX12\*(Aq. +\& *** Merging font \`CMBX12\*(Aq (2). +\& ==> 10 converted fonts. +\& ==> 1 merged font. +.Ve +.PP +Although \fBpkfix-helper\fR tries to automate as much as possible the +font-detection process, some fonts will invariably be incorrectly +identified. The program outputs a warning message if it \fIknows\fR a +match is bad but the lack of a warning message does not necessarily +indicate that \fBpkfix-helper\fR did a good job. It is therefore +strongly recommended that the user produce \*(L"before\*(R" and \*(L"after\*(R" font +sheets: +.PP +.Vb 2 +\& $ pkfix\-helper \-q oldfile.ps pkfix\-oldfile.ps \e +\& \-\-ps=oldfonts.ps \-\-tex=newfonts.tex +\& +\& $ tex newfonts.tex +\& This is TeX, Version 3.14159 (Web2C 7.4.5) +\& (./newfonts.tex [1] ) +\& Output written on newfonts.dvi (1 page, 1292 bytes). +\& Transcript written on newfonts.log. +\& +\& $ dvips newfonts.dvi \-o newfonts.ps +\& This is dvips(k) 5.92b Copyright 2002 Radical Eye Software (www.radicaleye.com) +\& \*(Aq TeX output 2006.06.11:1636\*(Aq \-> newfonts.ps +\& <texc.pro><8r.enc><texps.pro>. <cmr6.pfb><cmsy10.pfb><cmbx10.pfb><cmbx12.pfb> +\& <cmmi10.pfb><cmtt10.pfb><cmr8.pfb><cmti10.pfb><cmr10.pfb>[1] +.Ve +.PP +After running the preceding commands, \fIoldfonts.ps\fR shows samples of +the fonts in \fIoldfile.ps\fR and \fInewfonts.ps\fR shows samples of the +replacement fonts that \fBpkfix-helper\fR used to produce +\&\fIpkfix\-oldfile.ps\fR. Print \fIoldfonts.ps\fR and \fInewfonts.ps\fR and +compare them carefully for incorrect fonts and sizes. +.PP +Suppose that the choice of \f(CW\*(C`cmbx12 @ 1.2X\*(C'\fR for font \f(CW\*(C`Ff\*(C'\fR looks +wrong; say the characters look taller in \fIoldfonts.ps\fR than in +\&\fInewfonts.ps\fR. This is where the trial-and-error stage begins. +Let's hypothesize that \f(CW\*(C`cmb12\*(C'\fR is a better match than \f(CW\*(C`cmbx12\*(C'\fR but +we don't know how much to scale the font. Fortunately, +\&\fBpkfix-helper\fR allows \f(CW\*(C`*\*(C'\fR to be used as a scaling factor to tell the +program to automatically detect an optimal scaling factor, even if +doing so means choosing a nonstandard font size: +.PP +.Vb 7 +\& $ pkfix\-helper oldfile.ps pkfix\-oldfile.ps \-\-force="Ff=cmb12 @ *" +\& Reading oldfile.ps ... done. +\& Number of Type 3 fonts encountered: 10 +\& Bitmapped fonts are typeset at 600 DPI. +\& Finding character widths ... done. +\& Reading TFM files ... failed. +\& pkfix\-helper: Unable to process user\-specified TFM file "cmb12" +.Ve +.PP +Oops, it looks like we don't have a \fIcmb12.tfm\fR file on our system. +Let's try scaling up \fIcmb10.tfm\fR instead: +.PP +.Vb 10 +\& $ pkfix\-helper oldfile.ps pkfix\-oldfile.ps \-\-force="Ff=cmb10 @ *" +\& Reading oldfile.ps ... done. +\& Number of Type 3 fonts encountered: 10 +\& Bitmapped fonts are typeset at 600 DPI. +\& Finding character widths ... done. +\& Reading TFM files ... done (103 TFMs in 193 scaling variations). +\& Matching fonts: +\& Processing Fi ... done (cmr10 @ 1X, mismatch=0.11683). +\& Processing Fa ... done (cmti10 @ 1X, mismatch=0.08892). +\& Processing Fb ... done (cmr8 @ 1X, mismatch=0.07133). +\& Processing Ff ... done (cmb10 @ 1.5X, mismatch=0.00035). +\& Processing Fh ... done (cmtt10 @ 1X, mismatch=0.06895). +\& Processing Fd ... done (cmmi10 @ 1X, mismatch=0.03966). +\& Processing Fj ... done (cmbx12 @ 1X, mismatch=0.03972). +\& Processing Fe ... done (cmbx10 @ 1X, mismatch=0.00762). +\& Processing Fg ... done (cmsy10 @ 1X, mismatch=0.00875). +\& Processing Fc ... done (cmr6 @ 1X, mismatch=0.00284). +.Ve +.PP +The match has definitely improved, although 15\ pt. is certainly an +odd size for a font. Then again, many documents \fIdo\fR use nonstandard +sizes so this may in fact be correct. The best way to verify is once +again to produce, print, and compare a pair of font samples and +iterate until all of the fonts look correct. Use one instance of +\&\fB\-\-force\fR for each font you want to alter. +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +\&\fBpkfix-helper\fR honors the following environment variables: +.IP "\s-1GS\s0" 8 +.IX Item "GS" +The name of the Ghostscript interpreter (default: \fIgs\fR) +.IP "\s-1TFTOPL\s0" 8 +.IX Item "TFTOPL" +The name of a utility for converting \fI.tfm\fR files to \fI.pl\fR files +(default: \fItftopl\fR) +.SH "BUGS" +.IX Header "BUGS" +Even when \fBpkfix-helper\fR finds a perfect match (i.e.,\ the correct +font in the correct size) the mismatch value is still typically +nonzero. The same error is probably what causes \fBpkfix-helper\fR +sometimes to consider the wrong font as being a better match than the +correct font. Suggestions for fixing these bugs are welcome. +.SH "RESTRICTIONS" +.IX Header "RESTRICTIONS" +\&\fBpkfix-helper\fR works only with PostScript files produced by \fBdvips\fR, +not with arbitrary PostScript files. The program has not been tested +with output from versions of \fBdvips\fR older than v5.490 (ca.\ 1992); +output from older versions may or may not work. Only bitmapped fonts +loaded by \fBdvips\fR can be analyzed, not bitmapped fonts loaded by +embedded graphics. +.PP +\&\fBpkfix-helper\fR works by comparing character widths, not the actual +glyphs. Consequently, it is misled by sets of fonts with similar +character widths (at least for those characters used by a given +document). As an extreme example, all Computer Modern Teletype fonts +of a given design size (e.g., \f(CW\*(C`cmtt10\*(C'\fR, \f(CW\*(C`cmsltt10\*(C'\fR, and \f(CW\*(C`cmitt10\*(C'\fR) +use exactly the same widths for all characters. Human assistance is +generally needed to guide \fBpkfix-helper\fR's font-matching procedures. +.SH "NOTES" +.IX Header "NOTES" +Files produced using the \fB\-\-tex\fR option are Plain TeX files and +therefore must be compiled with \fItex\fR (or a variation such as +\&\fIpdftex\fR, \fIluatex\fR, etc.), \fInot\fR with \fIlatex\fR. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIpkfix\fR\|(1), \fIdvips\fR\|(1), \fItex\fR\|(1), \fIgs\fR\|(1) +.PP +PostScript Language Reference, Third Edition. +Published by Addison-Wesley, \s-1ISBN\s0 0\-201\-37922\-8, +<http://www.adobe.com/products/postscript/pdfs/PLRM.pdf>. +.SH "AUTHOR" +.IX Header "AUTHOR" +Scott Pakin, \fIscott+pkfh@pakin.org\fR +.SH "COPYRIGHT AND LICENSE" +.IX Header "COPYRIGHT AND LICENSE" +Copyright (C) 2011, Scott Pakin +.PP +This file may be distributed and/or modified under the conditions of +the LaTeX Project Public License, either version 1.3c of this license +or (at your option) any later version. The latest version of this +license is in <http://www.latex\-project.org/lppl.txt> and version +1.3c or later is part of all distributions of LaTeX version 2006/05/20 +or later. diff --git a/support/pkfix-helper/pkfix-helper.pdf b/support/pkfix-helper/pkfix-helper.pdf Binary files differnew file mode 100644 index 0000000000..18384f8c8b --- /dev/null +++ b/support/pkfix-helper/pkfix-helper.pdf |