[Fontinst] Things to update

Philipp Lehman lehman at gmx.net
Tue Dec 9 17:07:06 CET 2003


Nachricht von Lars Hellström am Dienstag, 9. Dezember 2003 15:24:

Hi Lars,

> It is certainly one of the obvious targets, but yours is the first
> actual request for it that I have seen. (As I don't use xdvi
> myself, I never felt any particular need to look into the details
> of it.) And from what you say I gather that simply using the dvips
> map file for xdvi is not always sufficient.

Yes, dvips's map files will work fine unless you're playing any weird 
PS tricks, so it's not a high-priority target. But if you want to 
support the most common drivers natively, I guess xdvi should be in.

> Hmm... The (k) is for kpathsea, is it not? Since I don't see how
> that would be relevant, I suspect that one should not include it in
> the "driver" name, in the interest of avoiding confusion.

Yes, probably so. But xdvik does a lot more than the corresponding 
xdvi version it is based on. PS fonts, for example (vanilla xdvi 
doesn't support PS fonts). See:

        http://xdvi.sourceforge.net/

As to the driver naming, I don't have a particularly strong opinion on 
that.

> Hmm... Is <[ the dvips syntax for "always full download"? (I never
> recall which of << and <[ is which.) Anyway that part is mostly a
> matter of how one declares the encodings. finstmsc.sty by default
> does

<[      download encoding vector
<       download vector or font (subsetting)
<<      download font (no subsetting)

This is identical to dvips's map file syntax. \make_dvips doesn't use 
the "<[" notation, though.

> \declarepsencoding{8r}{TeXBase1Encoding}{\download{8r.enc}}
> \declarepsencoding{8a}{StandardEncoding}{}
>
> and the \download{8r.enc} is expands to <8r.enc in \make_dvips.
> Given a \fulldownload command one could imagine a declaration
>
> \declarepsencoding{mybase}{MyBaseEncoding}{\fulldownload{mybase.enc
>oding}}
>
> to satisfy xdvi, so that fonts \reencodefont'ed using mybase.etx
> would get in their map file entries <[mybase.encoding.

I'm not sure if I understand that. I believe it would be a good idea 
if you'd always separate the encoding vectors from the font files by 
using separate \download macros throughout. E.g.:

\download               ->      <file.whatever
\download_font          ->      <file.pfb or <<file.pfb
\download_vector        ->      <[file.enc

This way encoding vectors are always unambiguous and you could even 
provide a user-interface macro that conveniently turns on full font 
downloading by redefining \download_font. This applies to \make_dvips 
as well.

> >3. There may not be any other input files on a fontmap line.
> >
> >   Xdvi is not a printer and cannot accept arbitrary postscript
> >   prologues or setup things in fontmaps.
>
> Fontinst only makes those if you have a special declaration of the
> font, using \specifypsfont.

How is this hooked up to \make_dvips?

> >4. Xdvi decodes the ExtendFont and SlantFont commands in the
> > quoted postscript code and the extention factor and slanting is
> > applied to the font when displayed.  Any other magic done by the
> > quoted postscript code won't be understood by xdvi.
>
> Should be OK. (In my experience, the context that the quoted PS
> gets inserted into is very special, so it is hard to do anything
> useful but the standard ExtendFont, SlantFont, and ReencodeFont.)

Yup.

Semi-obsolete by now, but the following hack seems to work:

%\def\make_dvips{
\def\make_xdvi{
   \downloads_list={}
   \let\postscript_code\empty_command
   \let\download\append_download
   \ifx \reencode_etx\empty_command \else
      \if_undefined{pse-\reencode_etx}\then
         \etxtoenc{\reencode_etx}{\reencode_etx}
      \fi
      \expandafter\expandafter \expandafter\second_of_two
         \csname pse-\reencode_etx\endcsname
%      \edef\postscript_code{\postscript_code\space
%         \expandafter\expandafter \expandafter\first_of_two
%            \csname pse-\reencode_etx\endcsname
%         \space ReEncodeFont
%      }
   \fi
   \ifdim \xscale_factor=\p@ \else
      \edef\postscript_code{\postscript_code
         \space\expandafter\lose_measure\the\xscale_factor
         \space ExtendFont
      }
   \fi
   \ifdim \slant_factor=\z@ \else
      \edef\postscript_code{\postscript_code
         \space\expandafter\lose_measure\the\slant_factor
         \space SlantFont
      }
   \fi
%   \ifx \PS_font_name\unknown_str \get_PS_font_name \fi
%   \ifx \PS_font_name\clueless_str
%      \includewarning\warn_undecided_data
%      \_a_true
%   \else
%      \if_undefined{psf-\PS_font_name}\then
%         \_a_true
%      \else
%         \csname psf-\PS_font_name \endcsname
%         \_a_false
%   \fi\fi
%   \if_a_
      \ifx \PS_font_file\unknown_str \get_PS_font_file \fi
      \append_download{\PS_font_file}
      \ifx \PS_font_file\clueless_str
         \includewarning\warn_undecided_data
      \fi
%   \fi
   \def\download##1{~<##1}
%   \pout_line\output_dvips{
   \pout_line\output_xdvi{
%      \TeX_font_name\space\PS_font_name
      \TeX_font_name
      \expandafter\empty_command \the\downloads_list
      \ifx \postscript_code\empty_command \else
         \space"\postscript_code\space"
      \fi
   }
}

-- 
Philipp Lehman <lehman at gmx.net>



More information about the fontinst mailing list