Dec 132017
 
Swap EGA Fonts, Editor included.
File DUKEFONT.ZIP from The Programmer’s Corner in
Category Printer + Display Graphics
Swap EGA Fonts, Editor included.
File Name File Size Zip Size Zip Type
!README.TOO 758 395 deflated
BROADWAY.EGA 3584 1384 deflated
BROADWAY.FNT 4644 1962 deflated
F2E.BAT 21 18 deflated
FED.EXE 54240 22343 deflated
FNT2EGA.EXE 26528 9381 deflated
FUNNY.EGA 3584 1403 deflated
FUNNY.FNT 4644 2034 deflated
IBM.EGA 3584 1242 deflated
IBM.FNT 4644 1865 deflated
LOADFONT.EXE 7890 2897 deflated
READ.ME 69257 19756 deflated
SANSERIF.EGA 3584 1218 deflated
SANSERIF.FNT 4644 1812 deflated
SANSLITE.EGA 3584 1326 deflated
SANSLITE.FNT 4644 1958 deflated

Download File DUKEFONT.ZIP Here

Contents of the READ.ME file



D U K E L A N G U A G E T O O L K I T
(Version 2.20)
June 1986

copyright (c) 1986
Duke University Language Learning Project (DUCALL)
Duke University, Durham, NC 27706

designed and implemented by
Jeffrey William Gillette
Duke University




Welcome to the Duke Language Toolkit. You will find on this
diskette a number of programs which will enable you to work with
foreign and fancy alphabets on your personal computer.

The purpose of this document is to provide an introduction to the
Language Toolkit, a description of its contents, and some
suggestions for the use of foreign alphabets on your
microcomputer.


1. An Overview of the Duke Language Toolkit

The Duke Language Toolkit is a collection of programs and inter-
faces we have developed, here at Duke, to assist us in humanistic
research in many different languages. One of the primary goals of
the humanities computing project at Duke University is to share
the fruit of our research with the larger academic community, both
for the benefit of other scholarly investigations, and for the
helpful criticism that will enable us to refine and expand the
foreign language capabilities of microcomputers.


Please note the following restrictions on the use of all programs
and materials on this diskette. All programs not incorporated
into Bob Wallace's PC-Write are copyrighted by Duke University,
and are not to be sold for profit under any circumstances. We
encourage you to modify or enhance our programs, but do request
you share with us your modifications or enhancements so that we
may pass the good ideas along to others.


The materials on this diskette are of four sorts: 1) executable
programs by which one may design new alphabets (fonts) and
incorporate them into the computer; 2) some sample fonts; 3)
sample text created using the Language Toolkit; and 4) keyboard
and printer files used with the PC-Write word processor.
Specifically, the files contained on this diskette are:


A. Executable Programs:
Fed.exe - Font editing utility
Loadfont.exe - Loads custom fonts into computer

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 2

Fnt2ega.exe - Converts Fed files for EGA
Fnt2tos.exe - Converts Fed files for Toshiba P351
Fnt2pro.exe - Converts Fed files for Proprinter
Fnt2fx.exe - Converts Fed files for Epson FX-80/85
Chr2fnt.exe - Converts old Makefont files
Lfmod.exe - Modifies Loadfont activation signal

B. Fonts:
Fonts for use with the EGA
Ibm.fnt - Standard IBM font
Greek.fnt - Ascii and Greek font
Hebrew.fnt - Ascii and classical Hebrew font
Cyrillic.fnt - Ascii and Cyrillic font

Fonts for use with Toshiba P351 printer
Tosgrk.fnt - Greek (Greek.fnt)
Tosheb.fnt - Classical Hebrew (Hebrew.fnt)
Toscyr.fnt - Cyrillic (Cyrillic.fnt)

Fonts for use with Proprinter & FX-80/85
Procyr.fnt - Cyrillic (Cyrillic.fnt)

EGA font image files
Ibm.ega - Standard IBM font (Ibm.fnt)
Hebrew.ega - ASCII and Hebrew (Hebrew.fnt)

C. Data
Matthew.grk - The first 2 chapters of Matthew's
Gospel

D. PC-Write files
Regform.doc - PC-Write registration form
Patch.ed - Greek diacritics for PC-Write
Ruler.grk - Greek ruler file (w/ diacritics)
Ruler.cyr - Cyrillic ruler file
Ruler.43 - Sets up 43 line mode
Toshiba.prt - Prints files on Toshiba P351
Greek.prt - Prints files made with "Greek.ega"

The use and significance of these individual files will be
explained further below.


2. Changes in Version 2.20

This distribution diskette contains the Duke Language Toolkit,
version 2.20. It differs substantially from the last major
version (1.3 in December 1985), and the last minor version (2.1 in
March 1986). The primary differences are summarized below:

Differences from version 1.3:

- Makefont is no longer supported by the Language Toolkit. It has
been totally replaced by Fed.exe. The program Chr2fnt.exe has
been included to convert 'chr' files used by Makefont into
'fnt' files used by Fed.

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 3


- Fed, a generic font editor, is now included. With Fed one may
design fonts of any size (up to 30 x 30 pixels). This makes
possible support for printers with downloadable fonts.

- Loadfont is now fully interactive. Once installed, Loadfont
allows fonts to be changed at will through a "popped up" menu.
Loadfont also supports extended fonts (512 characters), a 43
line mode, and control of font loading and switching by
applications programs.

- Printer support is now included in the Language Toolkit, albeit
in provisional form. The Toshiba P351 and IBM Proprinter are
now supported. Support for the Hewlett-Packard LaserJet Plus
is forthcoming.

- A greater variety of foreign alphabets are now included in the
Toolkit.

Differences from version 2.0:

- Support for the Enhanced Color Display has been improved
significantly.

- A "save / continue" feature has been added to Fed, along with
a prompt line to avoid accidental aborting of the program.



