Format of TriQuick TVL files

 TVL-files (from "TriQuick oVerLay") contain simple vector images. These plain text files have very simple human-transparent format and can be created (or edited) either in TriQuick or in other programs (including text editors similar to Notepad).
TriQuick can read TVL-files created in Windows (with a two-character line terminator CR+LF) and in other operating systems (with single-character line terminator CR or LF) but saves only with EOL marker which is selected on the tab Axes, grid, legend, files of the Settings window.
 TVL images are specially oriented to use in rectangular diagrams (with two independently scaled axes) and in ternary diagrams (with 3 normalized axes). Therefore, diagram graphics have such specific features as:

  • Shrinking and stretching of objects (except line widths, text characters and markers in arrays of points) strongly depend on independent changes of scales of the axes;
  • Slopes of rectangles, ellipses and text objects are expressed in dX/dY ratios only (degrees are not used at all, at least in the current version).

File header
 The first line of TVL should be keyword "TriQuick Overlay Version" followed by equality sign (=) and version number (1 at present).
 The second line contains one integer – number of axes on diagram for which this image is designed (2 or 3).
 Then 2-3 lines follow which define the axis titles (2 lines for rectangular plots, 3 lines for ternary plots). For rectangular plots, the first line corresponds to the lower horizontal axis X, the second line corresponds to the left vertical axis Y. For ternary diagrams, the first line corresponds to the top corner T (vertical axis), then the lower left corner L, then the lower right corner R. TriQuick determines how suitable this TVL-file for the current chart by specified number of axes and by these names as well.
 Then the line with image name (description) follows.
 Headers of rectangular diagrams have got one more line specifying default axes ranges in the order: Xmin Xmax Ymin Ymax. These boundaries do not necessarily correspond to the bounding rectangle for all objects, they can be either larger or smaller than it (being used only for adjustment of diagram axes after the loading of TVL-file).
 The rest of TVL-file contains blocks with descriptions of graphic objects.
 Example of file header for rectangular diagram:

TriQuick Overlay Version=1
2
T,°C
P,kbar
Scheme of metamorphic facies
200 1100 0.001 15

Blocks with descriptions of graphic objects
 First line of the block should start with object type keyword followed by equality sign (=):

  • Overlay= name of another TVL-file to be combined with the host image;
  • Image= name of raster or vector image file (allowed extensions are BMP, JPG, PNG, WMF and EMF);
  • Polygon= polygon (closed polyline);
  • Line= opened polyline;
  • Bezier= Bezier curve may be either opened or closed (specifying filled areas);
  • Rectangle= rectangle may be sloped;
  • Ellipse= ellipse may be sloped;
  • Marker= array of points marked by small images (the same as conventional points plotted on diagram);
  • Text= text block located at specified cordinates;
  • Info= "information" text block linked to chart sides rather than to specific coordinates.

 Object of "Overlay" type is used to combine several TVL-files. Its record consists of one line with TVL-file name only (with extension) after the equality sign. Referenced TVL-file should be either in the same directory as the host file or its full name (with absolute or relative path) must be specified, for example:

Overlay=..\..\templates\shared.tvl

 Use object of "Image" type to place vector or raster image on the diagram background. Its record consists of one line with file name (with optional path) after the equality sign. Image size will be adjusted according to ranges of axes specified in the file header. However, if image is a Windows metafile with saved coordinates then ranges of axes will be reset (i.e. diagram borders stored in metafiles override TVL header values).
 The character "B" or "F" must follow the equality sign for all objects except of "Overlay" and "Image" types. "B" means that this object should appear on the diagram background, i.e. behind data points, grid and axes. "F" means that the object should be placed on foreground and overlap data points, grid and axes. This character may be followed by visibility flag separated by space ("Y" – object is visible, "N" – object is hidden). Objects are visible by default (if visibility flags are omited). Name of the object appear at the end of the first line after the semicolon (;). Example of the first line:

Polygon=B Y;Small yellow triangle

 The second line contains most common parameters of the object separated by spaces. These parameters may be different a little depending on the object type.

Polygon
 The second line:

  • LineColor – outline color
  • LineWidth – outline width (in screen pixels), integer from 1 to 9
  • LineStyle – outline style, integer from 0 to 5:
    1. solid line
    2. dashed line
    3. dotted line
    4. dash-dot line
    5. dash-dot-dot line
    6. no outline
    However, outline is always solid if its width is more than 1 pixel.
  • FillColor – fill color
  • FillStyle – fill style, integer from 0 to 7:
    1. solid fill
    2. no fill
    3. horizontal hatching
    4. vertical hatching
    5. diagonal hatching to the right bottom corner (forward)
    6. diagonal hatching to the left bottom corner (backward)
    7. upright cross hatching
    8. diagonal cross hatching

 The third line contains one integer: number of poygon vertices, and the other lines contain their coordinates (one line per vertex).
 Example of the rectangle description:

