Document 6534058

Transcription

Document 6534058
TUGboat, Volume 11 (1990), No. 4
sum(f,n)
/*
sample
-
9
sum(f,n) This procedure computes and returns
mous ftp to u.washington. edu. They are in the
directory pub/tex/cnoweb. Anyone without access
to ftp may request the files by mail to me at the
address below.
o Jim Fox
University of Washington
foxQcac.washington.edu
n
sum =
C f (i)
There is no error checking in this example.
double sum(f ,n)
double (*f) ( ) ;
int n;
*/
/* function to call */
/* summation limit */
C
A
int i;
double s = 0 ;
Previewer for "Slow" Terminals
Harold T . Stokes
In our department, we have a multi-user computer
for (i=O; i<=n; i++)
s += f (i) ;
C
1
return ( s ) ;
1
Figure 3: sum from the listing of samp1e.c
Other than this the program need not contain
any
text. Most programs, however, will use
plain
commands in comments. as well as several new commands provided by c-web. These are
described in Figure 1.
Figure 2 is a sample procedure, sum, from a
program in c-web format. Figure 3 is the listing of
the procedure. Not shown in figure 3 is the title
page, which includes the title, synopsis (none in this
example), and table of contents.
Features of c - 4 , some of which are demonstrated in the example, include:
1. Page breaks occur only before comments.
2. The code portion is printed not quite
verbatim-indentation
is automatically provided. Lines following an opening bracket or
parenthesis are indented until the line containing the closing bracket or indentation.
3. The page heading contains the c file name, the
page number, and the current section name.
4. Alignment rules on the top and left help verify
indentation.
cluster with one copy of
and one laser printer.
Our previewer sends document pages to the user's
terminal in the Tektronix 4010/4014 graphics format. Most graphics terminals can emulate the
Tektronix 4010/4014. This includes PCs using a
terminal emulator like MSKermit.
The terminals in our department are connected
to the system through a data switch. The rate at
which data can be sent to a terminal is limited t o
9600 baud (1200 bytes/second). This is rather slow
for displaying graphics.
As an example, consider how we might draw
the character T on the screen. The individual pixels
for this character (from the cmrl0 font) are shown
in Fig. l a . Since Tektronix 4010/4014 graphics
is vector-oriented, we might try the obvious raster
scan shown in Fig. lb. However, there are 44 line
segments in that raster scan. To draw a single line
segment in Tektronix 4010/4014 graphics, at least
seven bytes must be sent to the terminal (sometimes
eight or nine). At 9600 baud, it would require at
least 0.25 seconds to display this single character.
An entire document page which may contain 3000
characters would require more than ten minutes to
be displayed. This, of course, is unacceptable for a
previewer.
(a)
(b)
(c)
Trying it out
A sample program (pf . c) demonstrates c - 4 and
describes the commands in more detail. Interested persons should obtain a copy of the macro file
(cnoweb.tex) and the sample program by anony-
Fig. 1. The character T from cmri0: ( a ) pixels,
( b ) raster scan, (c) stick figure.
TUGboat, Volume 11 (1990)) No. 4
We solved this problem by designing a new set
of fonts. We call them "stick-figure" fonts. The
T is displayed as two line segments (Fig. lc). In
Fig. 2 we show a sample of some text, including a
displayed equation. (The actual clarity will depend
on the resolution of the graphics screen used.)
Using the stick-figure font, a page containing 3000
characters can usually be displayed on the screen in
less than a minute. Some users have even used this
previewer from home over a modem.
Philology
Report on Multilingual Activities
Michael J. Ferguson
We now have an Extended
Font Encoding
which should be officially approved by TUG and
available on the archives by the time you read this
report. This new standard is the first step in
(1) Subduction condition. The irrep D of Go exploiting the enhanced capabilities of
3.0 in a
must subduce into the indentity irrep of G, that is,
multilingual environment. The use of this standard
will enable the direct use of accented characters,
hyphenation, and will create. for the first time, a
consistent interface to all text fonts in T)jx systems.
The new standard is intended to be used for all
where i(G) is the subduction frequency, and ~ ( g ) of m ' s text fonts. This means that accessing
is the character of D for the element g of G. The a particular code in any font will produce similar
summation is taken over all elements g of G.
results. To this end, a tt font will have a f f i
sequence of monospaced characters at the same
location as the ffi ligature in the bold roman font.
( 1 ) SuMuction conditron
T h e r r e p 5 o f Gc
It should also serve as the encoding standard for
must s u b d u c e 1 7 t o t h e i n d e i ~ t i t yr r e p o f G,t h a t is,
non-Greek variable names in math mode.
The new standard extends the alphabetic content of I S 0 Latin 1 by including all of the linguistic
characters in I S 0 Latin 2 along with ligatures and
punctuation relevant to these languages. This stanw h e r e r(G) I S t h e s u b d u c t 0 1 7 frecluei?cy, a ~ ? d~ ( g )
dard includes the national characters, without the
I S t h e c h a r a c t e r o f D f o r t h e e e w e i ? s g of G
The
necessity of explicit accenting, for Albanian, Czech,
s u w n a t 1 0 1 - iI S t a k e , ? o v e r a l l e l e m e ~ . l t sg o f G
Danish, Dutch, English, Faeroese, Finnish, French.
German, Hungarian, Icelandic, Irish, Italian, NorFig. 2. Sample
output ( a ) from our laser
wegian, Polish, Portugese, Rumanian, Serbocroatprinter and ( b ) how it appears using our previewer
ian, Slovak. Slovene, Spanish, Swedish and Turkish.
with stick-figure fonts.
It also includes a block of diacritics, so that these
"basic" characters may be extended by use of Q X ' s
Our previewer has one major fault. We cannot
accenting mechanism. This capability should allow
distinguish between some of the different fonts. But
for the extension to other languages, for example
the speed gained more than compensates for this
Lappish, at the possible penalty of not allowing
disadvantage.
hyphenation of words containing these explicitly
Our previewer is written in a portable C
accented characters.
computer language.
The standard also includes some important
o Harold T. Stokes
innovative extensions to increase flexibility of use
Department of Physics and
and enhance lexical semantic consistency.
Astronomy
0 It includes both a "dash"
and an explicit
Brigham Young University
This
capability
allows font
"hyphen
char".
Provo, Utah 84602
designers the option of replacing the "-" with
Phone: (801) 378-2215
an it-,,- without losing the dash. Since the
Bitnet: stokeshQbyuvax
"-" is no longer the hyphen char, it allows
words with explicit dashes, such as INRST~16communicationsto be hyphenated. It also
allows for the Serbocroatian hyphenation rule
which says that a word broken at a "-" should