3. System Requirements for the Duke Language Toolkit

To use the Language Toolkit, the following is required:

- IBM PC,PC/XT, PC/AT, or true compatible. Both Loadfont and Fed
both do extensive manipulations with hardware and bios. Thus
they require computers compatible with the IBM PC at the bios
level. At least 256K system memory (RAM) is highly recommended
for use with Fed.

- Enhanced Graphics Adapter. It is absolutely impossible to run
Loadfont or Fed without the product IBM markets under the name
"Enhanced Graphics Adapter", or a product specifically
advertised as compatible with the Enhanced Graphics Adapter
(note, however, that no such non-IBM product has yet been
tested with the Language Toolkit).

- Graphics Memory Expansion Card. In its base configuration, the
EGA comes with 64K of video memory. This will allow one font
of 256 characters to be loaded into the EGA. The GMEC adds
another 64K of video memory, and allows the simultaneous use of
2 fonts - i.e. 512 characters at a time. The GMEC can be
upgraded further to allow up to 4 fonts to be stored in memory
simultaneously. Note, however, that the EGA will not allow
more than 512 different characters to be in use at one time, no
matter how much memory is added to the GMEC.


Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 4

- A standard monochrome or Enhanced Color monitor. Note that
neither the standard Color Graphics monitor nor any composite
video monitor will support the EGA's 640 x 350 graphics mode
required by Fed.

- Supported printers. The Language Toolkit currently supports the
Toshiba P351, IBM Proprinter and Epson FX-80/85. Support for
the Hewlett-Packard LaserJet is forthcoming. Printers
compatible with these should also work acceptably with the
Toolkit.


4. FED (1.20)

Fed is a generic font editor for the IBM PC equipped with an
Enhanced Graphics Adapter. Using Fed one may create fonts for use
with the Enhanced Graphics Adapter, or with many of the newer dot
matrix printers which allow the downloading of custom character
fonts. This section describes the use of Fed.

4.1 Editing an existing font

To start Fed, simply give the following command:

A>fed myfont.fnt

Where "myfont.fnt" is the name of an existing Fed file (a 'fnt'
file). 'Fnt' files are font bitmaps created by Fed (more about
'fnt' files in the section 'FNT Files' below). The procedure by
which a new font can be created will be described in section 4.5
below.

If you forget to put the name of the 'fnt' file on the command
line, Fed will ask for the name of the file you wish to use.

Once started, Fed will first read the 'fnt' file, and then
initialize its data structures. After a few seconds the Fed
screen will appear.

The Fed screen contains three regions of information. On the left
side of the screen is a grid box with dimensions equivalent to the
width and height of the font. Characters to be edited will appear
in this box.

The second major region appears on the right side of the screen.
It is a window showing the current font, from character 0 through
character 255. Note that some larger fonts may not completely fit
into this font window. In this case the window contains a portion
of the font, and may be scrolled up and down with the arrow keys.

The third information region on the Fed screen is the status line
at the bottom of the screen. This line shows what special
functions are available (via the Function keys), and any special
modes in effect (e.g. "Push" or "Pull").

4.2 Character select mode

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 5


Fed starts off in the character select mode. This means that the
cursor (a reverse video block) appears in the font window, and the
character grid is empty. One now selects a character to edit by
moving the cursor over the character in question (using the arrow
keys), and selecting that character (with Enter).

Some larger fonts (e.g. fonts for high resolution printers) may
not fit into the font window. In this situation the font window
contains a portion of the font. The window can be scrolled a line
at a time with the up and down arrow keys, or can be scrolled a
window at a time with the PgUp and PgDn keys.

In the character select mode three special functions are
available. F1 saves the font, leaving you in Fed for further
editing. F2 saves the font and quits Fed. The Esc key exits Fed
without saving changes during this editing session.

4.3 Character edit mode

When a character is selected for editing (with the Enter key),
three things happen. First, the character is loaded into the
character grid (on the left half of the screen). Second the
"current character" window appears in the upper right portion of
the screen. Third, the status line presents the special functions
available within the edit mode.

The current character window displays the offset, height and width
of the character being edited. In addition, it shows four views
of the character - normal, high-intensity, reverse video, and
intense reverse video. These views are updated as the character
is modified.

In edit mode a cross shaped "t" cursor will appear in the
character grid. This cursor can be moved from cell to cell with
the arrow keys. In addition, the Home, End, PgUp, and PgDn keys
change their significance in edit mode, and become diagonal arrow
keys.

A character is edited by moving the t-cursor around the character
grid and turning individual cells (pixels) on or off. The Ins key
turns a cell on, while the Del key turns it off. The space bar
toggles the cell on and off alternately.

When you have finished editing a character, that modifications can
either be accepted or rejected. The F10 key will accept the
modifications and make the changes to the character permanent (the
modified character will now appear in the font window). The Esc
key will return to character select mode, forgetting any changes
just made in edit mode.

4.4 Advanced editing features

Within the edit mode, several advanced features are available to
make the process of editing a character easier. These are: blank,
read in, push, pull, insert mode, and delete mode.

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 6


The blank key (F6) will "blank" a character (i.e. reset it to a
space). This feature is helpful when it is necessary to scrap a
character and start over.

F5 allows one to "read in" another character into the current
position. When F5 is hit, the status line prompts for the new
character to read in, and the block cursor appears in the font
window. Use the arrow keys to locate the character to read in,
and type Enter to select that character. Esc backs out of read in
mode without making any changes to the character being edited.

Push (the F7 key) is the first of a two-key instruction that
pushes the entire character from the position of the t-cursor.
The second key is an arrow key, which indicates the direction to
push. Thus F7-up arrow will push the character up one row from
the cursor to the top. F7-left arrow will similarly push the
character one row to the left.

