Next Previous Contents

2. Technical Details

Both the program files and the source code for GLE are available at no cost over the internet. The open nature of the source code has spawned several different versions of GLE; many of which have slightly different syntax for entering the programming script. This guide has been written explicitly for version 3.5, older versions will not contain all the features discussed here. A newer version, GLE2000, exists for Windows 95/98 which has some additional commands and a better, that is to say an icon driven, user interface. Many of these revisions come with their own comprehensive user documentation, which details not only installation and setup procedures, but should also cover any changes in syntax.

The existence of GLE in different versions and on different platforms means that some of the commands may differ slightly from those written below. It may be necessary to experiment with different names for fonts, shading, and colours, all of which are very sensitive to both the operating system and version. GLE 3.5, for example, uses a shorthand tagging system for its fonts, while GLE 2000 uses the full name as listed in the Windows directory. Where possible the examples have avoided the use of these less well defined variables; however experimentation may be necessary, not only to complete the examples presented here but also to exploit the additional features that may not.

2.1 Download and installation

GLE is available within the public domain and can be freely downloaded from several sites across the internet. For executables and source code for both PC and Linux machines see http://www.uark.edu/misc/vlabella/gle/gle.html:

Derek Ingram's GLE2000 can be found at:

http://softlad.narod.ru/graphics_and_drawing/flow_chart_and_diagram_making/.

Many of the sites from which GLE can be downloaded provide comprehensive installation instructions for different operating systems and machines. The installation of GLE 3.5 for DOS and Windows is detailed below, instructions for Linux can be found on Stephen Blundell's homepage at http://users.ox.ac.uk/~sjb/gle/

Installation for MS-DOS and Windows 2000/98/95

Files needed: gle35-w32-RO-23.exe (self extracting zip file)

Run gle35-w32-RO-23.exe, this will create a program directory directory gle3.5. Alternatively, if you have the non-executable zip file then unzip into your chosen directory (which we assume to be c:\gle3.5 from now onwards).

We can enter the GLE directory either through the windows interface or, in MS-DOS, by typing

cd gle3.5

To compile a GLE script we first save it as a ASCII text file, then run GLE with the script. In MS-DOS mode we type,

gle_ps filename.gle

Or in Windows we may double click on the gle_ps icon, then type in the name of our file.

When GLE is run a ‘font.dat’ error may occur. In this case it is neccessary to set the environment variable to point to the directory where GLE is located. Start an MS-DOS prompt from the START menu in Windows, then:

cd \
edit autoexec.bat
The blue edit screen will now appear, scroll to the end of the file and insert the following line,
set GLE_TOP=c:\gle3.5\
Select save from the FILE menu, then exit. GLE should now run correctly, although it may be neccessary to restart the computer for changes to take effect.

2.2 Working with GLE

The GLE executable is merely an interface that takes a programming script and converts it into a postscript file for embedding within other documents. The script can be created as a plain ASCII file with any text editor. There are not, as yet, any dedicated editors that provide highlighted commands, debugging routines or other luxuries.

Once the script has been written then we can compile it using the GLE program itself. Ideally, this will produce a postscript, .ps, file in the same directory as the program file. More often though, GLE will produce a number of error messeges indicating the line number and type of error which occured. The error mesages are reasonably comprehensible, certainly compared with many other languages, and corrections should be made to the .gle file before it is saved and recompiled.

There are several options that can be added to the GLE command. For producing diagrams to be included within documents a useful option is the ability to produce encapsulated postscript, .eps files. To do this we add the option,

gle filename.gle -deps
to the command for Linux, and for MS-DOS we write,
gle_ps filename.gle /deps

There are two commands that help the external formatting of the text introduced in GLE 3.5. The first allows for the addition of a text comment in start of the postscript file that is produced. To add such a comment we insert the line,

pscomment text
Where ‘text’ represents the comment placed at the start of the postscript file. The command must be entered at the very start of the program, before the initial size command.

In some applications a GLE file will appear with a white border around it, a black bounding box, or may be missing a section of the graphic. This is usually due to confusion between GLE and some graphics programs, by default GLE adds a whitespace boundary to the graphic which may be interpreted in some applications (photoshop for example) as a change of origin. To reset the origin to (0,0) we add the line

tsbbtweak
Where again the command must come before the body of the program.

Although the diagrams included in this document are a close representation of the accompaning GLE code, there have been a number of alterations for the sake of typesetting. They have been scaled to fit within a sensible size on the page, in most cases a bounding box is added, and some of them have been clipped to remove unwanted construction lines. The scaling is due to the underlying document type (SGML), the bounding box and clipping are added using the box and clip commands covered in sections Shapes and sizes and Clipping respectively.


Next Previous Contents