ASCII Editor Info: #06 file formats
+---------------------------------+
NOTE: IT IS STRONGLY SUPPOSED TO BACKUP ALL COLORED FILES IN THE ASCIIEDITOR
FORMAT. THIS IS THE ONLY FILETYPE WHICH SAVES ALL ATTRIBUTES AND CAN BE
READ BY THE PROGRAM.
TIP: Therefore the program has a quick save function. With F1/F2 you can
save/load the current grid in a file named 'Current.aeg'. This file
is written direct in the current directory. An existing file is over-
written without inquire.
NAME: |EXTENSION: |COLORS:(Fore/Background) |Color mode
------------------------+-------------+-----------+-------------+------------
Reading: | | | | 1
1. Text | *.txt | no | no | 1
2. ASCII | *.asc | no | no | 1
3. ASCIIEditor grid | *.asg | no | no | 1
4. ASCIIEditor format | *.asf | yes | yes | 3
| | | |
Writing: | | | |
Text,ASCII,AEG,AEF | | | |
5. HTML Plain text | *.htm | no | no | 1
6. HTML Colored (font) | *.htm | yes (RGB) | no | 2
7. HTML Colored table | *.htm | yes (RGB) | yes (RGB) | 3
8. ASCIIEdit Pattern | *.pat | no | no | 1
9. Richedit | *.rtf | yes (4Bit)| no | 4
10 CSV table | *.csv | no | no | 1
11 ANSI | *.ans | yes (4Bit)| yes (4Bit) | 4
12 Other (=Text) | *.* | no | no | 1
SPECIAL : Import (colored font, pre) HTML files (see C.)
[ !!! The special HTML file formates aren't described here. Feel free to
send me a mail for further informations !!! ]
Color mode:
----------
1 := Plain text
2 := Font colored
3 := Font + backgr. colored (RGB)
4 := Font + backgr. colored (4Bit)
You can always save in each of the file formats, but if you are in
a wrong color mode normally only the plain text is saved.
A. GENERAL INFORMATION:
=========================================
1.) Text:
Saving all characters.
2.) ASCII:
Saving all ASCII characters (ord=32...126) and
the needed control codes (ord=10,13)
3.) ASCIIEditor grid:
CSV file with TAB (ord=7) separator. Very fast, but saves only plain text.
4.) ASCIIEditor Format:
The ONLY format which saves all attributes of the grid and which can be
read by ASCII-Editor !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5.) HTML plain text:
Saving text in a "pre" tag as an HTML file
6.) HTML Colored
Saving HTML-art files with font color attributes. (see B.)
7.) HTML colored table
Creates a HTML table with the font and background colors of the grid.
Something for experimenting. VERY large files ! (see B.)
8.) ASCIIEdit Pattern
You could use this files for the filling function. (See: #02 Pattern files)
9.) Richedit
Saves the file with font colors as RTF text. Wordpad or MSWord can read
them. (Warning: Only foreground colors, see /Other/Richedit-Sample.rtf)
10) CSV table
Saving the file as plain text table which can be read by many other programs
(EXCEL,..). Separator is ";" (ord=59).
11) ANSI
Save the file with DOS ESC Sequences. You need to install "ANSY.SYS" to view
them. The code of these files isn't optimized ! You can use the DOS tool
ANSIFix (prog. directory) to reduce the filesize. (see B.)
12) OTHER
Only a text file with another extension.
B. SAVE OPTIONS:
=========================================
ASCII2HTML Control character conversion:
ASCII | HTML
-------+-----------
'<' | '<'
'>' | '>'
'"' | '"'
'&' | '&';
No other characters are converted, because modern Browser could read them
without problems and a HTML conversion would only increase the file size. If you
want to make the files compatible to older browsers you can open them with a
good HTML Editor and save them HTML2.0 compatible.
TIP: If you want to save a HTML plain text file (mode 1) with an other font size
or style you could save it as HTML colored.
6.) HTML Colored
Supported Attributes:
- Font Size
- italic, underline, bold
Your browser must support "style" tags and colored cells. This files are
always saved optimized.
This save format creates optimized files. If you have painted (large) colored
HTML files manually you could import them and save again. Normally the file-
size will decrease. For 100% optimized code you must set the main font color
to the color which changes most often. This mustn't be the most used char.
color! (Have a look at a HTML reference file)
The program could although search this font for you, but this operation could
take several minutes !!!
7.) HTML colored table
Supported Attributes:
- Font Size
- Font name
- Border size
- italic, underline, bold
Your browser must support "style" tags and colored cells.
This is an test format and the files are very large. It is possible to
reduce the file size by 80% if many small tables are used. The problem is,
that only IE4.0 can read this files correct and therefore only one big
table is used. (see "known problems")
NOTE: Be careful by editing this files with a WYSIWYG HTML Editor. The files
are to much for some programs. ;-)
11) ANSI
You can change the first ESCSeqences. Default:
chr(27)+'[=3h'+chr(27)+'[2J'+chr(27)
See in the DOS help under "ANSI.SYS" for more informations. Please use the
ANSIFix tool (Af.exe,DOS) in the program directory to minimize the file
size.
C.) Import HTML files
=========================================
ASCII Edit can import colored HTML art with the following restrictions:
- ASCII must be in a <pre></pre> tag.
- the font color is the only imported attribute
- all other tags, strings, ... are ignored.
WARNING: Takes some time to read the file.
D.) ASCII Editor programmers reference
=========================================
File format: AEF
Taef=Record
r:byte;
g:byte;
b:Byte;
end;
....
F:File of Taef;
Pos.(Record): r g b
---------------------------------------------------------------------------
Header
1 grid cols grid cols colorformat (cols:=r*256+b)
2 grid rows grid rows fontsize (rows:=r*256+b)
3 col width row height gridlinewidth
4 red green blue (Grid maincolor)
5 red green blue (Grid fontcolor)
Data
x red green blue (Cell fontcolor)
x+1 red green blue (Cell color)
x+2 ord(char) - -
Not very effective, but I have had this routine from another prog. ;)