Pull (the F8 key) is the opposite of push. Pull "pulls" the
character in the direction of the cursor. Thus F8-up arrow will
pull the character from the bottom, and F8-left arrow will pull it
from the right side.

In insert mode, every cell into which the t-cursor moves is
automatically turned on. Insert mode is activated by typing
Shift-Ins. Note that an individual cell can be turned off within
insert mode by hitting the Del key. Insert mode is turned off
with Shift-Ins.

Delete mode is just like insert mode. It is toggled on and off
with Shift-Del.

With these advanced editing features a proficient Fed user can
quickly modify a font - pushing and pulling it into shape,
creating graphics and characters with diacritical marks.

4.5 Creating a new font

The easiest way to create a new font is generally to start with an
already existing font, and to modify it as necessary. Thus I may
take the standard IBM font ("ibm.fnt") and modify selected
characters with the following commands:

A>copy ibm.fnt mynewfont.fnt
A>fed mynewfont.fnt

It will occasionally be necessary to start a new font from
scratch. When Fed is given the name of a 'fnt' file that does not
exist, it assumes you wish to create a new font. Fed will then
ask you to define the font - giving it the character width and
height, the ascent (number of rows above baseline). Fed will also
ask a few questions about features that are not yet implemented -
the maximum kern and space between lines. Any reasonable response
to these questions (i.e. within the limits suggested by Fed)
should be acceptable.

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 7


When the parameters have been set, Fed will then create a font of
the specified dimensions. In a few seconds the fed screen should
appear, with the font window blank. Selecting and editing
characters can proceed in the normal way.

4.6 From Fed to font

Fed 'fnt' files are a special structure called a "bitmap" (this
format is explained in more detail in the section 9 below). 'Fnt'
files are not immediately compatible with the Enhanced Graphics
Adapter, nor with any printer. Thus one must write a series of
filter programs to take a Fed 'fnt' file and convert it into the
format expected by EGA or printer. Several such filter programs
are included in the Duke Language Toolkit, and the next section
describes their use.


5. FNT2EGA, FNT2TOS, FNT2PRO, FNT2FX

Once a font has been created with Fed, it is possible to generate
a font file which can be directly used by the Enhanced Graphics
Adapter, or by one of the many printers which support the loading
of custom character fonts. The Duke Language Toolkit includes
filter programs which generate fonts for the EGA, the Toshiba
P351, the IBM Proprinter and the Epson FX-80/FX-85. We hope to
provide a similar program for the Hewlett-Packard LaserJet Plus in
the near future.

Note that Loadfont provides no support for printers. Once a
custom font has been downloaded, it is up to the applications
software to read, for example, a Greek gamma (154 in "greek.ega")
and to send the proper codes to the printer so that, in this case,
a 'u'-umlaut is not printed.

5.1 Fnt2ega

Fnt2ega takes a Fed 'fnt' file and creates a pixel image file for
use with the Enhanced Graphics Adapter. Note that the Fed file
must be a font of 256 characters, whose height is 14 pixels and
whose width is 8 pixels. The EGA is capable of handling other
possibilities, but 8 x 14 is the only size supported by this
version of the Duke Language Toolkit.

The syntax of Fnt2ega is this:

A>fnt2ega source.fnt dest.ega

where "source.fnt" is a Fed file. "Dest.ega" will be a pixel image
file usable by Loadfont.

5.2 Fnt2tos

The Toshiba P351 is a high resolution NLQ ("Near Letter Quality")
dot matrix printer. The P351 allows up to two custom fonts to be
downloaded from the computer. Fnt2tos generates a file which,

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 8

when sent to the P351, will install a custom font in memory.

At this point, Fnt2tos only supports Pica (10 pitch) characters of
fixed (not proportional) length. This means the Fed font should
have height 24 and width 18. Since the maximum number of
characters in a P351 font is 126, Fnt2tos only processes the first
126 characters it finds in the 'fnt' file. The syntax of the
command is:

A>fnt2tos source.fnt dest.tos number

where "source.fnt" is a Fed 'fnt' file. "Dest.tos" will be a file
suitable for downloading font into the P351 printer. "Number" is
optional, and specifies the Toshiba font number for this font.
Valid numbers are 4 and 5. The default is 4.

The resulting Toshiba file ("dest.tos") can be installed in the
P351 with the command:

A>copy /b dest.tos prn

"Prn" is the name given by DOS to the printer. Note the "/b"
(binary copy) is necessary, since the number 26 (ASCII Cntl-Z, the
DOS end of file symbol) may appear within your font, which will
cause "copy" to stop prematurely.

The custom font is accessed by the sequence "E*4" (font 4) or
"E*5" (font 5), where "E" is Escape (ASCII character 27). Valid
character codes are 33 through 126, and 160 through 161.
Character 32 is always a space, and cannot be re-defined in any
font.

5.3 Fnt2pro and Fnt2fx

The IBM Proprinter and the Epson FX-80/85 are inexpensive dot
matrix printers wit near-letter-quality modes. Both support the
downloading of custom fonts. Although the format of downloadable
fonts differ between IBM and Epson, the dimensions of their fonts
are identical, and the same Fed 'fnt' files may be used for both.
The programs Fnt2pro and Fnt2fx use identical syntax, and are
therefore documented together. The command line syntax is:

A>fnt2pro source.fnt dest.pro
A>fnt2fx source.fnt dest.fx

where "source.fnt" is the Fed 'fnt' file, and "dest.pro" or
"dest.fx" will be, respectively, the file with the Proprinter and
Epson font image. The "dest.pro" font can be loaded into the
printer with the command:

A>copy /b dest.pro prn
A>copy /b dest.fx prn

"Prn" is the name given by DOS to the printer. Note the "/b"
(binary copy) is necessary, since the number 26 (ASCII Cntl-Z, the
DOS end of file symbol) may appear within your font, which will

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 9

cause "copy" to stop prematurely.

