[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Proposal for raster graphics extensions to gpic

From: Egil Kvaleberg
Subject: [Groff] Proposal for raster graphics extensions to gpic
Date: 16 Nov 2002 18:26:52 +0100

The proposal is really meant to be the basis for a uniform, versatile
and easy to use way of including raster graphics and PostScript images
in groff. There should be no compromises wrt. picture quality.

As mentioned earlier, I think the process must begin with gpic. 

The addition I propose is simple, like in this example:

        image("") height 1;

The image object type is akin to the box object, and more complicated
gpic constructs should work as expected:

        border = 0.3c;
        A: image("" width 2.5c;
        box at last image height 2*border + width 2_border + A.wid;

The reasons for the parenthesis is that without them, the
syntax for an image object with text gets really ugly. Also
I foresee possible future optional attributes in addition to the file
name -- the parenthesis will make these clearer.

My work so far is collected in a patch towards the groff-1.18 

This is by all means not finished: Things as they are right now will
only work with postscript images and postscript output. Not totally
useless; the result so far allowed me to produce the updated PIC
document - see below. Don't be too concerned about the lack of image
formats right now, that can be added in due course.

The next thing on the agenda would be to do changes to groff. This will 
allow support for devices other than postscript. I think the best way
is to introduce a new general escape sequence for handling images,
akin to the \X'ps: import ...'. But that will really be a technicality,
the groff user will only need to concern herself about the gpic
image object.

Future efforts towards for instance implementing images with surrounding
text can be centered around handling gpic images, where we will then get
the added benefit that whatever is done here will benefit both 
raster images as well as traditional images.

Another benefit by implementing raster graphics via gpic is that 
images from xfig containing raster graphics can now be supported by a
simple update of fig2dev.

gpic anoraks will notice that I have used the opportunity to support
units other than inches in gpic. At least on these shores typesetters
have used metric units for many decades, and the method of changing the
scaling to support centimetres is really far, far too ugly. 

To further illustrate how the image object works, I have updated the
excellent PIC tutorial from Eric S. Raymond to include description of
images. These updates are contained in the patch, but since the updated
document needs the updated gpic for obvious reasons, and to avoid
possible chicken-and-egg situations, I have provided a pdf version of
the document which will temporarily be available from:
The description of the image object begins at the end of page 4. 

(It should be noted that the pdf document shows a couple of problems
with ps2pdf: fi ligatures get the wrong spacing, and curves become too

Email: address@hidden  
Voice/videophone: +47 22523641 Voice: +47 92022780 Fax: +47 22525899
Mail:  Egil Kvaleberg, Husebybakken 14A, 0379 Oslo, Norway

reply via email to

[Prev in Thread] Current Thread [Next in Thread]