My graphics software uses my Dip (Device-Independent Plotting)
library for producing graphics output. Dip is an enhancement of the
Tektronix Plot-10 library, with the addition of color, polygons,
menus, etc. It uses a bottom layer of device-dependent driver routines
which are in the
Sysdep part of my
The Dip library is implemented mostly in Fortran. It was originally developed under VMS for the VAX, and later under Compaq (Digital) Unix for Alpha and GNU/Linux for Alpha and Intel. It is currently being developed under GNU/Linux for Intel and AMD and (alas) Microsoft Windows. So far there is no documentation beyond what you're looking at.
Under Linux, Dip uses Alan Richardson's
(available here and
here) for drawing rotated text. I have changed
0 at 7 locations in the source code to avoid the
compiler warning 'makes integer from pointer without a cast'.
Dip can make use of some configuration files and some environment
variables. The instructions in this section refer only to the
HOME environment variable, which
specifies a user-specific directory where the software can create and modify
various files, for configuration, logging, etc.
The section below on advanced installation describes optional
The environment variable
HOME specifies a
user-specific directory where the software can create and modify
various files, for configuration, logging, etc.
D:\USERS\yourname) which the Dip software can use for your home directory. If you use something other than
D:\USERS\yournamein the instructions below by whichever directory you've chosen.
HOMErequired by Dip:
HOMEto point to the home directory discussed above, e.g.,
HOMEis defined as a user variable, not a system variable. All users who want to use Dip software must define this variable for themselves.
msconfig.exeand click OK, then in the resulting dialogue window use the Environment tab to define the new environment variable.
Copy the executable file to somewhere and make it accessible somehow, in the normal n*x way.
It is assumed that a
HOME environmental variable
is already defined.
If the programme doesn't run properly, you may need to worry about fonts. As the default font, Bitstream Courier is tried, then Lucida Typewriter, then Courier. For fonts explicitly selected by the software, the following table describes the first choice of font and a fallback choice for each style. This mix of fonts was arrived at by trial and error on one particular set of computers at one particular point in time, and may not make sense in general.
|Sans serif||Monospaced||Bitstream Vera Sans Mono||Courier|
|Proportional||Bitstream Vera Sans||Helvetica|
gsfonts-x11package, which makes Postscript fonts available to X11. Among others, Adobe Helvetica, Times and Courier are provided as aliases for URW Nimbus Sans L, Nimbus Roman No9 L and Nimbus Mono L, respectively. If that doesn't work, another possibility is to install the Debian packages
xfonts-100dpi. (They're not both required but it doesn't hurt to have both.) After installing the font package(s), give the command
xset fp rehash.
If X11's backing store is not enabled then a Dip window, if covered by another window and then re-exposed, will not be refreshed and part or all of it will be black. Even if the backing store is enabled, a Dip window will come up all black after being minimized and then restored. However, there is little or no reason to ever minimize a Dip window.
If a Dip window is completely or partly black, you need to force it to be repainted. If the programme displays abutton in the lower left corner, then clicking on it will refresh the window. You may need to type Control-Z or click in the lower left corner a few times to get the button to appear. If there is no button, typing Control-Z one or more times may cause the main user prompt to reappear.
The backing store
can be enabled by putting the line
"True" in the
Device section of the system's
/etc/X11/xorg.conf file. If there is no such file,
create one containing the following:
Section "Device" Identifier "Screen0" Option "BackingStore" "True" EndSection
xdpyinfocommand can be used to display the status of the
Backing-store behaviour in the X server has changed with time
(ref). Apparently it was removed at one time and
then re-implemented ‘fairly recently’ (as of 2014 Feb). See, for example, this
from 2013 Nov. And apparently at one time there was a bug such that
the backing store could be enabled using the
startx but not by using the
Menus are displayed as 3-D buttons which are shaded like this when they're up (or unselected) and like this when they're down (or selected). Menu selections are made either with a mouse click or with single-character keyboard shortcuts, as indicated by the underlined character in a menu button.
If the shift key is held down while the mouse is clicked
on a menu button,
all of the buttons between that one and the previously clicked one
will be either selected or unselected. For example,
if you click on menu button
select it and then shift-click on button
E will all be selected.
If you unselected button
A by clicking on it and then
shift-clicked on button
E would all be unselected.
Note that if you exit from one menu by clicking on a button in some other menu, that button will not actually be activated. Click on it a second time to activate it. This is a sometimes very irritating side effect of the way that the user interface is currently implemented.
Each menu item should have one character underlined, which serves as its
keyboard shortcut. In some cases the underlined character comprises one
letter of the corresponding command. In other cases, as illustrated
in the menu shown here,
and letters (
are added to the menu buttons as shortcuts.
The shortcut keys are not case-sensitive, so, for example,
are equivalent. There are also equivalences between other pairs of characters
which commonly appear as shifted and unshifted pairs on the keyboard,
as shown in this table:
Shiftkey in order to use these shifted characters as shortcut keys. (The equivalences may not make sense for some keyboards, but they are applied none the less.)
A menu may include some or all of the control buttons shown at the bottom of
the sample menu shown here. The
All button (keyboard shortcut
*) causes all of the menu items to be selected.
Inv button (shortcut =
~) causes all of the
item selections to be inverted; that is, selected items become unselected
and vice versa. These buttons don't appear if only a single
item may be selected at one time.
The buttons labelled
]) scroll the menu to the first
item, one page back, one item back, one item forward, one page forward
and to the last item, respectively. These buttons don't appear
if the menu is short enough to appear on the screen in its entirety.
Can button (shortcut
\) cancels the
menu, while the
OK button (shortcut
accepts the current set of selections. These buttons don't appear
if only a single selection is possible and the menu closes as
soon as that item is selected.
When you are browsing to select an existing file to open, a menu like the one at the left will appear. The top menu button shows the current directory path; if you click on it you will be asked for a new directory path at which to start browsing. The second menu button is for moving up one level in the directory tree.
Each of the remaining entries in
the menu is preceded by either
D for ‘directory’,
F for ‘file’,
L for symbolic link, or
? for other. Clicking on a
button will move into that directory; clicking on an
button will select that file. Clicking on either an
? button will cause an error.
If the menu is too long to be displayed all at one time, navigation buttons will appear at the bottom and can be used for moving back and forth in the menu.
If you are creating an output file, a
button will appear as the third button from the top of the menu.
If you want to use an existing filename for the new output, just browse
to the appropriate directory and select the file in the usual way.
If, however, you wish to create a new file, browse to the desired directory
and then click on the
<new file> button. You will be prompted
for the name to use for the new file. Normally you should not include
the filename extension (or type); e.g., if you want to create the file
test.tif, just specify
test as the filename.
will know from the context what filename extension should be used.
files are small text files used for
configuring terminal interaction and graphics output.
The only parameters which should normally be adjusted
GNPXVspecify the numbers of pixels horizontally and vertically, respectively, in the screen window used for Dip graphics. They should be in the ratio 4/3.
GNPXVshould be negative if vertical pixel positions are measured top-to-bottom (as they are for screen graphics under both MS Windows and Unix/Linux). The following table shows sample values of
GNPXVthat were found to provide the largest possible graphics window that did not require scrolling, as functions of the display-screen resolution and the windowing system:
|1024×768||872||-654||Windows 98 & 2000|
GFONTSIZEis an integer which specifies the size of the characters used to display text on the screen. Typical values are between 6 and 9, depending on the screen size and resolution and on personal preference. The characters may be ugly at some sizes, depending on which fonts are installed in your system.
.gtd file provided for Microsoft Windows
has conservative settings appropriate for low-resolution (1024×768)
.gtd file can be edited, if necessary, with a text
editor like WordPad or Emacs. (Notepad does not work well because it
doesn't recognise the Unix-style end-of-line convention.)
there are also other
available that allow
Dip to output its graphics to files
in various formats,
including TIFF, PPM, PostScript and Grf.
defines colours by name. It can be used to override or
supplement internal colour definitions.
It is optional; if used, it should be in the location specified
FUN_LOC environment variable.
DIP_NPIXVas the number of pixels you want to use vertically, e.g., 800. You will have to use trial and error to determine a value which uses as much of the screen as possible without having a scroll bar.
FUN_TERMunder MS Windows) can be used to tell Dip what type of graphics output device to use, and hence which
.gtdfiles to use. By default, the device type is
xlibfor Unix and Linux (i.e., any operating system using X11 for graphics) and
dvfgr_qwfor Microsoft Windows. These days, there is seldom if ever a reason to override the default.
Some Dip software will ask you where to send its output.
Normally you just press Enter (or Return) and output goes to the interactive
To specify output to a file:
The recognized device names include:
XLIB: X11 (default under Unix/Linux)
DVFGR_QW: Digital Visual Fortran graphics (QuickWindows) (default under Microsoft Windows)
TIF: TIFF file
PS: PostScript file
GRF: Command file for Grf
PPM: Portable Pixmap file
IMAP: HTML client-side image map
EGA,VGA,PGF,FGRAPH: PC graphics (obsolete)
T4010: Tektronix graphics terminal (obsolete)
T4014,T4014E: Alternative Tektronix (obsolete)
VS2000,VS3500: VWS on VAXstation 2000, 3500 (obsolete)
VS3520: PHIGS on VAXstation 3520 (obsolete)
LN03F*: LN03 printer (obsolete)
LJ3: H-P LaserJet III file (obsolete)
/2424-bits, Xlib only
/PORTRAIT(PostScript or LJ3 only)
NPIXV is specified,
but not both, then the other will be
set so as to keep the normal aspect ratio. The standard numbers of
pixels for each device type are found in the
dip.forfor an example of using the Dip library to produce graphics.
dip_link.cshshows how the programme is linked to the required libraries.
The following colours are defined internally by default. They
may be overridden or supplemented by the user's
The list was adapted from a list distributed
with X11 by the X Consortium.
|Combinations of 0, 127 and 255, or nearby|
Animations and movies can be produced by first generating sequences
of image files using
dipanim_* routines as described below.
From your programme using Dip:
dipanim_initonce at the beginning. The parameter is the number of digits to be used in making up file names for the set of image files. For example, a value of 3 will permit up to 999 frames to be produced.
dipanim_frameonce for each frame of your animation.
When you run your programme, for the output destination
specify, for example,
fling.for for examples.
Fling programme reads
files and either displays them or, with an output specification as above,
exports the individual frames to image files.
.fli animation files
can be produced on a PC using AutoDesk Animator.
These files can be played back
on the PC using
aaplay, or using the portable Fling programme.
An MPEG movie can be produced by using mpeg_encode
to compress a set of PPM files into an MPEG file.
Once you have a set of PPM files, create a file
name.mpeg_param specifying the parameters
for the MPEG encoder.
(I last used version 1.2. The latest (1995) version is 1.5b).
See the encoder documentation in
for details. You'll probably want to use an existing file as a template.)
Run the encoder with the command
To display your movie, use the command
is an example of a movie made using DIP.
for examples of movies made by
converting FLI files.
Note that some frames of the movies are badly corrupted.
This may be because of the particular encoding parameters that I used.
Sets of images can be combined into animated GIF files using various software, e.g., ImageMagick.
I have also used Jeff Lawson's fli2gif to convert FLI/FLC files to animated GIF's.