Both the Proprinter and the FX series printers have nine pins per
character column. Thus the proper size of the 'fnt' file is 11
columns width by 9 columns height. Note, however, that each
individual character can only use the upper 8 rows or the lower 8
rows - i.e. no character can span all 9 rows. If the source 'fnt'
file is not of the proper dimensions, the filter program will
complain.

The IBM Proprinter allows a maximum of 96 characters to be down-
loaded. Fnt2pro will therefore process only the first 96
characters it finds (though it will ignore any blank characters).
The first character will always start at position 33 (the ASCII
'!').

The Epson FX-80/85 allow a full 256 characters to be downloaded,
but make it a bit difficult to access positions less than 33.
Thus Fnt2fx will, when possible, assign the first character to
position 33. If there are more than 224 characters, however, the
program will assign the first character as close to position 33 as
possible.

6. LOADFONT (version 2.20)

Loadfont controls the Enhanced Graphics Adapter, loading,
manipulating, and using various fonts. It provides an interactive
mode in which the user can change the fonts at will, and a batch
command line mode by which one may control the EGA from the DOS
prompt. Loadfont also supports an interrupt driven mode by which
applications programs can access EGA functions without user
intervention (see section 10, "Programming with Loadfont" for more
information on this).

6.1 Installing Loadfont

Loadfont is installed by typing the command

A>loadfont

At this time Loadfont will set up system interrupt vectors,
allocate its necessary memory, and remain resident. When it is
installed, the message "Loadfont now installed" will be displayed.

It is not possible to install Loadfont twice. If Loadfont detects
that it has already been installed it will respond "Loadfont
already installed". This prevents Loadfont from unnecessarily
eating core memory.

As with all resident utility programs, it is important that
Loadfont be installed in low memory (below any applications
programs). The recommended way to do this is to put Loadfont in
your 'autoexec.bat' file. In this way you will always have
Loadfont available for use.

6.2 Using Loadfont interactively

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 10


Once installed, Loadfont monitors the keyboard interrupt (16h) for
it's activation signal - shift-shift (i.e. the simultaneous
depressing of both shift keys). When it detects this condition,
the Loadfont main menu "pops up" in the center of the screen.

-------------------------------------------------
| Loadfont (2.20) |
| (c) 1986, Duke University |
| |
| 24 lines IBM font 43 lines IBM font |
| Load font block Use font block |
| |
| Use arrow keys and Enter to make selection |
-------------------------------------------------

There are four choices on this main menu. The arrow keys move the
highlight cursor between selections. Enter always makes a
selection. Escape always backs out.

The first selection, "24 lines IBM font", essentially returns the
EGA to its initial state - 24 lines and the ROM based 8 x 14
character set.

The second choice, "43 lines IBM font", sets up the 43 line mode
with ROM based 8 x 8 characters. Note that DOS does not support
43 lines, but a number of commercial application programs
(including PC-Write) do. The 43 line mode practically doubles the
amount of text on the screen, and is a real convenience in some
circumstances.

Choices three and four ("Load font block" and "Use font block")
manipulate the character generator in the Enhanced Graphics
Adapter - the portion of memory that holds the pixel images of
different characters. The EGA divides its character generator
into a maximum of four blocks of memory (one block per 64K of
installed video memory). At power-up, block zero contains the ROM
8 x 14 font, and is the currently selected font block. With
Loadfont you can put new fonts into blocks and/or activate
different font blocks. The rule of thumb is this: first you load
the font (selection 3), then you use it (selection 4).

When you load a font block (selection 3), Loadfont presents a menu
of the blocks available, and the file (if any) currently loaded in
each. The arrow keys move between blocks, the Enter key selects a
block, and the Escape key backs out. When you select a block, the
name of the file in that block is highlighted, and you will type
in the name of the new file (including disk and subdirectory if
appropriate) containing the font to be loaded. While typing, the
cursor keys allow some basic editing: right and left arrows move
the cursor forward and backward; Home and End move to the
beginning and end of the line; delete deletes a character; insert
inserts a blank; up arrow restores the previous name of the file;
down arrow blanks the entire field; and, of course, Esc backs out
leaving everything unchanged. Enter will load the font into the
EGA.

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 11


If Loadfont cannot load the font you requested, it will reset the
EGA back to the 24 line ROM font, and place an error message on
the bottom line of the main menu. This message includes a brief
description of the problem, and the DOS error number.

