[Fontinst] Things to update

Lars Hellström Lars.Hellstrom at math.umu.se
Tue Dec 9 15:24:02 CET 2003


At 19.03 +0100 2003-12-08, Philipp Lehman wrote:
>Nachricht von Lars Hellström am Montag, 8. Dezember 2003 17:08:
>
>> Is there anything else?
>
>I wanted to look into a map fragment writer for xdvi(k) for some time.

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.

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.

>xdvi(k) interprets a subset of dvips' syntax only so, taking a quick
>look at fimapgen, it seems like copying \make_dvips and stripping it
>down a bit should do it.
>
>Here's a quote from the xdvi sources:
>
>--- QUOTE ---
>
>In principle Xdvi only accepts a subset of the fontmaps used by dvips
>and pdftex.  In practice the restrictions are not very restraining.
>For a description of the font map file syntax, see the `psfonts.map'
>section of the dvips manual (dvips.{texi,dvi,pdf}).
>
>Xdvi accepts fontmaps that obey these rules:
>
>1. The vector files must have a .enc extention or be included by the
>   <[ ... syntax in the fontmap.  Encoding is optional.  The
>   ReEncodeFont keyword and its argument is tolerated, but it is
>   _ignored_.  xdvi looks for a <foo.enc or <[foo to determine the
>   encoding vector, and re-encode the font.

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

\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.encoding}}

to satisfy xdvi, so that fonts \reencodefont'ed using mybase.etx would get
in their map file entries <[mybase.encoding.

>2. The other file in the map line must be a font file in pfa or pfb
>   format. The extention need not be included for the sake of xdvi,
>   but dvips and pdftex might need it, so better include it when using
>   shared fontmap files.  An explicit font file name is required by
>   xdvi since xdvi does not have any builtin fonts.

For the last entry, it might be useful to have another variation on the
\download command, that instead signals a file in which the font can be
found if the driver always needs it explicitly.

>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.

>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.)

Lars Hellström




More information about the fontinst mailing list