🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #19879

Re: Help wanted: 'TEXT' definition

#19879
From: David Phillip Oster
Date: Tue, 06 Oct 1987 15:27
47 lines
2867 bytes
In article <3320029@hpcid.HP.COM> tedj@hpcid.HP.COM (Ted Johnson) writes:
>Can anyone tell me where the format for 'TEXT' files is defined/described?
>It doesn't seem to be in Inside Macintosh...

This is a complex issue. See my upcoming posting 'How to write a TEXT editor,
part 2'. Until I post it, the next best source is Tech Note #84, the Edit
file format. Here are the high points of that document:

1.) The data fork holds Apple extended Ascii data, with the <CR> character
representing hard carriage return (i.e. paragraph separator in programs that
wrap (like MacWrite) line separator in programming language editors.)

2.) The files type field is TEXT (use GetFinderInfo() to see its type field.)

The following are optional. The file may have no resource fork, or, if it has
a resource fork, it may have the following two resources:

3.) the resource of type 'EFNT' id=1003, is of the form
struct {
  short size;
  Str255 fontName
};
where fontname is as long as it needs to be. There is a terminal null byte,
if necessary, to keep the total size of the resource even. This resource
describes what font and size the file will be displayed in.

4.) the resource of type 'ETAB' id=1004 of the form:
struct {
  short width;
  short count;
}
assert that a tab is has the value of 'count' spaces and a space, for the
purposes of tab expansion, is 'width' wide. Many Mac text editors do not
support tabs as equivalences for spaces, although most programming language
editors do.

My upcoming posting will detail a proposed extension to this standard
to support a multi-color, multi-tasking, multi-font, multi-script (i.e
Japanese, Arabic, and other non-Roman alphabets),
multi-finder-compatible, backward-compatible version of a text file,
that I hope other Mac programmers will adopt, so that we can preserve
the current inter-operability between editors, yet make them more in
tune with the Mac's power and more in tune with the Mac's future.

--- David Phillip Oster            --A Sun 3/60 makes a poor Macintosh II.
Arpa: oster@dewey.soe.berkeley.edu --A Macintosh II makes a poor Sun 3/60.
Uucp: {uwvax,decvax,ihnp4}!ucbvax!oster%dewey.soe.berkeley.edu
Technical Details
Message-ID: <21164@ucbvax.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!genrad!decvax!ucbvax!dewey.soe.berkeley.edu!oster
References: <3320029@hpcid.HP.COM>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!mit-eddie!genrad!decvax!ucbvax!dewey.soe.berkeley.edu!oster
From: oster@dewey.soe.berkeley.edu (David Phillip Oster)
Newsgroups: comp.sys.mac
Subject: Re: Help wanted: 'TEXT' definition
Message-ID: <21164@ucbvax.BERKELEY.EDU>
Date: Tue, 6-Oct-87 11:27:42 EDT
Article-I.D.: ucbvax.21164
Posted: Tue Oct  6 11:27:42 1987
Date-Received: Fri, 9-Oct-87 06:22:21 EDT
References: <3320029@hpcid.HP.COM>
Sender: usenet@ucbvax.BERKELEY.EDU
Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster)
Organization: School of Education, UC-Berkeley
Lines: 47