If your Enhanced Graphics Adapter contains the Graphics Memory
Expansion Card, it is possible to load two or more font blocks,
switch between them, and even configure the EGA for a font of 512
characters (more information about this in the section "About the
Enhanced Graphics Adapter"). With this added memory, selection
four allows the user to modify the EGA fonts.

Selecting choice 4 ("Use font block") brings up a screen that asks
whether the font will be 256 characters or 512 characters. If you
select 256, you will see the block menu, with the names of the
fonts in each block displayed. The cursor keys move between
blocks, the Enter key makes a block active, and the Escape key
backs out without making any changes.

A 512 character font is actually two 256 character fonts accessed
simultaneously. If you use a 512 character font, Loadfont will
prompt you to select two blocks - first the primary font (the font
that appears when the intensity attribute is off), then the
secondary font (the font that appears when the intensity attribute
is on). For further information on how the EGA handles 512
character fonts see the section on "About the Enhanced Graphics
Adapter."

Note that Loadfont, when first installed, checks to see how much
video memory is on the Enhanced Graphics Adapter, and will not
allow the user to manipulate font blocks for which the EGA lacks
memory. On the basic EGA (with 64K RAM), the user is only
presented one font block in the "Load" and "Use" functions, but it
is still necessary to select that sole block by hitting the Enter
key!

Finally, it is helpful to remember that whenever the main Loadfont
menu comes up, the cursor starts off on the 24 line ROM font
selection (the "reset" if you will). If a user manages to "bomb"
the display with characters that appear as garbage (or with no
characters at all), hitting the Enter key will almost always bring
back a reasonable display.

6.3 Controlling Loadfont from DOS

With Loadfont one may also control the Enhanced Graphics Adapter
from the command line. This will bypass the menus, and allows
sophisticated loading and using of fonts to be handled in batch
programs.

The key to understanding Loadfont's batch mode is this: Loadfont
interprets the command line just as it would a series of actions
entered from the menus.

Loadfont command line instructions always begin with the slash

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 12

('/'). The following are the legal instructions:

/0font.ega Loads "font.ega" into block 0
/1font.ega Loads "font.ega" into block 1
/2font.ega Loads "font.ega" into block 2
/3font.ega Loads "font.ega" into block 3

/p# Makes block # the primary font
(or sets a 256 character font
if no secondary font is speci-
ied)
/s# Makes block # the secondary
font

/43 Sets 43 line mode
/r Sets 24 line mode ("R"eset)

Examples of valid command lines are:

A>loadfont /43
A>loadfont /p1
A>loadfont /0greek.ega /1hebrew.ega /p0 /s1
A>loadfont /r

The first line sets the 43 line mode. The second sets up a 256
character font from font block 1. The third loads the font
"greek.ega" into block 0, font "hebrew.ega" into block 1, and
selects a 512 character font in which block 0 is the primary and
block 1 is the secondary font. The last line performs a "reset" -
i.e. it returns the EGA to 24 lines with the IBM ROM font active.

As shown by the third example above, up to 10 different
instructions can be included on the command line and Loadfont will
process each in sequential order. Note that Loadfont traps and
reports most illegal commands, and that commands which fail (e.g.
attempting to load files that do not exist) will cause Loadfont to
respond with an error message.

Note that Loadfont is only installed in memory once (the first
time it is run). Subsequent runs of Loadfont will process the
command line options, but will not tie up additional system
memory.

6.4 Modifying Loadfont (Lfmod)

Given the increasing number of memory resident utilities, there is
the possibility for conflict between Loadfont and other "popped
up" programs. Thus the program Lfmod allows the user to change
the keyboard signal which will activate Loadfont.

The syntax for Lfmod is as follows:

A>lfmod loadfont.exe number

where "loadfont.exe" is the name of the Loadfont program, may also
contain disk and subdirectory if appropriate. "Number" is computed

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 13

from the table below by adding together the numbers associated
with the desired keys.

Loadfont Activation Signals

Alt = 8 Ctrl = 4 L Shift = 2 R Shift = 1
Ins = 128 Caps lock = 64 Num lock = 32 Scroll lock = 16


Thus if Ctrl - Alt is to be the activation signal, the Lfmod
number would be 12 (8 + 4). If L Shift - Alt - Num lock is the
signal, the number would be 42 (8 + 2 + 32). The default number
for Loadfont (L Shift - R Shift) is 3.


7. PC-Write

PC-Write is Bob Wallace's "shareware" word processor. We at Duke
have found version 2.5 exceptionally well suited for foreign
alphabet text processing because it allows for easy redefinition
of the entire keyboard for the custom font, and it provides a
fairly sophisticated "accent" for generating diacritics and
accents.

Those who have received two diskettes from Duke University will
generally find PC-Write on the second diskette. The file
"READ.ME" on that diskette will give directions for getting
started with PC-Write. Those who did not receive a copy of the
PC-Write distribution diskette from Duke can obtain it by sending
$10 to Bob Wallace, Quicksoft, 219 First N., Seattle, WA 98109, or
by sending us a blank diskette with a stamped, addressed mailer.

PC-Write is distributed as "shareware." Bob Wallace generously
allows it to be distributed free of charge, but he (and we)
strongly encourage users to register their copy ($75) to support
the continued development of the product, and to receive updates,
telephone support, and source code.

The features of PC-Write which are particularly useful in foreign
language word processing are the use of the "accent key" and the
redefinition of the keyboard via the Ruler file. In the PC-Write
manual (version 2.5) the discussion of the accent key occurs on
page 39a. The "Ruler" file is documented in "Appendix A" (pp. 80-
93). The discussion below will assume your familiarity with this
information.

7.1 Using PC-Write

With PC-Write, one can begin foreign language word processing
immediately. The binding of the keyboard to characters is handled
in "ruler" files. Several of these have been included on the Duke
Language Toolkit distribution diskette (e.g. "ruler.grk",
"ruler.heb", etc.).

Function key 2 controls "ruler" files. Alt - F2 will list the
"ruler" file currently used (the default is generally

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 14

"ruler.def"), and allows the user to type in the name of a
different "ruler" file. Thus to shift from an English keyboard to
a Greek keyboard the sequence would be: 1) Alt - F2; 2) type
"ruler.grk"; 3) hit the Enter key.

Note that once the keyboard has been shifted into the foreign
language, one cannot get back to English by typing Alt - F2 (the
name "ruler.def" would be transmuted into the foreign characters).
Thus we generally add a line in each "ruler" file that allows
Shift -F2 to automatically return to the English keyboard. For
more information on this consult the PC-Write manual, pp. 81-82,
or look at the "ruler.grk" file included on this diskette.

7.2 Using the page printer (Pr)

Section 6 ("FNT2EGA, FNT2TOS, FNT2PRO") mentioned that Loadfont
does not provide printer support. Thus there generally must be a
filtering program to take foreign characters and send them to the
printer with the appropriate escape sequences. The PC-Write page
printer ("pr.exe") is one such program. Printer files (which end
in the extension ".prt") allow Pr to interpret characters in a
text to the printer.

