summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/fontinst/base/fibasics.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/fontinst/base/fibasics.dtx')
-rw-r--r--Master/texmf-dist/source/fontinst/base/fibasics.dtx102
1 files changed, 88 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/fontinst/base/fibasics.dtx b/Master/texmf-dist/source/fontinst/base/fibasics.dtx
index 9c459a075b6..56515e55140 100644
--- a/Master/texmf-dist/source/fontinst/base/fibasics.dtx
+++ b/Master/texmf-dist/source/fontinst/base/fibasics.dtx
@@ -1,4 +1,4 @@
-% \CheckSum{1456}
+% \CheckSum{1512}
% \iffalse meta-comment
%
% Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
@@ -64,7 +64,7 @@
% stuff any earlier than this. Note that |\fontinstversion| is not
% just used for indentification but also in |\needsfontinstversion|.
% \begin{macrocode}
-%<pkg|doc>\def\fontinstversion{1.927}
+%<pkg|doc>\def\fontinstversion{1.929}
% \end{macrocode}
% \end{macro}
%
@@ -86,7 +86,7 @@
%<doc>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
%<doc>\ProvidesPackage{fontdoc}
%<pkg>\ProvidesPackage{fontinst}
-%<pkg|doc>[2004/08/07 v\fontinstversion\space
+%<pkg|doc>[2005/02/05 v\fontinstversion\space
%<doc> fontinst documentation package]
%<pkg> fontinst installation package]
% \end{macrocode}
@@ -665,19 +665,25 @@
%
% \begin{macro}{\plainint}
% \begin{macro}{\plaindiv}
+% \begin{macro}{\plainneg}
+% \changes{1.928}{2004/11/24}{Added \cs{plainneg}. That the
+% \protect\LaTeX\ \cs{neg} is taken over by \package{fontdoc} but
+% is needed in \texttt{oms.etx} had gone unnoticed for over ten
+% years!! (LH) Problem reported by Peter Dyballa.}
% \begin{macro}{\plainmax}
% \begin{macro}{\plainmin}
-% \package{fontdoc} saves away \LaTeX's |\int|, |\div|, |\max|, and
-% |\min| as |\plainint|, |\plaindiv|, |\plainmax|, and |\plainmin|,
-% since these control sequences are going to be used for other
-% purposes.
+% \package{fontdoc} saves away \LaTeX's |\int|, |\div|, |\neg|, |\max|,
+% and |\min| as |\plainint|, |\plaindiv|, |\plainneg|, |\plainmax|,
+% and |\plainmin| respectively, since these control sequences are going
+% to be used for other purposes.
% \begin{macrocode}
\let\plainint=\int
\let\plaindiv=\div
+\let\plainneg=\neg
\let\plainmax=\max
\let\plainmin=\min
% \end{macrocode}
-% \end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\TypesetList}
% \changes{1.914}{2000/05/13}{Macro added. (LH)}
@@ -1319,9 +1325,7 @@
%
% \subsection{Conditionals}
%
-% \subsubsection
-% {Conditionals in \package{fontinst}}
-% ^^A \subsubsection{Conditionals in fontinst}
+% \subsubsection{Conditionals in \package{fontinst}}
%
% \begin{macro}{\then}
% \begin{macro}{\if_true}
@@ -1494,9 +1498,7 @@
% \end{macro}
%
%
-% \subsubsection
-% {Conditionals in \package{fontdoc}}
-% ^^A \subsubsection{Conditionals in fontdoc}
+% \subsubsection{Conditionals in \package{fontdoc}}
%
% \changes{1.909}{1999/10/16}{System for documenting both branches of
% \texttt{if} statements in ETX and MTX files added. (LH)}
@@ -1928,6 +1930,78 @@
% \end{macro}
%
%
+% \subsection{Hexadecimal numbers}
+%
+% Some of the file formats \package{fontinst} can generate requires
+% that some numbers are written in hexadecimal form rather than in
+% \TeX's default decimal form. This is somewhat awkward, as it would be
+% very hard to implement without using explicit arithmetic.
+%
+% \begin{macro}{\format_hex}
+% The |\format_hex| command formats a number as hexadecimal digits.
+% The syntax is
+% \begin{quote}
+% |\format_hex|\marg{command}\marg{value}\marg{digits}
+% \end{quote}
+% where \meta{command} will be |\def|ined to be the formatted number.
+% \meta{value} is the number to format; it must not be negative.
+% \meta{digits} is the number of digits to generate. If the
+% \meta{value} is greater than or equal to $16^{\mathit{digits}}$
+% then |\a_count| will be set to \meta{value} divided by this number
+% and the formatted value will be for the corresponding reminder.
+% \changes{1.928}{2004/11/28}{Macro added. (LH)}
+%
+% The macro overwrites |\a_count|, |\b_count|, and |\c_count|.
+%
+% \begin{macro}{\format_hex_i}
+% The |\format_hex_i| macro is the iterator for |\format_hex|.
+% It is used in the context
+% \begin{quote}
+% |\format_hex_i|\marg{command}\marg{control token}
+% \end{quote}
+% If the \meta{control token} is |i| then nothing is done.
+% Otherwise the quotient and reminder of |\a_count| with respect to
+% $16$ is computed, where the former is assigned to |\a_count| and
+% the latter is converted to hexadecimal and prepended to the
+% \meta{command}, after which the macro expands to
+% |\format_hex_i|\meta{command}.
+% \begin{macrocode}
+%<*pkg>
+\def\format_hex_i#1#2{
+ \if #2i \else
+ \b_count=\a_count
+ \divide \a_count \sixt@@n
+ \c_count=\a_count
+ \multiply \c_count \sixt@@n
+ \advance \b_count -\c_count
+ \edef#1{
+ \ifcase\b_count 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or
+ 9\or a\or b\or c\or d\or e\or f\fi
+ #1
+ }
+ \expandafter\format_hex_i \expandafter#1
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% To get the loop to run the wanted number of times, one uses the
+% trick that |\romannumeral| can generate an arbitrary number of |m|s.
+% The |\identity_one| stuff is to prevent |\number| from processesing
+% the subsequent |001~|, which will be the last that |\roman| reads.
+% \begin{macrocode}
+\def\format_hex#1#2#3{
+ \a_count=#2
+ \let#1\empty_command
+ \expandafter\format_hex_i \expandafter#1 \romannumeral
+ \expandafter\identity_one\expandafter{\number#3}001~
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
% \subsection{Error, warning, and info messages}
%
% The code in this subsection is an adaptation of code from the