This section deals with a number of features of the graphics capacities of DMTG, and some of the utilities that are available to assist the user.
For some applications, it may be necessary to present more complex displays than the normal text-mode used in DM allows. For example, we may wish to present text in several different fonts, or to vary the size of the font, or its color. Or it may be the case that we need to display objects that cannot be handled in text mode at all, such as handwritten words, noise fields, or pictures of objects.
For these applications, DMTG should be used rather than DM. This program uses the TurboGraphics Library available in TurboC Version 2.0, which provides "stroked" fonts. This means that the user can vary the size of the characters in a continuous manner.
Four standard fonts are available: GOTH.CHR (gothic font), LITT.CHR (a little font), SANS.CHR (sanserif font) and TRIP.CHR (triplex font). These are all proportionally-spaced fonts. A number of non-standard fonts have been added, e.g., euro.chr and nonp.chr. The latter is a non-proportionally spaced version of sanserif.
Two programs are available to design new fonts.
(a) Borland Font Editor 'FE'. This requires a mouse and will allow you to modify an existing font ot to create an entirely new font. The file 'fe.doc' explains the usage of this program.
(b) BFED. This program allows the user to view and modify letters in existing fonts, to convert an existing font to a non-proportionally-spaced version, or to move a character within its environment space.
bfed [options] fontname
Options: -nname gives new name of edited font (must be 4 letters)
-p makes font non-proportionally spaced
To change a letter, first Retrieve it (e.g., 'Rf' retrieves lower-case f), then put cursor on desired point, press Enter, then place it on second point, press Enter. If a line existed between those points, it will be deleted. Otherwise, it will be drawn.
To move a character: Select Move command, press cursor key for desired direction. To move further than one grid unit, repeat command sequence.
Note: Naming font files with BFED.
Users who have attempted to use BFED to modify existing fonts may have experienced some difficulties. The following points need to be kept in mind:
(a) the name of a font file must have four letters and the extension '.CHR'. The reason for the restriction on the length of the name is known only to Borland.
(b) the name of the font is stored within the file itself; hence it is not possible to change the name of a font using conventional DOS commands such as REN or COPY. These procedures work as far as loading the font is concerned (because the external filename is used for loading), but break down when you attempt to use the font, since this refers to the internal font name. Thus, the only way to rename a file is to read it in with BFED and then save it with another name.
A new problem has emerged with some recent releases of DMTG. If you use BFED or the Borland FE editor to construct new fonts, you may find that DMTG fails to load them, and uses a default font instead.
We believe that this is the result of a bug in the Borland TurboGraphics library, or in the Font Editor, that is somehow interacting with the size of DMTG (it should be noted that Borland does not support the Font Editor). In earlier versions of DMTG, this bug was not a problem, but as DMTG got bigger, something was eventually overwritten. We currently believe that we have solved this problem in DM v2.61 / DMTG v5.18.
This problem only arises if you give the font a new name. If instead you give the font one of the nine "standard" font names that Borland included with its original release of the software, then everything works correctly. These names are:
TRIP SANS LITT GOTH TSCR SIMP SCRI LCOM EURO
These modified fonts can be stored in the same directory as the item file, and this will help to avoid confusion. So, for example, we have a Hebrew font which is called "GOTH.CHR", and is stored in the directory from which we run our Hebrew experiments. However, the font stored under the same name in the C:\BIN\DM directory is the original Gothic font. This works, since DMTG looks for the font file in the current directory first, and if it is not found there, it goes to C:\BIN\DM.
Obviously, this is messy and undesirable, and we hope that we have eliminated this problem. We mention it now in case somebody is having difficulties and is wondering why. Note that older versions of DMTG (we're not sure how far back this goes) do not have this problem.
When the last frame to be displayed was a graphic file and the current frame is specifying a normal erase (no '!' or 'e') then the area of the screen where the last graphic file was displayed gets erased, regardless of whether the current frame is text or another graphic. Because of this difference between the text frames and the graphic frames, care must be taken when ORing frames together. For example the frames:
/ %0 g x96 "ant.img" / g | x400 "box.img" / g "bee.img" /
would leave the "ant" image on the left of the screen because by the time the "bee" image is displayed, the location of the ant image is no longer available, since only the position of the last graphics image to be drawn is retained. To overcome this problem, the third frame should call for an 'e' to erase the ORed images by erasing the entire screen:
/ %0 g x96 "ant.img" / g | x400 "box.img" / e g "bee.img" /
Program SNAPSHOT is used to capture graphic images from the screen and into a file that can then be modified by a further program (EDTSCR, see below) to produce the IMG files. It is a memory resident program, and as such must be installed before the editing session begins. It is installed simply by running it, if it is already installed it will generate a message telling you so. SNAPSHOT is activated by typing alt-period while running any other program, and will take a snapshot of whatever was on the graphic screen (provided this is an image generated by an EGA graphics board).
The command sequence is as follows:
snapshot <cr> (installs SNAPSHOT)
snapshot file filnam.pc0 (installs SNAPSHOT if not already installed and tells SNAPSHOT what the output filename is)
........ (now run some graphics program, such as ACAD, that gets a suitable image on the screen)
<alt . > (captures screen image)
........ (exit from graphics program)
snapshot quit (un-installs)
The image is now stored on the current directory as FILNAM.PC0. Any name can be substituted for 'FILNAM', but the extension 'PC0' is required, and is provided as the default extension.
If you were writing several different images to disk, the second command could have been:
snapshot file filnam*
snapshot file filnam%d
Successive <alt . > commands would now generate files 'filnam0.pc0', 'filnam1.pc0', 'filnam2.pc0', etc. (The '%d' indicates the presence of a variable).
Use a graphics program that enables you to specify the color of the figure and the background. SNAPSHOT can then be used to capture all four 'planes' of the color image if the extension in the output filename is specified as 'pc*' rather than
'pc0'. For example:
snapshot file filnam*.pc*
EDTSCR allows you to select a portion of a snapshot generated by SNAPSHOT (i.e., a 'PC0' file), and convert it into a format that DMTG can use (referred to as an 'IMG' file). The command line for EDTSCR is:
EDTSCR infile [outfile]
The default extension for the infile is PC0. If you specify an IMG extension to the infile EDTSCR will assume that you are re-editing something it has already processed and it will assume that it conforms to the IMG file format (quite different to the format SNAPSHOT produces). The default extension for the outfile is IMG.
If no outfile is specified, EDTSCR will prompt the user for an output file name at the conclusion of the editing process. If the user types 'Enter', no output is generated at all.
If the infile contains a wildcard, e.g., 'filnam*', then EDTSCR will automatically look for a series of input files, e.g., 'filnam0.img', 'filnam1.img', 'filnam2.img', etc. The user will be prompted for the output file name for each file separately, and any 'outfile' specification in the command line will be ignored.
EDTSCR displays a window that encompasses what it will save as the 'IMG' file. You may move the window by alternately changing the positions of the top left corner and the bottom right corner with the numeric keypad (diagonals 7, 9, 1 and 3 also work). Caps Lock toggles the corner to be moved.
The keyboard command 'I' inverts the image from white to black.
If EDTSCR does not immediately display any image, type 'S'. This causes EDTSCR to swap graphics pages (there are two pages of memory for the graphic screen, either one of which may have been used for display and SNAPSHOT cannot tell which). Any other key will cause EDTSCR to display what it will save and its dimensions and to ask if you are finished. If you are not satisfied, then any key except 'Y' will return you to manipulating the window (otherwise EDTSCR will save the window and exit).
EDTSCR cannot be used to edit multichrome image files, since this is restricted to only one plane. Instead, a multichrome version (M_EDTSCR) must be used.
Apart from cropping the image, the most important function of EDTSCR is to convert the image captured by SNAPSHOT into a format that DMTG can read. This is an indirect and cumbersome procedure, and it would be much better if DMTG could read at least one of the standard graphics formats. One could then use something like Graphics WorkShop to convert existing images into that format.
However, we have to use the TurboC graphics library routines supplied by Borland, and unfortunately, the format they chose did not subsequently become one of the accepted formats.
However, EDTSCR has been modified so that it reads uncompressed black-and-white TIF files. These are usually obtained from a scanner. This eliminates the need for the SNAPSHOT capture program. Note that graphics programs such as PAINT will typically produce compressed TIF files.