A discussion of 'prt' files is included in the PC-Write manual,
pp. 87-87a. Included on this diskette are two examples of 'prt'
files, "toshiba.prt" and "greek.prt". The former allows many of
IBM's extended characters to be printed. The latter traps Greek
characters (as defined in "Greek.ega") and interprets them to a
Toshiba P351 printer in which "Greek.tos" (from "Tosgrk.fnt") has
been installed.

Please note the special name "ruler.prt". The significance of
this file is detailed in the PC-Write manual p. 70a.

7.3 The accent key and "Patch.ed"

PC-Write uses the backquote key (`) as an accent key. This is the
reverse of a "dead" key in that the accent key follows the letter
to be accented (the "dead" key precedes it).

With the accent key rather sophisticated keyboards can be
constructed. We at Duke have implemented a Greek version of PC-
Write with full support for the diacritical marks, a Coptic
keyboard with automatic strokes over letters when necessary, and
even an Amharic keyboard within which characters can be
automatically modified when their vocalization (vowel) is entered.

Unfortunately the assignments for the accent key are "hardwired"
into the source code of PC-Write, and we at Duke are not
authorized to distribute such modified versions of PC-Write. One
may acquire source code for PC-Write by completing the PC-Write
registration form on this diskette and sending $75 to Quicksoft,
its owners. We will gladly pass on the modifications we have made
to the PC-Write source code, but cannot, obviously, distribute the
source code itself. Please contact Duke if you have further
questions.

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 15


Included on this diskette is a file called "patch.ed", which
contains information which can be patched into "ed.exe" to
reassign some of the accent key bindings. This patch may be made
using the "debug.com" or "symdeb.com" debugging tools. The
following script demonstrates the procedure. Following it will be
an explanation (line numbers are for reference only - do not
include them).

A> copy ed.exe edg 1
A> debug edg 2

- npatch.ed 3
- lc844 4
- nedg 5
- rcx 6
: cd20 7
- w 8
Writing CD20 bytes 9
- q 10

A> rename edg edg.exe 11

The first line makes a copy of PC-Write named 'EDG' (you will most
certainly not want to modify the original copy of the program).
Line 2 invokes the debugging tool ('DEBUG.COM') on the newly
created file.

The lines beginning with a dash occur within DEBUG. Lines 3 and 4
load 'PATCH.ED' at the location in PC-Write that defines the
activity of the accent key. Lines 5, 6 and 7 reset the name and
size of PC-Write. Line 8 writes the file ('EDG') out to disk, and
line 10 leaves DEBUG.

Finally, line 11 renames the file to an executable type. Although
the name 'EDG.EXE' seems reasonable (for ED Greek), another name
may be substituted if desired.

The newly patched PC-Write program will now handle the following
combinations:

alpha/eta/omega + ` + , = iota-subscript
any vowel + ` + ' = accent acute
any vowel + ` + ` = accent grave
any vowel + ` + ~ = accent circumflex
any vowel + ` + ( = rough breathing
iota/upsilon + ` + " = dieresis
rho + ` + ( = rough breathing

Note that an iota-subscript needs to be added to a vowel (if
appropriate) before an accent or breathing mark is included.

7.4 43 line mode

PC-Write does support Loadfont's 43 line mode. The PC-Write
manual documents this on p. 86a. One simply puts the following

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 16

line in the "ruler" file

&Y:43


8. About the Enhanced Graphics Adapter

Several good discussions of the Enhanced Graphics Adapter have
recently been published. Among them are:

Wilton, Richard. "Programming the Enhanced
Graphics Adapter." Byte, 10,11 (December
1985): 209-220.

"IBM Personal Computer Seminar Proceedings." May
1985, 2,1-11.

"IBM PC Technical Reference. Options and
Adapters." Reference number 6322509. The
EGA documentation is in the third update to
this manual, and is dated August 2, 1984.

The latter of these is the definitive reference, documenting the
hardware registers, and listing the EGA bios routines.

The context for this discussion of the Enhanced Graphics Adapter
is the operation of Loadfont as it loads font blocks and
manipulates them. Thus we will concentrate on the use of the EGA
in text mode, and largely ignore its various graphics features.

8.1 The EGA in text mode

Video memory in the EGA is divided into four banks, or "bit
planes" (called plane 0, 1, 2, and 3 respectively). The basic
configuration (64K memory) allows 16K in each plane. With more
memory, however, the size of the planes expands.

In text mode the first three planes function as follows: plane 0
contains the numeric codes (ASCII) of the characters on the
screen. Plane 1 contains the attributes (high intensity,
blinking, etc). Plane 2 contains the pixel images for all
possible characters (the character generator). In text mode, EGA
hardware handles both plane 0 and plane 1 in a single segment, and
hides plane 2 entirely.

With 16K memory in bit plane 2 (i.e. the basic EGA) there is just
enough room to store pixel images for 256 characters. When that
memory is expanded with the Graphics Memory Expansion Card,
further increments of 256 are added. These increments, or font
"blocks" are treated as distinct fonts, and are known as blocks 0,
1, 2 and 3. At any given time one of these blocks may be active.
When the active block is switched one sees the screen quickly
transform, as the patterns of pixels associated with various
characters change.

Loadfont allows one to load pixel images into the various font

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 17

blocks, and to change the active block at will. In this way
character values that are bound to symbols, like the happy face or
the right arrow in the IBM standard font, can be re-bound to
symbols representing Greek or Russian or Amharic characters. In
the computer's video memory (bit planes) these characters are
still represented by the same numeric values, but the
presentation of those values by the hardware (EGA) is changed.

8.2 512 character fonts

The statement that only one font block can be active at a time is
actually not, strictly speaking, true. In fact it would be more
accurate to say that the EGA always has two active blocks. This
is how fonts of 512 characters can be displayed.

In the EGA, as in other IBM display adapters, one bit in the
attribute byte associated with each character on the screen
defines whether the character should be displayed in high or low
intensity. Unlike other IBM adapters, though, this intensity bit
serves double duty on the EGA. When the intensity bit is '0' (low
intensity), the pixel pattern for the character will come from the
primary font block. When the intensity bit is '1' (high
intensity) the pattern will be taken from the secondary font
block. The situation becomes a bit more complex, because Loadfont
disables the intensity function when a 512 character set is
selected. This leads to the following situation:

The intensity function in a 256 character font becomes
the primary font / secondary font function in a 512
character font. Conversely, in a 512 character font
all characters are displayed in the same intensity.

The possibility of 512 different characters available together is
very important for languages with many different symbols (e.g.
vocalized Hebrew or Arabic, or Amharic). There is, however, one
significant difficulty. Many applications programs use high
intensity to organize the screen, to display important infor-
mation, or for aesthetic purposes, particularly when run on a
monochrome monitor. When a 512 character font is selected, the
text that usually appears in high intensity will now appear in the
secondary font. In many cases this may be merely an annoyance.
In some programs, however, the garbling of information may make
the software unusable. The designer of 512 character fonts should
exercise some thought to minimize the possible confusion and/or
annoyances.


9. 'FNT' Files

The Fed font editor is the first fruits of a project at Duke
called the Raster Graphics Library. Raster graphics (sometimes
called "bitmapped graphics") is an approach to the display of
information used on many graphics oriented computers, like the
Macintosh and the Sun. The Enhanced Graphics Adapter provides
some basic support for raster graphics, and we hope to make
extensive use of this capability in future versions of the Duke

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 18

Language Toolkit.

The arrangement of information (i.e. the data structures) in a
raster graphics display are quite different from those used by
character or text oriented devices (e.g. the EGA in text mode).
To make Fed files more accessible to programmers, this section
will document the structure of 'fnt' files.

This discussion will not be a tutorial on raster graphics. A
number of good discussions of this are commonly accessible. Among
them are:

"SoftTalk-80: The Language and Its Implementa-
tion", pp. 355-361

9.1 Bitmaps and Font Records

One may conceptualize a bitmap as a piece of graph paper, where
each individual cell (bit) can be on (1) or off (0). Fed places
an entire font on one such bitmap. The width of the bitmap is the
number of pixels (bits) from the first column of the first
character to the last column of the last character (padded to end
on an even multiple of 8). The height is the number of rows
necessary to display all characters.

--------------------------------------
|....................................|
|[email protected]@[email protected]@@[email protected]@[email protected]@@[email protected]@@@[email protected]@@@.|
|[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@....|
|[email protected]@@@[email protected]@@[email protected]@[email protected]@@@[email protected]@...|
|[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@....|
|[email protected]@[email protected]@@[email protected]@[email protected]@@[email protected]@@@[email protected]|
|....................................|
--------------------------------------
A sample bitmap
'@' = 1, '.' = 0

A font record is a data structure that contains the interpretation
of a bitmap containing a font. It records the height of the font
(the number of ascending and descending characters) and the width
of each character. In addition, the font record contains a table
containing the offset of each character within the bitmap. [In the
example above the 'A' would start at offset (column) 1, the 'B' at
offset 7, the 'C' at offset 13, etc.]

The relevant data structures are expressed in C as follows:

/* A Point is a particular bit within a bitmap. The actual
* coordinates are contained in x and y.
*/
typedef struct {
int x,y;
} Point;

/* A Rect is the rectangle defined by an original top left
* Point (org) and a given distance along the x and y axes

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 19

* (size). Note that the lower right corner of the Rect will
* be (R.org.x + R.size.x, R.org.y + R.size.y).
*/
typedef struct {
Point org, size;
} Rect;

/* A bitmap contains the size of the map - size.x is the width
* (in bits), size.y is the height. "bits" is a pointer to
* some block of memory that actually contains the bit image.
*/
typedef struct {
Point size;
unsigned char *bits;
} Bitmap;

/* The FONTDET table holds the vital statistics about the
* font. Explanations of each entry are included. Note that
* offset, width, and bytelen are pointers to tables, not the
* actual tables themselves.
*/
typedef struct {
unsigned char fonttype; /* font type: prop or fixed */
short firstchar; /* ascii for firstchar */
short lastchar; /* code for lastchar */
unsigned char maxwidth; /* max char width */
int frectwidth; /* font rectangle width (bytes)*/
unsigned char maxkern; /* max char kern */
unsigned char chheight; /* character height */
unsigned char ascent; /* ascent */
unsigned char descent; /* descent */
unsigned char leading; /* leading lines (between rows)*/
char *offset; /* offset table (kern) */
char *width; /* width table */
char *bytelen; /* bytelength of each char */
} FONTDET;

/* The FONTRECord is the master data structure. It contains
* the associated FONTDET and pointers to the bit image and
* offset table.
*/
typedef struct {
FONTDET fontid;
char *bitimage; /* bit image of characters */
int *loctable; /* offset of each character */
} FONTREC;

/* Some useful constants */
#define FIXED 1
#define PROP 0
#define MISSING -1

Note that many nifty features are present in the Fontrec which are
not yet supported by Fed.

9.2 Anatomy of the 'fnt' file

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 20


The first 35 bytes of a 'fnt' file ------------------
contain the Fontrec. After that comes | Fontrec |
the offset (kern) table, the width |----------------|
table, the loctable, and the bitimage. | offset table |
| |
In program memory, offset, width, |----------------|
loctable, and bitimage contain the | width table |
segment and offset of the first byte | |
of the appropriate table. In a 'fnt' |----------------|
file, however, these point to the | loctable |
offset within the file where the table | |
begins. |----------------|
| bitimage |
In loading a 'fnt' file into program | |
memory, one should follow three steps: | |
1) read the Fontrec entirely; 2) | |
allocate memory and read in the | |
offset, width, and loctables, and the ------------------
bitimage, moving the file's read A sample 'fnt' file
pointer according to the information
in the Fontrec; and 3) reset the
Fontrec pointers to the proper segment
and offsets in memory.



10. Programming with Loadfont

It was mentioned in section 6 that Loadfont supports an interrupt
driven mode by which applications programs (written in assembler
or high level langauges like C and Pascal) can access the EGA
functions directly without user intervention. This section will
detail the procedure for doing this.

Since Loadfont monitors the standard video interrupt (10h), it is
possible for an applications program to control the actions of
Loadfont by simple calls to interrupt 10h. In this manner a
program can load and use a font, or switch between fonts, without
requiring any intervention by the user.

Note that this discussion presumes assembly language programming.
Many high-level programming languages also contain functions for
invoking interrupt procedures. Please consult your language's
manual for instructions regarding this. The documentation that
follows is in the style used by the DOS Technical Reference and
the IBM Technical Reference manuals.

The Enhanced Graphics Adapter contains bios level support for
several useful functions. The one which will be mentioned here is
the request for information regarding the configuration of the
EGA. This is particularly helpful for programs which need to know
how much video memory is on the EGA card. The parameters for this
function are:

EGA Configuration Information

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 21

On entry:
AH - 12h
BL - 10h
On return:
BH - mode in effect (0 = color, 1 = monochrome)
BL - video memory (0 = 64K, 1 = 128K, 2 = 192K, 3 = 256K)
CH - feature bits (feature connector on EGA card)
CL - switch setting (dip switch on EGA card)

The Loadfont calls are as follows:

Loadfont Status Check
On entry:
AH = F0h
On return:
AX = status (1 if loaded, anything else if not)

24 Line ROM Font
On entry:
AH = F1h
On return:
AX = return code (1 if successful, 0 if not)

43 Line ROM Font
On entry:
AH = F2h
On return:
AX = return code (1 if successful, 0 if not)

Load Font Block
On entry:
AH = F3h
BL = Block to load (0, 1, 2, 3)
DS:DX = pointer to ASCIIZ (terminated by null byte) name of
file containing EGA font - including disk and
subdirectory if appropriate.
On return:
AX = return code (1 if successful, 0 if not)
On error (AX=0) the BX register will contain information
about the error:
BH = where error occurred (1 - open, 2 - read, 3 - close)
BL = DOS error number

Use Font Block
On entry:
AH = F4h
BH = Primary font block (0, 1, 2, 3)
BL = Secondary font block (0, 1, 2, 3)
Note that a 256 character font is selected by setting BH
and BL to the same block. A 512 character font is set by
setting them to different blocks.
On return:
AX = return code (1 if successful, 0 if not)




Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 22

11. Using the Duke Language Toolkit

This section includes brief mention of two sample data files
included with the Toolkit, and some of the commercially available
software compatible with the Language Toolkit.

11.1 Sample text using the Language Toolkit

'Matthew.grk' contains the first two chapters of the Gospel of
Matthew in Greek, and can be read when the "greek.ega" font has
been loaded into the EGA with Loadfont. Using the 'Greek.ega',
the majority of accents and other diacritical marks are included
in this text. The document is, in fact, the first portion of a
larger text, the four Gospels, which has been prepared for use
with the Brigham Young concordance program. This brings us to the
next subject:

11.2 Using the Language Toolkit with other software

The Duke Language Toolkit appears to be compatible with many of
the application programs commonly used in academic circles. We
have had good success with PC-Write and Word Perfect (although
entering non-English text in Word Perfect appears a bit awkward at
times). The Nota Bene word processor is a spectacular success,
and now offers an extended 512 character font capability based on
the Duke Language Toolkit. The only word processors that present
difficulty are those that do not support the full 256 characters
available to the IBM PC. WordStar is the most popular example of
a word processor that does not work with the Toolkit.

The Brigham Young University concordance program has performed
superbly through its ability to edit a custom sort table. By
changing the order in which letters are sorted, the BYU
Concordance produces word lists in proper Greek order; vowels with
diacritical marks are assimilated to their proper location. Using
Newkey, a "shareware" utility that redefines the keyboard, we are
able to provide both English and Greek input to the BYU
Concordance.

In conjunction with PC-Write and the BYU concordance, we have had
excellent luck taking Greek data from tapes used by mainframe
computers, massaging and downloading it to the microcomputer, and
translating it into Greek characters. Preparing the entire Gospel
of Matthew (about 117 pages in the Greek text - 110K storage in
final form) took us roughly 2 hours, 1/2 hour of which involved
direct human intervention (mostly in the word processor). The
rest of the time was spend downloading the file from the mainframe
computer and running a short translation program. With the advent
of mass storage devices for the microcomputer (e.g. Iomega's
Bernoulli Box), we anticipate in the immediate future the common
availability of texts and resources on the IBM PC, hitherto
accessible only through expensive dedicated mini computer systems.

We have not found a commercial program which runs on the
monochrome monitor that is wholly incompatible with the Duke
Language Toolkit. Programming languages (such as Pascal, Basic,

Copyright 1986, Duke University
Duke Language Toolkit (2.20) - 23

and C), communications programs (such as Kermit), data bases and
spreadsheets (e.g. a Coptic version of Lotus!) all have been made
to work with the Toolkit. The rest is up to your imagination and
programming ability!


The Duke Language Toolkit has had a significant impact on the
computer assisted study of foreign languages and texts at Duke
University. It is our hope that the Toolkit will prove helpful
for research at many other institutions across the world.

We are very interested in comments, reports of bugs, further
questions, and critical evaluation of the Langauge Toolkit.
Please feel free to contact the Language Toolkit at the following
address.


Jeffrey William Gillette
The Divinity School
Duke University
Durham, NC 27706

bitnet: [email protected]
uucp: ...!duke!phys!lisa

































Copyright 1986, Duke University
L08


 December 13, 2017  Add comments

Leave a Reply