 %%%%% dmview.sty macros
  %%% Macros for speedy TeX previewing with DM virtual fonts
  %%% in cases where the unlimited use of DM fonts
  %%% badly slows down the preview:
  %%% --- in particular for Textures 1.6.x for x<=2
  %%% preview speed for virtual fonts is half of normal.
  %%% (The DM fonts are virtual extensions of CM fonts
  %%% for languages with accented letters; they help to
  %%% perfect hyphenation and kerning.)
  %%% DOCUMENTATION: in header and after \endinput.
  %%% See also Textures virtual font tutorials, #5.
  %%% DOGTAG: Laurent Siebenmann, February 1994, alpha version,
  %%% lcs@matups.matups.fr for support.
  %%% MASTER POSTING IN 1994: anonymous  ftp matups.matups.fr
  %%%    in directory  pub/TeX/ Fonts.dir/DM.dir/
  %%% USER MACROS:
   %%   \DMtext --- switch a number of basic text fonts from CM to DM.
   %%      May double preview time. So better use \DMpar.
   %%   \CMtext --- switch the same fonts fonts from DM to CM; for fast preview.
   %%   \DMpar --- switch until the next paragraph ending. Also switches to
   %%     DM the *current* font provided it is CM and and has a DM version
   %%     in the standard series of 55 DM fonts; and returns to CM
   %%     at the next paragraph ending.
   %%     Place \DMpar at beginning of each paragraph with bad hyphenation.
   %%     If there is a change to a *non*-basic text font within the
   %%     paragraph, you may have to add an extra \DMpar after each such change.
   %% While \DMtext is in force \DMpar does nothing; best not mix the two.
   %%% REQUIREMENTS:  You should have in your format
   %%  (a) an accent administration system (eg. CaesarCM) that
   %%  automatically uses the available accented characters of DM fonts
   %%  (b) suitable hyphenation tables for the languages to be used.
   %%  Such formats are built by format-dumper-cm posted on
   %%  on ftp matups.matups.fr and the CTAN archives.
   %%  LaTeX users see end of file, please.
   %%%%%%%%%%%%%  See further doc after \endinput

 \ifx\DMviewCatAt\undefined
 \else
   \message { \string! DMview.sty already loaded.}
   \expandafter\endinput
 \fi

 %%% \catcode`\@ to 11
 \chardef\DMviewCatAt=\catcode`\@
 \catcode`\@=11

 \def\gobble#1{}
 \def\repeatfont{\edef\temp{\expandafter\string\the\font}%
              \csname\expandafter\gobble\temp\endcsname}
 \let\EX@\expandafter


 %%%% PLEASE COPY THE FOLLOWING LISTS TO YOUR STYLE FILE
 %%%% BEFORE MODIFYING; OR RENAME THIS FILE
 %%%% ------- begin user modifiable font lists
 \def\DMtext{%
  \font\tenrm=dmr10
  \font\ninerm=dmr9
  \font\tenbx=dmbx10
  \font\ninebx=dmbx9
  \font\tenti=dmti10
  \font\nineti=dmti9
  \font\tensl=dmsl10
  \font\ninesl=dmsl9
  \ninfornine
  \DMtrue\repeatfont}

\def\CMtext{%
  \font\tenrm=cmr10
  \font\ninerm=cmr9
  \font\tenbx=cmbx10
  \font\ninebx=cmbx9
  \font\tenti=cmti10
  \font\nineti=cmti9
  \font\tensl=cmsl10
  \font\ninesl=cmsl9
  \ninfornine
  \DMfalse\repeatfont}

 \def\ninfornine{% patch for (old) LaTeX font system
  \let\ninrm\ninerm
  \let\ninbx\ninebx
  \let\ninti\nineti
  \let\ninsl\ninesl}

 %%% \FullDMholder contains the 55 DM fonts
  %% in the original distribution
 \def\FullDMholder{
dmb10 dmbx10 dmbx12 dmbx5 dmbx6 dmbx7 dmbx8 dmbx9
dmbxsl10 dmbxti10 dmcsc10 dmdunh10 dmff10 dmfi10
dmfib8 dmitt10 dmr10 dmr12 dmr17 dmr5 dmr6 dmr7 dmr8
dmr9 dmsl10 dmsl12 dmsl8 dmsl9 dmsltt10 dmss10 dmss12
dmss17 dmss8 dmss9 dmssbx10 dmssdc10 dmssi10 dmssi12
dmssi17 dmssi8 dmssi9 dmssq8 dmssqi8 dmtcsc10 dmti10
dmti12 dmti7 dmti8 dmti9 dmtt10 dmtt12 dmtt8 dmtt9
dmu10 dmvtt10}%

 %%% \BasicDMholder contains the basic DM fonts
  %%  that will always be loaded.
 \def\BasicDMholder{
 dmr10 dmr9 dmbx10 dmbx9 dmti10 dmti9  dmsl10 dmsl9
dmss10 dmss9 }%
 %%% ------- end of user modifiable font lists

 %% TeX stores fonts names in \category 12 form,
 %% whence the strange coding below.
  \def\@Cleanup#1>#2@{#2}
  \let\EX@\expandafter
  \def\@Meaning#1{\EX@\@Cleanup\meaning#1@}
  %% \@Sanitize#1 sanitizes first exp of #1
  \def\@Sanitize#1{\EX@\def\EX@\@Sanholder\EX@{#1}%
      \edef\@Sanholder{\@Meaning\@Sanholder}
   }

 \@Sanitize\FullDMholder\let\FullDMholder\@Sanholder
 \@Sanitize\BasicDMholder\let\BasicDMholder\@Sanholder

 \def\BasicDMsOnly{\let\FullDMholder=\BasicDMholder} %%

 %%%% WORD-PROCESSING MACROS
  %%
  %%% \IN@0#1@#2@ : Is 1st exp of #1 in 1st exp of #2 ??
   %% Answer in \ifIN@
 \newif\ifIN@
 \gdef\IN@{\expandafter\INN@\expandafter}
 \long\gdef\INN@0#1@#2@{\long\def\NI@##1#1##2##3\ENDNI@
    {\ifx\m@rker##2\IN@false\else\IN@true\fi}%
     \expandafter\NI@#2@@#1\m@rker\ENDNI@}
   \def\m@rker{\m@@rker}

 \newif\ifDM
 \newif\ifDMpar
 \newtoks\DMeverypar

 \def\endDMpar{}% initialization
 \def\DMCurrentFont{%
  \edef\temp{\string d\expandafter\gobble\fontname\font }%\show\temp
  \IN@0\temp @\FullDMholder @%
  \ifIN@
   \edef\temp@{\expandafter\string\the\font}%\show\temp@
   \edef\temp@{\csname\expandafter\gobble\temp@\endcsname}%\show\temp@
   \edef\endDMpar{\endDMpar\font\temp@
       =\fontname\font \relax}%\show\endDMpar
   \expandafter\font\temp@=\temp\relax%
  \fi}

 \def\subDMeverypar{%
         \everypar\expandafter{\the\DMeverypar\CMtext\DMparfalse
                \endDMpar\def\endDMpar{}\repeatfont
                \everypar=\DMeverypar}}

 \def\DMpar{\relax\ifDM\else
    \DMCurrentFont %% undone by \endDMpar
    \ifDMpar\else\DMeverypar=\everypar\fi
    \everypar\expandafter{\the\everypar
       \ifDMpar
          \subDMeverypar
       \fi}%
     \ifvmode\else
       \subDMeverypar
     \fi
     \DMtext\DMfalse\DMpartrue\fi}

 %%% \DMfonts, \CMfonts

 \def\Classic@LaTeX@Only@Msg{%
     \immediate\write16{}%
     \immediate\write16{ *** 
   \string\DMfonts, \noexpand\CMfonts currently 
           for LaTeX non-NFSS only\string!}%
   }
 
 \def\Xfonts@{\catcode`\@=11%
      %% following skips part of lfontsdm 
      %% so it can be simple modif of lfonts
      \let\oldalloc@\alloc@
      \def\alloc@8\fam\chardef\sixt@@n##1{\relax}%
      \csname input\endcsname lfontsdm.tex \relax
      \let\alloc@\oldalloc@
      \catcode`\@=12
      \repeatfont}

 \def\Xfonts@@{\let\temp\relax
    \ifx\undefined\selectfont
    \else
      \def\temp{\Classic@LaTeX@Only@Msg
      \errmessage{}\@@end}%
    \fi
    \temp\Xfonts@}

 \def\CMfonts{\def\dm@{cm}\Xfonts@@}
 \def\DMfonts{\def\dm@{dm}\Xfonts@@}

  
  \let\temp\relax
  \ifx\undefined\@@input
     \def\DMfonts{\Classic@LaTeX@Only@Msg\DMtext}%
     \def\CMfonts{\Classic@LaTeX@Only@Msg\CMtext}%
  \fi
  \temp

 \catcode`\@=\DMviewCatAt

 \endinput

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 ***** DMVIEW.STY DOCUMENTATION (continued from header) ******

     Recall that the key macro \DMpar has a powerful extra catch-all
