Previous  Next  Contents 

Appendix B - Text File Format

Note: This file format is deprecated, and should not be used for writing files. Use the newer, and more general XML file format. This material is presented for reference only.

The purpose of this document is to describe the format of the Chartist-2 text file. This file type has an extension of "CHX", and is interpreted by Chartist-2 as a chart document. The information in this document may be used to provide a means of creating or interpreting CHX files with other applications.

Chartist-2 Text Files allow the full specification of a chart document with the following restrictions:

Symbol pictures, and OLE objects in symbols are not saved or restored.

All text in a symbol is saved and restored in the same font. That font is the first font used in the symbol.

Overview Of The Document File

The general format and order of a CHX file is as follows:

1. Format Identifier section
2. Color Table section
3. Font Table section
4. Chart Properties section
5. Default Symbol Properties section
6. Default Line Properties section
7. Symbol sections
8. Line sections

All information in the .CHX file is represented in ANSI coded text. The material below descrides in detail the format, contents and meaning of each of these sections.

The Chart Document Coordinate System

Information in a chart document is positioned using a logical coordinate system. The following describes this system:

Units of measure

All units of measure are integer quantities with one unit being equal to 0.001 inch.

Direction Of Axes

The horizontal or x axis is positive right. The vertical or y axis is positive down.

Chart Origin

The origin of a chart is at the top left corner. The top left corner is located at x = 0, y = 0 units in the coordinate system. No information in the chart may be positioned above or to the left of this point. Also this point is perceived as the "Home" position by the user of the Chartist application.

Format Identifier

The file begins with a format identifier:

[chartisttext]

This identifies the file as a CHX file to Chartist-2. No information prior to this is processed by Chartist-2.

Color Table

The colors that are used in the document are specified here in a table. The table entry number is used to refer to a color by other CHX entries. The following is an example of a Color Table:

[colors]
1 = 0,0,0
2 = 255,255,255

The Color Table begins with the section header "[colors]." This is followed by a line for each color table entry. Color Table entries begin with an index (starting with 1), followed by an equal sign, and then an RGB triplet. An RGB triplet comprises three color values, for Red, Green and Blue, repectively. The triplet values are separated by commas, and range from 0 to 255. In the example above, table entry 1 is black, and table entry 2 is white.

Font Table

The fonts that are used in the document are specified here in a table. The table entry number is used to refer to a font by other CHX entries. The following is an example of a Font Table:

[fonts]
1 = "CG Times (WN)",roman,12,
2 = "CG Times (WN)",roman,12,B
3 = "Times New Roman",roman,11,
4 = "Arial",swiss,30,

The Font Table begins with the section header "[fonts]." This is followed by a line for each Font Table entry. Font Table entries begin with an index (starting with 1), followed by an equal sign, and then a font specification. A font specification comprises four mandatory fields, separated by commas: font name, font family, size, emphasis.

The font name is the exact name of the desired typeface, quoted. The names of fonts are shown in the font selection dialogs in Chartist-2.

The font family is one of the keywords: unkn, roman, swiss, modern, script, decor. The font family for a given font name depends on the font itself. For printer fonts that have no exact display font equivalent, this field helps to determine the best font to show on the screen. To find the correct font family, it is best to create a chart with the desired fonts used in symbols, and save that chart as a Text File. Then you can examine the resulting font table and record the font family names.

The size is the height of the font in points.

The emphasis field is a concatenation of the following capital letters: B (bold), (italic), U (underscore), S (strikeout). This field determines what emphasis is applied to the font. For example BI would be used to apply both bold and italic emphasis. If no emphasis is desired, leave the field blank.

Chart Properties

General settings for the chart document are recorded in this section. The following is an example:

[chart]
width = 15984
height = 20000
color = 3
font = 1

The Chart Properties section begins with the section header "[chart]." This is followed by optional settings. If a setting is not specified, the current default value in Chartist-2 is applied when the Text File is loaded. The settings comprise a keyword, followed by an equal sign and then a setting value. The possible key words and their values are defined below:

width Defines the width of the chart in 0.001" inch increments, The maximum value is 60000 (60 inches).

height Defines the height of the chart in 0.001" inch increments, The maximum value is 60000 (60 inches).

color Defines the background color for the chart. The value of the setting must correspond to one of the Color Table entries.

font Defines the font used for line labels. The value of the setting must correspond to one of the Font Table entries.

Default Symbol Properties

The default properties for symbols are specified in this section. In subsequent symbol entries in the Text File, any properties not specified take on these default settings. The following is an example:

[defsymbol]
type = Rect
width = 1750
height = 750
plane = 1
color = 2
penstyle = solid
penwidth = 0
pencolor = 1
textcolor = 1
shporient = 0,0,0

The Default Symbol Properties section begins with the keyword "[defsymbol]." This is followed by optional settings. Any optional settings not specified in this section take on the current default settings in Chartist-2 when the Text File is loaded. As above, each setting comprises a keyword followed by and equal sign, and then a setting value. The possible default symbol settings and their values are defined below:

type Defines the symbol type. Its value is one of the symbol names in the current Chartist-2 shape library. The symbol name is not quoted.

width Defines the symbol width, in 0.001" inch increments.

height Defines the symbol height, in 0.001" inch increments.

plane Defines the plane of the symbol. The permitted values are 0 (bottom), 1 (middle), 2 (top).

color Defines the symbol background color. The value must correspond to an entry in the Color Table.