Polygon=B Y;Starlet 1
#000000 1 0 #B0F0F2 0
7
85 50
71.822 77.364
42.212 84.122
18.466 65.186
18.466 34.814
42.212 15.878
71.822 22.636

Line

 The second line:

  • LineColor – line color
  • LineWidth – line width (in screen pixels), integer from 1 to 9
  • LineStyle – line style (hereinafter refer to the same parameters for polygons)

 The third line contains one integer: number of line nodes, and the other lines contain their coordinates (one line per node).
 Example of the polyline description (for ternary diagram):

Line=B Y;H2O
#808080 1 1
2
0 66.667 33.333
100 0 0

Bezier
 The second line:

  • LineColor – line color
  • LineWidth – line width (in screen pixels), integer from 1 to 9
  • LineStyle – line style (hereinafter refer to the same parameters for polygons)
  • FillColor – fill color, for closed curves only
  • FillStyle – fill style, for closed curves only

 The last two parameters are omited in the case of opened Bezier curve.
 The third line contains one integer: total number of curve nodes and control points, and the other lines contain their coordinates (one line per node or control point). Node coordinates are preceded by characters specifying their types (separated from coordinates by spaces):

  • C – cusp (vertex) node: the point of line break;
  • S – smooth node: line maintains the smoothness but has different curvatures on either side of the node (i.e the control points lie on the tangent line but at different distances from the node);
  • E – equidistant (symmetrical) node: a smooth line with the same curvature on both sides of the node (i.e. the control points lie on the tangent line and at equal distances from the node).

 If type of node is not specified then it is regarded as a cusp node.
 First and last nodes of opened Bezier curves can only be of the cusp type. Coordinates of the first and last nodes of closed curves must be identical.
 Example of opened single-segment Bezier curve (with two end nodes and two control points between them):

Bezier=B Y;4FeAct+3An=11Hed+3Alm+7Qtz+4H2O
#FF0000 1 0
4
C 1065 1
 1454.933 3.675
 671.469 13.107
C 100 13.5

 Example of closed Bezier curve:

Bezier=B Y;Yellow area
#FF0000 2 0 #FFFF00 0
13
E 31 29
 22.2 34
 14.6 53.6
E 21 62
 27.4 70.4
 54.2 76
S 63 71
 71.8 66
 71.4 45.4
E 65 37
 58.6 28.6
 39.8 24
E 31 29

Rectangle
 The second line:

  • LineColor – outline color
  • LineWidth – outline width (in screen pixels), integer from 1 to 9
  • LineStyle – outline style (hereinafter refer to the same parameters for polygons)
  • FillColor – fill color
  • FillStyle – fill style

 The third line contains three rational numbers separated by spaces: the length of the rectangle along the horizontal axis (X), the height of the rectangle along the vertical axis (Y), the slope of the rectangle (dY/dX, negative values allowed).
 The last fourth line contains coordinates of the rectangle center.
 Example of rectangle description:

Rectangle=F Y;Sloped
#FF0000 2 0 #5AB489 0
28.984 20.455 0.95
71.166 20

Ellipse
 The second line:

  • LineColor – outline color
  • LineWidth – outline width (in screen pixels), integer from 1 to 9
  • LineStyle – outline style (hereinafter refer to the same parameters for polygons)
  • FillColor – fill color
  • FillStyle – fill style

 The third line contains three rational numbers separated by spaces: the length of the ellipse horizontal axis (X), the length of the ellipse vertical axis (Y), the slope of the ellipse (dY/dX, negative values allowed).
 Ellipses can also be specified by five alternative parameters in the third line (to support the construction of error ellipses): standard deviation along the horizontal axis (X), standard deviation along the vertical axis (Y), correlation coefficient, number of variables (1 to 3), confidence level (%).
 The last fourth line contains coordinates of the ellipse center.
 Examples of ellipses:

Ellipse=B;My yellow ellipse
#000000 1 0 #FFFF00 0
105.428 4.089 0.5 |width, height, slope
700.918 7.28

Ellipse=B;Error ellipse
#008000 2 0 #D9FFD9 0
60 0.9 0.883 2 99.9 |dX, dY, corr. coeff., n, conf. level
650 9.2

