Configuring the symbols xml

From Fs_wiki

Revision as of 20:42, 8 December 2007 by Aaron (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Most of the files in the "symbols/" directory are sketches, and they are automatically loaded when you start the program. You can even select them in the MainBox window and view or edit them like any other sketch. There are symbols for slope arrows, breeze, stream, triangular boulder, and so on.

symbols.xml
There are two files in the symbols directory that are not sketches. One is "symbols.xml" and the other is "fontcolours.xml". The file "symbols.xml" contains the instructions for how all the other symbols are used and combined. Some symbols can point in different directions, like the slope symbol, while others are always oriented the same way, like the stal symbol. And some are defined as collections of symbols.

Each record in this file is a symbolaut which contain one or more asymbol records:

<symbolaut dname="breeze" description="breeze symbol">
 <asymbol name="breeze" ... />
 ...
</symbolaut>

The symbolaut names correspond the symbols you can specify in the survey, one for each button in the Control Pane. Each asymbol record refers to an xml sketch file in the "symbols/" directory, subjecting it to a number of parameters.

Symbol parameters
multiplicity1, 2, 3, ...; fillThe number of copies made of this symbol ("fill" to fill up the area)
buttonactionappend, overwriteAdds this symbol to other symbols on the same connective path, or not
area-interactionno-overlap, allowed-outsideRestricts the symbol to within the boundaries of the cave, or lets it be drawn outside
positionendpath, randomLocates the symbol(s) at the endpoint of the connective path, or scatters it at random
scalefixed, andhalfThe size of the symbol is fixed, or it can randomly be half-size
picscaleany numberA fixed constant scalefactor (independent of the "scale" setting), useful for reusing the same symbol set for different output sizes
orientationfixed, alongaxis, nearaxis, randomThe direction/rotation of the symbol relative to the last segment of the connective path.



I have been playing with creating my own style settings by editing an XML file in my projects XML Dir. I based my settings on the group subset 'base1000' so that I can play with the new symbol types, but then I found that none of the scalebars were included in that subset, so I tried to include them in my subset as follows:

 <?xml version='1.0' encoding='us-ascii'?>
 <tunnelxml>
   <fontcolours fontstyle="PLAIN" fontname="Serif">
     <image_file_directory name="drawings"/>
     <groupsubsetattr groupsubsetname="footleg1">
       <importgroupsubsetattr groupsubsetname="base1000"/>
       <subsetattr name="Riano" uppersubset="basevisiblecave">
         <set multiplicity="1" buttonaction="overwrite" area-interaction="no-overlap">
           <symbolaut dname="10mscale" description="10m scale bar">
             <asymbol name="scalebar10m" position="endpath" scale="fixed" orientation="fixed" area-interaction="allowed-outside"/>
           </symbolaut>
           <symbolaut dname="30mscale" description="30m scale bar">
             <asymbol name="scalebar30m" position="endpath" scale="fixed" orientation="fixed" area-interaction="allowed-outside"/>
           </symbolaut>
           <symbolaut dname="50mscale" description="50m scale bar">
             <asymbol name="scalebar50m" position="endpath" scale="fixed" orientation="fixed" area-interaction="allowed-outside"/>
           </symbolaut>
           <symbolaut dname="100mscale" description="100m scale bar">
             <asymbol name="scalebar100m" position="endpath" scale="fixed" orientation="fixed" area-interaction="allowed-outside"/>
           </symbolaut>
         </set>
       </subsetattr>
       <subsetattr name="mainactivelevels" uppersubset="Riano" areacolour="#550000ff" labelcolour="#ff0000ff">
       </subsetattr>
       <subsetattr name="drylowerlevels" uppersubset="Riano" areacolour="#5500ff00" labelcolour="#ff00ff00">
       </subsetattr>
       <subsetattr name="red" uppersubset="Riano" areacolour="#55ff0000" labelcolour="#ffff0000">
       </subsetattr>
       <subsetattr name="orange" uppersubset="Riano" areacolour="#80ff8000" labelcolour="#ffff5500">
       </subsetattr>
       <subsetattr name="yellow" uppersubset="Riano" areacolour="#55ffff00" labelcolour="#ffffff00">
       </subsetattr>
     </groupsubsetattr>
   </fontcolours>
 </tunnelxml>

I copied the symbolaut elements from the default style in the main fontcolours.xml file. The problem is that I do not get these scalebar symbols on my sketch when I use my footleg1 style. Tunnel reports the following in the command window when it draws the sketch containing the 50m scalebar using my style:

No symbol name matches 50mscale of subset basevisiblecave 45
No symbol name matches 50mscale of subset default 0

My subset groups using different background colours appear to work, but raise a couple of questions:

Colour definitions

Colour attributes are in the form of 8 hex characters, like "#30ff0000". The first two digits are the opacity (00 for completely transparent, and ff for totally overpainted), and the other three pairs refer to red, green, and blue respectively.

There are five different things that get coloured:

  • areamaskcolour, areacolour - The colours used to fill an area are painted twice, because a single colouring in doesn't work.
  • strokecolour - The colour of the drawn paths, like walls and pitch boundaries.
  • labelcolour - The colour of the text in the survey.
  • symbolareafillcolour - A rare case where a symbol is used for filling an area, like colouring watery areas rather than with slashed lines.

Navigation

-->
Navigation
Toolbox