penstyle Defines the style of the symbol border. The value must be one of the following keywords: solid, dot, dash.

penwidth Defines the thickness of the border. The permitted values for the penwidth are: 0 (normal), 2 (medium), 3 (thick).

pencolor Defines the color of the border. The value must correspond to an entry in the Color Table.

textcolor Defines the color of the symbol text. The value must correspond to an entry in the Color Table.

shporient Defines the orientation of the shape, relative to its definition. There are 3 required values, separated by commas. The first value is the angle rotation, counterclockwise in 90 degree increments. The second value is 1 if the shape is flipped in x dimensions, or 0 if it is not. The third value is 1 if the shape is flipped in y dimensions, or 0 if it is not.

< Line>

The default properties for lines are specified in this section. In subsequent line entries in the Text File, any properties not specified take on these default settings. The following is an example:

[defline]
route = auto
labeldest = 0
penstyle = solid
penwidth = 0
pencolor = 1
textcolor = 1
arrowlen = 125
srcarrow = None
dstarrow = Clsd-2:1-F

The Default Line Properties section begins with the keyword "[defline]." This is followed by optional settings. Any optional settings not specified in this section take on the current default settings in Chartist-2 when the Text File is loaded. As above, each setting comprises a keyword followed by and equal sign, and then a setting value. The possible default settings and their values are defined below:

route Defines the type of route for the line. The value must be one of the following keywords: auto, curve, direct.

labeldest Selects whether a line label is placed near the source or destination end of the line. A value of 0 selects the source end, and a value of 1 selects the destination end.

penstyle Defines the style of the line. The value must be one of the following keywords: solid, dot, dash.

penwidth Defines the thickness of the line. The permitted values for the penwidth are: 0 (normal), 2 (medium), 3 (thick).

pencolor Defines the color of the line. The value must correspond to an entry in the Color Table.

textcolor Defines the color of the text in the line label. The value must correspond to an entry in the Color Table.

arrowlen Defines the length of any arrows on the line. The value is in 0.001" increments, to a maximum of 4095 (4.095").

srcarrow Defines the arrow type used at the source end of the line. The value is a non-quoted string, corresponding to one of the arrow types in the current Chartist-2 shape library, or None.

dstarrow Defines the arrow type used at the destination end of the line. The value is a non-quoted string, corresponding to one of the arrow types in the current Chartist-2 shape library, or None.

Symbols

Each symbol in the Text File is defined by a Symbol section. This section specifies all of the non-default properties for the symbol. The following is an example:

[symbol]
type = Rect-Shad
ident = 1
loc = 5250,500
width = 2000
pencolor = 5
color = 4
justify = TL
txtangle = 90
text =
"Nicholas Winn
Vice President, R&D"
font = 2

The Symbol section begins with the keyword "[symbol]." This is followed by mandatory and optional settings. Any optional settings not specified in this section take on the current default settings in Chartist-2 as modified by the [defsymbol] section when the Text File is loaded. As above, each setting comprises a keyword followed by and equal sign, and then a setting value. The possible symbol settings and their values include all of those defined above in Default Symbol Properties plus the following additional ones:

ident Defines the identifier for the symbol. The value must be unique and in the range 1 - 1999. This setting is mandatory.

loc Defines the location of the center of the symbol. The value is a pair of integers, separated by a comma. The first value is the X oordinate and the second value is the Y coordinate. This setting is mandatory.

justify Defines the justification for text in the symbol. The value is one or two characters as follows: T for Top justify; L for Left justify; R for right justify. The default justification is centered vertically and horizontally. L and R should not be used at the same time.

txtangle Defines the angle of text in the symbol, relative to the horizontal. The default text angle is 0. Permitted values are 90 degree increments, counterclockwise.

text Defines the text contained in the symbol. The value is a quoted string. The string may me more than one line long.

font Defines the font used for the symbol text. The value must correspond to one of the entries in the Font Table, or a value of -1, which causes the text to use the line label font (defined in the Chart Properties section).

Lines

Each line in the Text File is defined by a Line section. This section specifies all of the non-default properties for the line. The following is an example:

[line]
src = 3,R,0
dst = 7,L,0
dstarrow = Open-2:1
text =
"FALSE"

The Line section begins with the keyword "[line]." This is followed by mandatory and optional settings. Any optional settings not specified in this section take on the current default settings in Chartist-2 as modified by the [defline] section when the Text File is loaded. As above, each setting comprises a keyword followed by and equal sign, and then a setting value. The possible line settings and their values include all of those defined above in Default Line Properties and the following additional ones:

src Defines the source end of the line, mandatory. The value comprises three fields separated by commas. The first field is the ident of the source symbol. The second field is the exit side from the source symbol: (right), L (left), T (top), B (bottom). The last field is the attachment point on the symbol side. The possible values for the attachment point are: -3 (top or left), -2, -1, 0 (center), 1, 2, 3 (bottom or right). These correspond to the seven possible line attachment points.

dst Defines the destination end of the line,mandatory. The value comprises three fields separated by commas. The first field is the ident of the destination symbol. The second field is the entry side to the source symbol: (right), (left), T (top), B (bottom). The last field is the attachment point on the symbol side. The possible values for the attachment point are: -3 (top or left), -2, -1, 0 (center), 1, 2, 3 (bottom or right). These correspond to the seven possible line attachment points.

text Defines the label text for the line. The value is a quoted string. Line labels should not contain more than one line.


Previous  Next  Contents