Marker
 The second line:

  • Type – shape type, integer from 0 to 8:
    1. circle
    2. square
    3. triangle
    4. inverted triangle
    5. diamond
    6. upright cross
    7. diagonal cross
    8. 8-point star
    9. small dot
  • Size – marker size (in screen pixels), integer from 2 to 15
  • LineColor – outline color
  • LineWidth – outline width (in screen pixels), integer from 1 to 9
  • LineStyle – outline style (hereinafter refer to the same parameters for polygons)
  • FillColor – fill color
  • FillStyle – fill style

 The third line contains one integer: number of points (markers) in the array, and the other lines contain their coordinates (one line per point).
 Example of point array:

Marker=B Y;Large circles
0 14 #FF0000 2 0 #FFFF00 0
3
29.711 72.855
50.545 75.748
40.759 57.979

Text
 The second line:

  • Font – font name (registered in the operating system) followed by semicolon (;)
  • Charset – code page number (charset). For example, code pages for standard fonts in localized RU-version of Windows XP are:
    1. Default code page (selected in OS)
    2. Russian
    3. ANSI
    4. Hebrew
    5. Arabic
    6. Greek
    7. Turkish
    8. Latin (Baltic languages)
    9. Latin (Eastern and Central European languages)
    10. Vietnamese
    However, available charsets and their number depend on concrete font implementation. It's a good idea to use default charset (0) in most cases.
  • Color – text color
  • Size – character size (in points), integer
  • Bold – "Y" – yes, "N" – no
  • Italic – "Y" – yes, "N" – no
  • Underline – "Y" – yes, "N" – no
  • StrikeOut – "Y" – yes, "N" – no
  • Background – draw background: "Y" – yes, "N" – no (by default, i.e. this field can be omited)

 The third line contains one rational number: slope of the text (dY/dX, negative values allowed).
 The fourth line contains one integer: number of text strings (n).
 Then n lines with text strings.
 The last line contains coordinates of the text block center.
 Example of text block:

Text=F N;Label on phase transition line
Arial; 0 #800000 12 Y N N N
0.028
2
Diamond
Graphite
856 39.3

Info
 The second line is the same as for the "Text" type objects (see above).
 The third line contains two-character code (case insensitive) which define position of the text block relative to diagram axes. Allowed characters:

  • L – at the left end of horizontal axis
  • R – at the right end of horizontal axis
  • T – at the top end of vertical axis
  • B – at the bottom end of vertical axis
  • C – at the center of horizontal or vertical axis

 Order of characters in the code (i.e. order of axes) is not important. However, TriQuick writes horizontal axis at first.
 The fourth line contains one integer: number of text strings (n).
 The last lines of "Info" block are n text strings.
 Example of information text block:

Info=F;Information
Arial; 0 #800000 12 Y N N N Y
LT
6
Sample: D1234-56
Analyses:
Grt 12
Bt 9
Opx 3
Pl 7

Comments in TVL-files
 Comment strings can be placed between blocks with descriptions of objects without any special comment markers. Comment can also appear at the end of any string after preceding pipe character (|). However, TriQuick ignores comments while reading TVL-files and never writes them at saving..

Color values in TriQuick files
 Colors in TriQuick text files are represented by 8-bit RGB values written as standard hexadecimal integers (using digits 0..9 and A..F). Color value starts from the suffix (#), followed by 3 hexadecimal 2-digit numbers written together with the next order of channels: R, G, B. For example, "#FF00BB" defines bright pink color with maximum value of the red component R (FF=255), minimum value of the green component G (00) and intermediate value of the blue component B (BB=187).

Coordinate records in TVL-files
 All coordinate values are written as floating point or integer numbers. TriQuick allows different formats, including exponential (e.g. "1.25e-3"). Number of digits after the decimal point may also be different depending on value of the Precision parameter.
 The only version of coordinate record for rectangular diagram is a two numbers separated by one of delimiter symbols specified by Delimiters variable of the initialization file TriQuick.ini (default symbol is tabulation with ASCII-code 9), first for the horizontal axis (X), then for the vertical axis (Y).
 Ternary diagrams allow two equivalent coordinate systems and, therefore, two versions of coordinate record are possible. You can use general rectangular coordinates anywhere in the diagram field, inside and outside the triangle of axes. Vertices of this triangle correspond to the next general rectangular coordinates: the top vertex T (X=0.5, Y=√3/2), the bottom left vertex L (X=0, Y=0) and the bottom right vertex R (X=1, Y=0). Ternary coordinates allowed only inside the triangle. These are triples of positive values written with the order T, L, R. TriQuick uses ternary coordinates by default. The program always normalizes entered ternary coordinates to 100% (i.e. T+L+R=100). For example, these two records correspond to the same point on the ternary diagram: (T=50, L=30, R=20) and (X=45, Y=43.301..).