[tex-live] Metafont: DVI and PDF trouble

Dan Luecking luecking at uark.edu
Thu Mar 12 03:36:02 CET 2009


Dear Thomas:

GFtoDVI makes use (by default) of a font called gray.tfm to
build each character. Each character in this font is a rectangle
with some proportion of its pixels on, producing a gray rectangle.
These gray rectangles are stacked appropriately to produce a very
large image of each character in the gf file.

In most TeX distributions, the tfm file gray.tfm is produced at 300dpi.
This includes Tex Live 2008. However, the file gray.mf that would be
used to creates the PK font file contains
   if mode=ljfour: input graylj;
   elseif mode=cx: input graycx;
   elseif mode=aps: input grayaps;
   fi
The default mode on most systems (e.g., when automatically generating
a PK font file) is ljfour, and that is a 600dpi font. Thus, there
will almost always be a mismatch between the tfm file and the PK file
used for display.

This is what I would do (and have done but see caveat at end).

1. I would determine what the default PK font resolution is for
various programs. For dviout this is found somewhere in the
its menu system (I think). For dvips this is found in config.ps. For
dvipdfm I don't know if this is configurable. For dvipdfmx this is
found in dvipdfmx.cfg.

2. I would then make sure all of them are set to 600dpi and then I
would copy graylj.mf to gray.mf (in directory
texmf-dist/fonts/source/public/misc/)

3. Then I would generate gray.tfm with
   mf \mode:=ljfour; input gray.mf
and for good measure a PK file with
   gftopk gray.600gf

4. I would then replace the existing
      texmf-dist/fonts/tfm/public/misc/gray.tfm
    with the new one and put the gray.600pk in
      texmf-var/fonts/tfm/public/misc/gray.tfm

5. Finally, run texhash.

[If your printer is old and actually has 300dpi resolution, set all the
config files to that value, keep the existing gray.tfm and copy graycx.mf
to gray.mf.]

This may not always produce good results when viewed on screen, as
screens normally have to reduce the size of bitmap fonts by pixel
averaging. For regular patterns of pixels, such as found in gray.mf,
this generally produces streaking effects. However, if the dpi matches
your printer, the printed proof is usually good.

One final configuration step is useful: find modes.mf and edit the last
line which probably says
   localfont:=ljfour;
If 600dpi is your default resolution, do nothing. But if it is 300dpi,
change this to
   localfont:=cx; % or some other 300dpi mode like jetiiisi
Then remake the mf format.

Caveat: At one point I got this all working, but haven't tried it
in years.


Dan

-- 
Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
Fayetteville, AR 72701
Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
Fayetteville, AR 72701



More information about the tex-live mailing list