[net.micro.att] Question about documentation on fonts for PC 7300

michaelb@kepler.UUCP (Michael Brant) (11/11/85)

Below is some information you may find helpful if you are looking for
documentation on fonts, icons, the mouse, and windows on the PC 7300:

The AT&T UNIX PC ISV Detailed Interface Specification supplied to vendors
of software for the PC 7300 has useful information.  Call AT&T Information
Systems and see if you can get ahold of this document.

The 7300 UNIX System V User's Manual is indispensable.  Most of what you
need is in this document, specifically font(4), cfont(1), form(3T), menu(3T),
window(7), track(3T), and tam(3T).  

For now, let me elaborate on fonts for you by quoting from the ISV spec.
This will give you a good idea of how this document might help you.

*** QUOTE ***
Up to eight different character fonts per window can be used on the UNIX
PC at the same time.  A program that wants to use any character set other
than the normal set would first have to define the alternate set on disk
(or select one of the alternate sets supplied), then the program would
have to load the desired set(s) into memory before using them.  If the user
wants to define his own custom font, this can be done by building a file
as described in the font(4) manual page.  The contents of a font file can
be reviewed on the screen by using the cfont(1) command.  This font file
would then be specified at font load time.  The procedure for loading of 
the character set is described in the window(7) manual page, and the loading
is accomplished via an ioctl call with the WIOCLFONT option set.  Each
window can have up to eight fonts loaded at a given time, however, the font
memory is limited to 64K.  This means that if 8 large fonts were defined,
they may not all fit in the font memory at the same time.  The programmer
is responsible for insuring that the fonts to be loaded fit within the 64K
memory limit.

Once the selected fonts are loaded, the programmer has two different methods
for switching from one font to another:

1) If only two fonts are to be used (system font in slot 0, and alternate
   font is slot 1), an ASCII 'shift out' character (hex '0e' or octal '16')
   sent to the window will shift to the alternate font.  An ASCII 'shift in'
   character (hex '0f' or octal '17') sent to the window will cause a shift
   back to the system font.

2) If more than two fonts are to be used, then the second method must be 
   used.  The fonts are loaded into the eight available fonts slots the 
   same as with the first method.  The font that the programmer wants to be
   the active font at a given point in time is then explicitly selected by
   sending a five character escape sequence to the window.  This sequence is 
   composed of an ASCII 'escape', and ascii '[', an ASCII '1', the ascii 
   number representing the font slot to be used (0 to 7), and an ASCII 'm'.
   These escape sequences, as well as the entire range of escape sequences
   that can be used on a window, are shown in the escape(7) manual pages.
   The programmer should be aware that use of these escape sequences instead
   of curses or TAM calls can make the resulting code incompatible with remote
   alpha numeric terminals.

At the conclusion of the use of any font other than the system-supplied font
in slot 0, the programmer should unload the font slots 1 through 7 (0 is 
reserved for the system font and should never be disturbed) to free up the
system resources.  Fonts are automatically unloaded when a process is killed.
However, if the unneeded fonts are not unloaded until a process dies, 
unnecessary memory is tied up.

Fonts supplied with the UNIX PC system are normally found in the directory
/usr/lib/wfont.  Programmers can view these fonts by executing the 'cfont'
command, giving it the pathname of the font file as an argument.
*** END QUOTE ***

I hope this helps.  Good luck.

-- 
Michael Brant, MicroPro International Corporation
UUCP: {ptsfa,hplabs,glacier,lll-crg}!well!micropro!kepler!michaelb
                    {ucbvax, decwrl}!dual!micropro!kepler!michaelb
By phone: 415-499-4181

chaid@talcott.UUCP (install account for chaid) (11/13/85)

In article <353@kepler.UUCP>, michaelb@kepler.UUCP (Michael Brant) writes:
> 
> The 7300 UNIX System V User's Manual is indispensable.  Most of what you
> need is in this document, specifically font(4), cfont(1), form(3T), menu(3T),
> window(7), track(3T), and tam(3T).  
> ...
> If the user
> wants to define his own custom font, this can be done by building a file
> as described in the font(4) manual page.  

I tried to write I program to read a file in the FONT (4) format.  I could
sort out most the spec, but was entirely unable to find where the
minirasters connected to a given character image are.  The struct fntdef
structure has as its last field a "unsigned short ff_raster" with comment
"mionirasters".  Each character (struct fcdef) has a "short fc_mr" with
comment "relative mini-raster pointer".  Nothing there explains
what this pointer is relative to.

I tried everything I could thing of: relative to the ff_raster location,
relative to the beginning of the file, etc. Nothing worked.

Any comments (or a code fragment perhaps) would be graciously appreciated.

							Bob Kaplan

hfavr@mtuxo.UUCP (a.reed) (11/16/85)

To create a new loadable font, use cfont(1) to disassemble one of the
suppiled fonts, create a source file for your font using the output of
cfont(1) as an example, the use cfont(1) to compile your font into the
font(4) format. There is no need to mess with font(4) parameters
directly: this is what cfont(1) is for. I have created several new fonts
this way; they load and work as documented.
						Adam Reed (npois!adam)