
   This is an exercise in creating a simple, easily standardized 
alternative to commonly used file formats. It covers the kind of things 
you'd see in print material. It's part of a larger exercise to redesign 
the internet..



                     LINKS, REFERENCES AND INCLUDES

A REFERENCE is like a web link. It's for separate files that a reader 
might want to look at, including formats not covered here, such as 
programs, sound and video.

A LINK is for subdocuments. Someone wanting to copy the whole set of 
documents would grab all these, but not references.

An INCLUDED subdocument is shown within with the referencing document 
when viewing. This is to avoid redundancy.


                              TEXT FORMAT

Something to take the place of HTML and RTF.. simpler and not so ugly.
Use control characters (0-31) for formatting (similar to old printer 
codes) to avoid the need for escape codes as in HTML and RTF. Paragraphs 
follow the modern convention: one long line of text followed by a line 
break, word-wrapped by the viewer/editor.

 1              push state (font, encoding, bold, italics..)
 2              pop state
 3              reset state (standard font, ascii encoding, no indent)
 5              block (keep together)
 9      TAB     indent
10      LF      line break

Other functions..
        font (0-terminated string)
        encoding (ascii, cp437, latin1...) (0-terminated string)
        include subdocument (text, bitmap, vector, etc.)
        link subdocument
        reference another document
        tables? (these are problematic in HTML)


                            RASTER GRAPHICS

Use PNG for lossless image compression. These look best when shown at 
the original resolution or scaled by an integral number.

Use JPEG for lossy compression, especially photos.


                            VECTOR GRAPHICS

For sparse 2- and 3-dimensional graphics AND other documents where it's 
important to preserve spatial relationships. To be used in place of 
Postscript, PDF, WMF, CAD drawings, etc.

Encoded as a series of blocks like this:
        Header: Size (minus header)
                Function code
        Data (optional)

Functions:
        setup coordinate space
        set color
        position cursor
        push/pop state
        drawing (line, circle, box, spline, polygon, etc.)
        include (vector, bitmap, or text document - specify size)
        font/encoding?
        text, as an inline text document?