feature.  If the current font is CM, \DMpar  changes it to its DM
analog, provided one exists among the 55 DM fonts distributed.  There
are two cases when this does something new and useful:

 (a) the control sequence that assigned the current font has a name
say \smallroman not known to dmview.sty. Count on this happening
often if you are not both intimately acquainted with your font
administration package and willing to modify dmview.sty in
accordance.

 (b) the current font is a CM font whose DM analog exists but is not
in the basic set.

    Feature (a) is the most essential, and it argues for using \DMpar
in preference to the other two.  Note that you may have several such
"exotic" fontswitch commands in one paragraph; then, to get optimal
hyphenation, one may have to insert extra \DMpar commands after them.

        \DMtext and \CMtext assume that the following "basic" DM
fonts are available to TeX.  Make sure you have them!

   dmr10 dmr9 dmbx10 dmbx9 dmti10 dmti9 dmsl10 dmsl9 dmss10 dmss9

These basic DM fonts are also always switched by \DMpar.

     These basic fonts will all be loaded by Textures; but
the ten listed here will use only an extra 25 Ko (approx.) of TeX's
font storage space.

     The macro \DMpar assumes by default that all 55 DM fonts are
available to TeX. This costs somewhat more than 200Ko of disk space;
but very little of that will ever be loaded by TeX.  Thus very few TeX
users have reason *not* to have the full collection of 55 DM fonts.

     However, if for some reason,  you have no more DM fonts than the
