Layer Properties (.lyp) File Format

This is a brief description of the layer properties file format (.lyp). The file is basically an XML file with a certain structure. It is not just a plain layer list but also includes custom stipple pattern, multiple tabs and a hierarchy a layer groups.

There are basically two versions: multi-tab files and single-tab files. The multi-tab structure is used when a .lyp file contains multiple properties lists shown as tabs in the layer list.

Single-Tab Files

The simple form of a layer properties file is a simple list of property definitions. Each property definition corresponds to one entry in the layer list:

<layer-properties>
 <properties>
  (property definitions)
 </properties>
 <properties>
  (property definitions)
 </properties>
 ...
</layer-properties>

Each entry may contain child entries forming a hierarchy of layer properties nodes (the "groups" in the layer list) by adding <group-member> elements. Groups can be nested by including more <group-member> elements inside such a declaration:

<layer-properties>
 ... 
 <properties>
  (property definitions)
  <group-members>
   (property definitions)
   <group-members>
    ...
   </group-members>
  </group-members>
 </properties>
 ...
</layer-properties>

A layer properties list can hold custom fill pattern which are referred to by the "dither-pattern" element of the property definitions using "Cx" values:

<layer-properties>
 ...
  <custom-dither-pattern>
   <pattern>
    (pattern lines)
   </pattern>
   <order>(order index)</order>
   <name>(name)</name>
  </custom-dither-pattern>
</layer-properties>

The order index is a number specifying the order which the pattern are presented in the pattern list. Independently of that, the first pattern is referred to as "C0", the second as "C1" and so on. "name" gives the name under which the pattern appears in the list.

The pattern lines are given a strings in "line" elements where a "." is for a non-set pixel while a "*" is for a set one. The number of lines is arbitrary but the number of pixels per line currently is confined to 8, 16 or 32 pixels. Here is an example:

  <custom-dither-pattern>
   <pattern>
    <line>.......................*........</line>
    <line>...**..................*........</line>
    <line>.......................**.......</line>
    <line>..*.....................*******.</line>
    <line>...............*..............*.</line>
    <line>*..........*****..............*.</line>
    <line>*........*.....*..............*.</line>
    <line>*.....*.......*...............*.</line>
    <line>*****.........*...............*.</line>
    <line>..............................*.</line>
    <line>............*.....*****.......**</line>
    <line>...........*.....**...*.........</line>
    <line>..........*.....**....*.........</line>
    <line>.........*...........*..........</line>
    <line>.......*......*......*..........</line>
    <line>......*.....**..................</line>
    <line>.......*..*........*............</line>
    <line>*......****........*....*.......</line>
    <line>*......**........*.....**.......</line>
    <line>**.....................**.......</line>
    <line>.****..........*......***.......</line>
    <line>......***....**.....*...*.......</line>
    <line>.......**....*......*...*.......</line>
    <line>.......*.....*....*.....*.......</line>
    <line>.......*.....****......*........</line>
    <line>......*.......**................</line>
    <line>.....*................*.........</line>
    <line>.....*................*..**.....</line>
    <line>....*.................*****.....</line>
    <line>....**....................*.....</line>
    <line>.....******...............*.....</line>
    <line>..........**....................</line>
   </pattern>
   <order>1</order>
   <name>Irregular</name>
  </custom-dither-pattern>

A layer properties list can also hold custom line style pattern which are referred to by the "line-style" element of the property definitions using "Cx" values:

<layer-properties>
 ...
  <custom-line-style>
   <pattern>(pattern line)</pattern>
   <order>(order index)</order>
   <name>(name)</name>
  </custom-line-style>
</layer-properties>

The order index is a number specifying the order which the styles are presented in the styles list. Independently of that, the first pattern is referred to as "C0", the second as "C1" and so on. "name" gives the name under which the style appears in the list.

The line pattern is given as a string where a "." is for a non-set pixel while a "*" is for a set one. The number of pixels currently is confined to 32 max.

  <custom-line-style>
   <pattern>*.*.*.***.***.***.*.*.*..</pattern>
   <order>1</order>
   <name>SOS</name>
  </custom-line-style>

Multi-Tab Layer Files

Multi-Tab files simply embed multiple "layer-properties" elements in another root element called "layer-properties-tabs". In that case, each "layer-properties" element specifies a name which is used as the tab's display text. The name can be empty in which case the tabs are simply numbered:

<layer-properties-tabs>
 <layer-properties>
  ...
  <name>Tab 1</name>
 </layer-properties>
 <layer-properties>
  ...
  <name>Tab 2</name>
 </layer-properties>
 ...
</layer-properties-tabs>

Please note that if you use custom fill pattern, each set must be specified individually per tab.

Property Definition Blocks

An example for a property definition block is:

 <expanded>true</expanded>
 <frame-color>#ff80a8</frame-color>
 <fill-color>#ff80a8</fill-color>
 <frame-brightness>0</frame-brightness>
 <fill-brightness>0</fill-brightness>
 <dither-pattern>I9</dither-pattern>
 <line-style>I4</line-style>
 <valid>true</valid>
 <visible>true</visible>
 <transparent>false</transparent>
 <width>1</width>
 <marked>false</marked>
 <xfill>false</xfill>
 <animation>0</animation>
 <name>Display name</name>
 <source>1/0@1</source>

The definition of these properties is the following:

Element Value
expanded Applies to group nodes. If 'true', the group node is expanded (shows the child elements). If 'false', the node is collapsed.
frame-color The color of the frames (the pen in which is outer edges of the shapes are drawn) in HTML notation (#rrggbb)
fill-color The color of the fill pattern inside the shapes in HTML notation (#rrggbb)
frame-brightness This value modifies the brightness of the frame color. 0 is unmodified, -100 roughly adds 50% black to the color which +100 roughly adds 50% white.
fill-brightness This value modifies the brightness of the fill color. See "frame-brightness".
dither-pattern This is the number of the dither pattern used to fill the shapes. The values are "Ix" for one of the built-in pattern where "I0" is "solid" and "I1" is "clear". "Cx" is one of the custom pattern if these are defined (see above).
line-style This is the number of the line style used to draw the shape boundaries. An empty string is "solid line". The values are "Ix" for one of the built-in styles where "I0" is "solid", "I1" is "dotted" etc. "Cx" is one of the custom styles if these are defined (see above).
valid This is a boolean value ("true" or "false") indicating whether the entry is valid or not. Invalid layers are drawn but shapes on those layers can't be selected.
visible This is a boolean value ("true" or "false") indicating whether the entry is visible or not.
transparent This is a boolean value ("true" or "false") indicating whether the entry is transparent or not. Transparency is implemented in terms of bitwise-OR of the colors with dark background and bitwise-AND of the colors with white background, so the effect is dependent on the bit pattern of the RGB color triplets involved.
width This is the line width of the frame in pixels (or empty for the default which is 1).
marked This is a boolean value ("true" or "false") indicating whether the entry is marked (drawn with small crosses) or not.
xfill This is a boolean value ("true" or "false") indicating whether boxes are drawn with a diagonal cross.
animation This is a value indicating the animation mode. 0 is "none", 1 is "scrolling", 2 is "blinking" and 3 is "inverse blinking".
name This is the display name. The display name is the text which is shown for this entry. If no text is given, a text will be generated from the layer, datatype and layer name.
source This is the source where the shapes are taken from. That is a string describing the layout, layer, datatype and selectors or transformations (see here for a detailed description of that string). A source can partial, in which case it will provide defaults for child entries of an entry.