home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
utilities
/
utilsf
/
ifftext
/
FTXT
< prev
next >
Wrap
Text File
|
1993-06-24
|
21KB
|
474 lines
"FTXT" IFF Formatted Text
Date: November 15, 1985
From: Steve Shaw and Jerry Morrison, Electronic Arts and
Bob "Kodiak" Burns, Commodore-Amiga
Status: Draft 2.6
DRAFT DRAFT DRAFT
DRAFT DRAFT DRAFT
1. Introduction
This memo is the IFF supplement for FORM FTXT. An FTXT is an IFF "data
section" or "FORM type" which can be an IFF file or a part of one containing
a stream of text plus optional formatting information."EA IFF 85"
is Electronic Arts' standard for interchange format files. (See the
IFF reference.)
An FTXT is an archival and interchange representation designed for
three uses. The simplest use is for a "console device" or "glass teletype"
(the minimal 2-D text layout means): a stream of "graphic" ("printable")
characters plus positioning characters "space" ("SP") and line terminator
("LF"). This is not intended for cursor movements on a screen although
it does not conflict with standard cursor-moving characters. The second
use is text that has explicit formatting information (or "looks")
such as font family and size, typeface, etc. The third use is as the
lowest layer of a structured document that also has "inherited" styles
to implicitly control character looks. For that use, FORMs FTXT would
be embedded within a future document FORM type. The beauty of FTXT
is that these three uses are interchangeable, that is, a program written
for one purpose can read and write the others' files. So a word processor
does not have to write a separate plain text file to communicate with
other programs.
Text is stored in one or more "CHRS" chunks inside an FTXT. Each CHRS
contains a stream of 8-bit text compatible with ISO and ANSI data
interchange standards. FTXT uses just the central character set from
the ISO/ANSI standards. (These two standards are henceforth called
"ISO/ANSI" as in "see the ISO/ANSI reference".)
Since it's possible to extract just the text portions from future
document FORM types, programs can exchange data without having to
save both plain text and formatted text representations.
Character looks are stored as embedded control sequences within CHRS
chunks. This document specifies which class of control sequences to
use: the CSI group. This document does not yet specify their meanings,
e.g. which one means "turn on italic face". Consult ISO/ANSI.
Section 2 defines the chunk types character stream "CHRS" and font
specifier "FONS". These are the "standard" chunks. Specialized chunks
for private or future needs can be added later. Section 3 outlines
an FTXT reader program that strips a document down to plain unformatted
text. Appendix A is a code table for the 8-bit ISO/ANSI character
set used here. Appendix B is an example FTXT shown as a box diagram.
Appendix C is a racetrack diagram of the syntax of ISO/ANSI control
sequences.
Reference:
Amiga[tm] is a trademark of Commodore-Amiga, Inc.
Electronic Arts[tm] is a trademark of Electronic Arts.
IFF: "EA IFF 85" Standard for Interchange Format Files describes the
underlying conventions for all IFF files.
ISO/ANSI: ISO/DIS 6429.2 and ANSI X3.64-1979. International Organization
for Standardization (ISO) and American National Standards Institute
(ANSI) data-interchange standards. The relevant parts of these two
standards documents are identical. ISO standard 2022 is also relevant.
2. Standard Data and Property Chunks
The main contents of a FORM FTXT is in its character stream "CHRS"
chunks. Formatting property chunks may also appear. The only formatting
property yet defined is "FONS", a font specifier. A FORM FTXT with
no CHRS represents an empty text stream. A FORM FTXT may contain nested
IFF FORMs, LISTs, or CATs, although a "stripping" reader (see section
3) will ignore them.
Character Set
FORM FTXT uses the core of the 8-bit character set defined by the
ISO/ANSI standards cited at the start of this document. (See Appendix
A for a character code table.) This character set is divided into
two "graphic" groups plus two "control" groups. Eight of the control
characters begin ISO/ANSI standard control sequences. (See "Control
Sequences", below.) Most control sequences and control characters
are reserved for future use and for compatibility with ISO/ANSI. Current
reader programs should skip them.
% C0 is the group of control characters in the range NUL (hex
0) through hex 1F. Of these, only LF (hex 0A) and ESC (hex 1B) are
significant. ESC begins a control sequence. LF is the line terminator,
meaning "go to the first horizontal position of the next line". All
other C0 characters are not used. In particular, CR (hex 0D) is not
recognized as a line terminator.
% G0 is the group of graphic characters in the range hex 20 through
hex 7F. SP (hex 20) is the space character. DEL (hex 7F) is the delete
character which is not used. The rest are the standard ASCII printable
characters "!" (hex 21) through "~" (hex 7E).
% C1 is the group of extended control characters in the range
hex 80 through hex 9F. Some of these begin control sequences. The
control sequence starting with CSI (hex 9B) is used for FTXT formatting.
All other control sequences and C1 control characters are unused.
% G1 is the group of extended graphic characters in the range
NBSP (hex A0) through "X" (hex FF). It is one of the alternate graphic
groups proposed for ISO/ANSI standardization.
Control Sequences
Eight of the control characters begin ISO/ANSI standard "control sequences"
(or "escape sequences"). These sequences are described below and diagrammed
in Appendix C.
G0 ::= (SP through DEL)
G1 ::= (NBSP through "X")
ESC-Seq ::= ESC (SP through "/")* ("0" through "~")
ShiftToG2 ::= SS2 G0
ShiftToG3 ::= SS3 G0
CSI-Seq ::= CSI (SP through "?")* ("@" through "~")
DCS-Seq ::= (DCS | OSC | PM | APC) (SP through "~" | G1)* ST
"ESC-Seq" is the control sequence ESC (hex 1B), followed by zero or
more characters in the range SP through "/S (hex 20 through hex 2F),
followed by a character in the range "0" through "~" (hex 30 through
hex 7E). These sequences are reserved for future use and should be
skipped by current FTXT reader programs.
SS2 (hex 8E) and SS3 (hex 8F) shift the single following G0 character
into yet-to-be-defined graphic sets G2 and G3, respectively. These
sequences should not be used until the character sets G2 and G3 are
standardized. A reader may simply skip the SS2 or SS3 (taking the
following character as a corresponding G0 character) or replace the
two-character sequence with a character like "?" to mean "absent".
FTXT uses "CSI-Seq" control sequences to store character formatting
(font selection by number, type face, and text size) and perhaps layout
information (position and rotation). "CSI-Seq" control sequences start
with CSI (the "control sequence introducer", hex 9B). Syntactically,
the sequence includes zero or more characters in the range SP through
"?" (hex 20 through hex 3F) and a concluding character in the range
"@" through "~" (hex 40 through hex 7E). These sequences may be skipped
by a minimal FTXT reader, i.e. one that ignores formatting information.
Note: A future FTXT standardization document will explain the uses
of CSI-Seq sequences for setting character face (light weight vs.
medium vs. bold, italic vs. upright, height, pitch, position, and
rotation). For now, consult the ISO/ANSI references.
"DCS-Seq" is the control sequences starting with DCS (hex 90), OSC
(hex 9D), PM (hex 9E), or APC (hex 9F), followed by zero or more characters
each of which is in the range SP through "~" (hex 20 through hex 7E)
or else a G1 character, and terminated by an ST (hex 9C). These sequences
are reserved for future use and should be skipped by current FTXT
reader programs.
Data Chunk CHRS
A CHRS chunk contains a sequence of 8-bit characters abiding by the
ISO/ANSI standards cited at the start of this document. This includes
the character set and control sequences as described above and summarized
in Appendicies A and C.
A FORM FTXT may contain any number of