basic ones, you add the command  \BasicDMsOnly  to your style file to
prevent TeX from calling a font it does not have.

     A more ambitious user may want to modify the font lists found in
the macro listings; but one should do so only from within a style file
or after renaming dmview.sty.  All copies of dmview.sty in
circulation should be standard.

     The one modification that seems recommendable is adjustment of
the "basic" DM font list.  On the one hand, keep it reasonably
small to conserve active memory and not overrun the maximum number
of fonts (about 250 for Textures 1.6.x).  On the other hand, try to
have it cover most of your prose fonts, and the names \tenrm etc. by
which they are called.


        ******** Extras for LaTeX users ********

     As they stand \DMtext and \CMtext are problematic for users of
LaTeX --- who will quickly find that do not do much, because they do
not know enough about LaTeX font nomenclature.

 (a)  for the classical font system of Lamport,  called OFSS or old
font selection scheme.

    As they stand \DMtext and \CMtext work well for pointsize 10;
and the user can modify them for other pointsizes.

    However the main utility of \DMtext is for composition of  a final
version just before printing.  For this, a complete (as possible)
replacement of all CM fonts by DM fonts is desirable. This is
provided by the macro \DMfonts.  For completeness, \CMfonts
is provided to restore CM fonts.

   \DMfonts and \CMfonts  require the file lfontsdm.tex, a version of
lfonts.tex in which a maximum of "cm" fontname prefixes have been
replaced by a variable sugestively named \dm@. Recall that lfonts.tex
the standard font  selection file for LaTeX 2; both are supplied in
format-dumper-cm.

   These macros take a bit of time to act; use them sparingly.

%%%% test for \DMfonts and \CMfonts
\documentstyle[DMview]{article}
\begin{document}

\ShowCaesar
\DMfonts
\'elan
\CMfonts
\'elan

\end{document}



   If they cause you to run out of font space, you will have to find
another solution.  A good one is to compile an extra format (see
format-dumper-cm) selecting the dm fonts in place of the cm fonts.


 (b)  NFSS users (LaTeX principally)

   Recent updates of NFSS hopefully offer standard switches that
are in a sense hefty generalizations of \DMtext and \CMtext and/or
\DMfonts and \DMfonts. Thus a considerable population of NFSS users
hopefully already has access to such macros.  I invite
experienced NFSS users  to contact me to confirm.

Note: Here is a departure point for NFSS adaptation without several
font classes:

\def\DMtext{%
   \expandafter\font\csname cmr/m/n/10\endcsname=dmr10
   \expandafter\font\csname cmr/m/it/10\endcsname=dmti10
   \expandafter\font\csname cmr/bx/n/10\endcsname=dmbx10
   \expandafter\font\csname cmr/m/sl/10\endcsname=dmsl10
   \expandafter\font\csname cmr/m/ss/10\endcsname=dmss10
   \DMtrue\repeatfont}

\def\CMtext{%
   \expandafter\font\csname cmr/m/n/10\endcsname=dmr10
   \expandafter\font\csname cmr/m/it/10\endcsname=dmti10
   \expandafter\font\csname cmr/bx/n/10\endcsname=dmbx10
   \expandafter\font\csname cmr/m/sl/10\endcsname=dmsl10
   \expandafter\font\csname cmr/m/ss/10\endcsname=dmss10
   \DMfalse\repeatfont}

 %%% DMview.tst %% quick test file for DMview.sty 2-94 LCS

\input dmview.sty


 \hsize=9truecm
 \parskip=3pt plus 1pt minus 1pt
%\BasicDMs %% uncomment to see what happens if you restrict to basic fonts
\DMpar
b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
\DMpar b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
\showhyphens{\DMpar   b\'en\'evole}
b\'en\'evole

\font\ft=cmr12\ft  %% switch to a non-basic font

\message{ ********** \fontname\font}
 b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
\DMpar b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole

%\showthe\everypar

%\DMpar
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
\DMpar b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole


%\DMpar
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole
b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole b\'en\'evole

       \end

