| 1 |
|
| 2 |
README for using PostScript Type 1 fonts with xdvik |
| 3 |
=================================================== |
| 4 |
|
| 5 |
Starting with version 22.86, xdvik supports direct display of |
| 6 |
PostScript Type 1 fonts using freetype (version 2). (Prior versions used |
| 7 |
t1lib, which is no longer supported.) Unlike the bitmapped TeX PK fonts |
| 8 |
that xdvik used to depend upon, Type 1 fonts only need to be stored in |
| 9 |
one size on disk. This means no more waiting for mktexpk runs when |
| 10 |
viewing DVI files with previously unused fonts or at a different |
| 11 |
resolution, less hassle with temporary directories filling up with |
| 12 |
PK files, etc. |
| 13 |
|
| 14 |
To be able to support Type 1 fonts, xdvi uses a config.xdvi file. The |
| 15 |
standard `make install' process will copy the file from texmf/config.xdvi |
| 16 |
which is suitable for recent TeX Live distributions. |
| 17 |
(If the file exists already and has been modified from the |
| 18 |
original, the modified file will not be overwritten). Apart from the |
| 19 |
section `Debugging your font setup', this README contains mostly |
| 20 |
instructions for versions of teTeX older than 1.0.x or non-teTeX |
| 21 |
systems; users of teTeX >= 1.0.x and TeX Live should ignore these instructions, |
| 22 |
and only consult the `Debugging' section in case of problems with |
| 23 |
the Type 1 fonts setup. |
| 24 |
|
| 25 |
Note that xdvi can always use a TeX bitmap (PK) font as a fallback |
| 26 |
(produced via mktexpk, which in turn invokes ps2pk or gsftopk), so |
| 27 |
it's not vital that xdvi is configured for Type 1 fonts. However, for |
| 28 |
the reasons mentioned above, setting up xdvi properly for Type 1 fonts |
| 29 |
is usually preferable. |
| 30 |
|
| 31 |
|
| 32 |
========================================================== |
| 33 |
Instructions for users of older teTeX versions (< 1.0), or |
| 34 |
non-teTeX systems: |
| 35 |
========================================================== |
| 36 |
|
| 37 |
Xdvi needs to load all Type 1 fonts from disk, which means that it |
| 38 |
(just like dvips) needs to translate the TeX names for fonts to |
| 39 |
filenames, load encoding vectors according to map files and so on. |
| 40 |
This process is governed by fontmap files, which use the same format |
| 41 |
as dvips. |
| 42 |
|
| 43 |
The section `Fontmap file format' below and the dvips documentation |
| 44 |
contain more information on the fontmap file format. |
| 45 |
|
| 46 |
|
| 47 |
================= |
| 48 |
Font Search Order |
| 49 |
================= |
| 50 |
|
| 51 |
The order in which xdvi tries to load a font file is: |
| 52 |
1. Virtual fonts |
| 53 |
2. Type 1 fonts |
| 54 |
3. PK fonts |
| 55 |
4. (If xdvi was compiled with gf support:) GF fonts |
| 56 |
|
| 57 |
For example, consider the search for TeX's default font `cmr10'. In |
| 58 |
most texk/TeX Live installations the file cmr10.pfb is present in the |
| 59 |
texmf tree. This means that it is found at step 2 in the search and |
| 60 |
the Type 1 font is used. Currently xdvi handles fonts with no |
| 61 |
"implied" encoding (such as cmr10) without configuration. Most texk and |
| 62 |
TeX Live installations come with the Blue Sky Research/Y&Y Type 1 versions |
| 63 |
of Knuth's fonts, and xdvi will be able to use them with no further |
| 64 |
action. |
| 65 |
|
| 66 |
The 35 `standard PostScript fonts', such as Times Roman, are are |
| 67 |
usually available under a different name for previewing the file with |
| 68 |
ghostscript. These font files can be used by xdvi, too, and xdvi mimics |
| 69 |
ghostscript's process for finding them. However, this is usually unnecessary, |
| 70 |
since TeX Live comes with fonts that can be used in place of those provided |
| 71 |
with ghostscript. |
| 72 |
|
| 73 |
As an alternative, these 35 fonts to be copied to a place where xdvi |
| 74 |
can find them. Users of older systems can use the |
| 75 |
`t1mapper' script to copy/symlink the required files to a directory |
| 76 |
where xdvi can find them; please see the file README.t1mapper and the |
| 77 |
manual page of t1mapper for more information. This support may be dropped |
| 78 |
in later versions of xdvi. |
| 79 |
|
| 80 |
|
| 81 |
=================== |
| 82 |
Fontmap file format |
| 83 |
=================== |
| 84 |
|
| 85 |
In principle Xdvi only accepts a subset of the fontmaps used by dvips |
| 86 |
and pdftex. In practice the restrictions are not very restraining. |
| 87 |
For a description of the font map file syntax, see the `psfonts.map' |
| 88 |
section of the dvips manual (dvips.{texi,dvi,pdf}). |
| 89 |
|
| 90 |
Xdvi accepts fontmaps that obey these rules: |
| 91 |
|
| 92 |
1. The encoding files must have a .enc extention or be included by the |
| 93 |
<[ ... syntax in the fontmap. Encoding is optional. The ReEncodeFont |
| 94 |
keyword and its argument is tolerated, but it is _ignored_. xdvi |
| 95 |
looks for a <foo.enc or <[foo to determine the encoding vector, and |
| 96 |
re-encode the font. |
| 97 |
|
| 98 |
2. The other file in the map line must be a font file in pfa or pfb |
| 99 |
format. The extension need not be included for the sake of xdvi, |
| 100 |
but dvips and pdftex might need it, so it is better to include it when |
| 101 |
using shared fontmap files. |
| 102 |
|
| 103 |
3. There may not be any other input files on a fontmap line. |
| 104 |
|
| 105 |
Xdvi is not a printer and cannot accept arbitrary postscript |
| 106 |
prologues or set up things in fontmaps. |
| 107 |
|
| 108 |
4. Xdvi decodes the ExtendFont and SlantFont commands in the quoted |
| 109 |
postscript code and the extension factor and slanting is applied |
| 110 |
to the font when displayed. Any other magic done by the quoted |
| 111 |
PostScript code won't be understood by xdvi. |
| 112 |
|
| 113 |
|
| 114 |
========================= |
| 115 |
Debugging your font setup |
| 116 |
========================= |
| 117 |
|
| 118 |
If your Type 1 font setup doesn't work, please check the following: |
| 119 |
|
| 120 |
1. Make sure that xdvi finds your config.xdvi file (this file is optional; |
| 121 |
by default it will use the same map files as dvips lists in its config.ps |
| 122 |
file). If you use it, the file should be located in a directory |
| 123 |
referenced by the TEXINPUTS variable, which can be either set in your |
| 124 |
shell environment, or in your texmf.cnf file. This directory is generally |
| 125 |
something ending in texmf/dvips/config or texmf-dist/dvips/config . |
| 126 |
|
| 127 |
2. Make sure that xdvi can find the map files listed in your config.xdvi |
| 128 |
file, or in config.ps. Use the `-debug 3968' option for |
| 129 |
xdvi to see where it searches for the files. E.g., with the (ba)sh |
| 130 |
shell: |
| 131 |
|
| 132 |
$ xdvi -debug 3968 ~/test.dvi 2>&1 | grep xyz.map |
| 133 |
|
| 134 |
For a successful search, the end of the grep'ed output should |
| 135 |
look like this: |
| 136 |
kdebug:fopen(/some/path/xyz.map, r) => 0x81cccd8 |
| 137 |
|
| 138 |
If the search is not successful, look at the debugging output in |
| 139 |
more detail, checking which variable settings contribute to the |
| 140 |
path where a file is searched. |
| 141 |
|
| 142 |
Generally, if you have problems here, then you also have them with dvips. |
| 143 |
|
| 144 |
3. Make sure that xdvi finds the Type 1 versions of your fonts. E.g. |
| 145 |
if your texmf tree is located in /usr/local/share/texmf, |
| 146 |
for a minimal LaTeX file like |
| 147 |
|
| 148 |
\documentclass{minimal} |
| 149 |
\begin{document}test\end{document} |
| 150 |
|
| 151 |
the command |
| 152 |
$ xdvi -debug 3968 ~/test.dvi 2>&1 | grep cmr10.pfb |
| 153 |
|
| 154 |
should contain a line at the bottom that looks similar to this: |
| 155 |
kdebug:search(cmr10.pfb) => /usr/local/share/texmf/fonts/type1/bluesky/cm/cmr10.pfb |
| 156 |
|
| 157 |
Check the settings of TEXMFMAIN, TEXMF and T1FONTS in your |
| 158 |
texmf.cnf file if this doesn't work. |
| 159 |
|
| 160 |
|
| 161 |
See also kpathsea.pdf and texlive-en.pdf for more information on the |
| 162 |
how kpathsea works. |
| 163 |
|
| 164 |
|
| 165 |
Some common sources of problems: |
| 166 |
|
| 167 |
- You have several texmf.cnf files on your system, and xdvi isn't |
| 168 |
using the one you expect. Use the following command to find out |
| 169 |
which: |
| 170 |
$ xdvi -debug 3968 ~/test.dvi 2>&1 | grep texmf.cnf | grep fopen |
| 171 |
|
| 172 |
- The SELFAUTO... variables are used to define one of the TEXMF or |
| 173 |
XDVIINPUTS variables in texmf.cnf, but xdvi.bin hasn't been |
| 174 |
installed in a path that is compatible with SELFAUTO.... |
| 175 |
For example, if your texmf tree is |
| 176 |
/usr/share/texmf/web2c/ |
| 177 |
and the search path contains |
| 178 |
{$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c}: |
| 179 |
then xdvi.bin should be contained two directories below |
| 180 |
/usr, e.g. in /usr/local/bin/xdvi.bin. ($SELFAUTOPARENT is |
| 181 |
a misnomer in that it actually denotes the grand-parent |
| 182 |
of the current directory, i.e. two levels up in the directory |
| 183 |
hierarchy). |
| 184 |
|
| 185 |
As a fix, either set XDVIINPUTS in your shell environment, or install |
| 186 |
xdvi.bin in its proper place. |