[comp.windows.x] Reading PK fonts in the server

grunwald@flute.cs.uiuc.edu (Dirk Grunwald) (01/25/89)

Has anyone looked into reading ``pk'' fonts in the X server?

The advantages of this are numerous:

	+ PK is compact ( smaller than e.g, compressed SNF fonts,
	  e.g., ``cmr10.300pk'' is 5084 bytes and ``cmr10.300.snf.Z''
	  is 7140. cmr10.300.snf (uncompressed) is 15156 )

	+ It has a machine independent definition and is well documented.

	+ It's got a FREE front-end (i.e. MetaFont), allowing people
	  to produce their own fonts.

	+ It makes a dvi previewer much more affordable (Ok, so it's
	  not a good reason).

The downside is:
	+ yet more code (should be less than 8K though, all told)

	+ while `pk' is machine independent, the reader would need
	  to be customized for the final bit, byte and word orders.

I was thinking about this when I wrote the metafont (pxl/gf/pk) -> bdf
converted -- it's silly to have the same information in two formats.

If I take ``pk'' fonts, shrink/enlarge them and then convert them to
``bdf'' and eventually to snf, I use twice the amount of disk space.
I would rather generate reduced versions of the metafont fonts
(e.g., cmr10.150pk ) using metafont.

If anyone takes a stab at it, use the `pk' reader from `xdvi' -- the one
in `texx' is too tied into the rest of the dvi library.

Dirk Grunwald
Univ. of Illinois
grunwald@m.cs.uiuc.edu

vojta@maypo.berkeley.edu (paul vojta) (01/28/89)

In article <GRUNWALD.89Jan24142630@flute.cs.uiuc.edu> grunwald@flute.cs.uiuc.edu (Dirk Grunwald) writes:
>
>Has anyone looked into reading ``pk'' fonts in the X server?
>
>The advantages of this are numerous:
>	...
>	+ It makes a dvi previewer much more affordable (Ok, so it's
>	  not a good reason).
>	...
>
>Dirk Grunwald
>Univ. of Illinois
>grunwald@m.cs.uiuc.edu

As long as we are on the subject of wish lists for additions to the server,
why not allow the client to send a font to the server 'on the fly'?  This
would at least help in the writing of dvi previewers.  (The previewing program
has to read the pk file anyway to get the character widths, etc., so it might
as well send the characters down to the server rather than have both the client
and server read the same file.  Also, problems tend to crop up if the client
and server are on different machines with slightly different TeX font
libraries online.)

My other wish, if the above cannot be granted, is having a PutImage which only
acts like XDrawString instead of XDrawImageString.  What I mean is, quoting
from the man page for XDrawString,
	"The drawable is modified only where the font character has
	a bit set to 1."
Again, this would be useful for dvi previewers, so that overstrike characters
can be handled correctly.  (Sure, I could use GXand or GXor, but maybe not on
a color display.)

In case you haven't guessed yet, I've been hacking around with a dvi previewer,
too; in this case it's pub/vxdvi.shar.Z on charon.mit.edu
(also available in a newer version from pub/tmp/#xdvi.shar.Z on
ucbvax.berkeley.edu).

Paul Vojta, vojta@math.berkeley.edu