This directory contains the source for the Canvas widget.

The Imakefile in this directory will create both a library with all the
canvas functions and a simple client to allow testing of features of 
the canvas.

To compile the test client you need to have generated ../misc/libmisc.a

The file .term-defaults contains resource declarations necessary for
the test client. You should call xrdb -merge on it.

To test out a specific function of the canvas, simply put a key binding
for it in .term-defaults.

Agreed, the procedure looks a bit weird, but it worked quite well
for me, you don't have to change actual code in the main
program to test different functions.

A note about the auto-selection of fonts in the canvas:

The canvas tries to be really clever about deriving bold and double
sized fonts from the normal font. But for this it relies on the
font having a proper name complying to the XLFD. This at least should
be true for any server newer than X11R3. For the double sized fonts
it relies on the server being able to scale fonts, this probably only
works on servers newer than X11R4.

It first tries to find the "real font name" even if some alias like 
8x13 is specified.

Then it derives a bold font through modification of the standard
font description fields. If this doesn't work, the user should
specify a bold font explicitly.

Double sized fonts rely on font scaling to work. The canvas will
request fonts for screen resolutions twice as large as the one
in the standard font. By modifying only the x resolution this results
in a font that is exactly twice as wide as the standard one but with
the same height. By modifying both resolutions, we get a font that
is twice as large in both directions. 

Example: The 7x14 font has a well defined name of:

	-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1

on my system. The canvas now takes the 'medium' and changes it to 'bold'.
We ignore the average width, since this might not be the same for anything
except the original font and arrive at:

	-misc-fixed-bold-r-normal--14-130-75-75-c-*-iso8859-1

which incidentially matches the well defined name of the 7x14bold font.
For the double sized fonts we have to do a bit more. Double width is
easy - just double the x resolution and arrive at:

	-misc-fixed-medium-r-normal--14-130-150-75-c-*-iso8859-1

For double width/double height we have to double the y resolution as well
as the pixel height:

	-misc-fixed-medium-r-normal--28-130-150-150-c-*-iso8859-1

This scheme has worked for all the fonts and all the servers newer than
R4 I've tried so far. If the normal font is a bitmaped one (e.g. 8x13
or 7x14), one gets a font with simply all pixels doubled, which is
wat we actually want.

If your server doesn't support font scaling, you will have to supply
hand crafted fonts with the proper sizes for the double sized stuff.

The getbdf program by 'der Mouse', when run on a serve that *does* supply
scaling, should give you a bdf file you can use as a start point.

me@pcs.com
