6.4 Decorations6 Stylesheets6.2 Stylesheet theory6.3 Symbols

6.3 Symbols

Style sheets can also contain symbols, such as marks and arrows, background patterns, or logos. These are named Ipe objects that can be referenced by the document. If your document's stylesheets define a symbol named Background, it will be displayed automatically on all pages. (If a layer named "BACKGROUND" is present on a page, it suppresses the "Background" symbol for that page. It does not matter if the layer itself is visible or not.) You can create and use symbols using the Symbols ipelet. Here is a (silly) example of a style sheet that defines such a background:

<ipestyle name="background">
<symbol name="Background" xform="yes">
<text pos="10 10" stroke="black" size="LARGE">
Background text
</text>
</symbol>
</ipestyle>

Note the use of the xform attribute—it ensures that the background is embedded only once into PDF document. This can make a huge difference if your background is a complicated object.

Symbols can be parameterized with a stroke color, fill color, pen size, and symbol size. This means that the actual value of these attributes is only set when the symbol is used in the document (not in the symbol definition). The name of a parameterized symbol must end with a pair of parentheses containing some of the letters "s" (stroke), "f" (fill), "p" (pen), "x" (symbol size), in this order. The symbol definition can then use the special attribute values sym-stroke, sym-fill, and sym-pen. A resizable symbol is automatically magnified by the symbol size set in the symbol reference.

A symbol can define several snap positions for the symbol object. These positions are then active in vertex snap mode. Symbols with snap positions are also presented differently in the current selection (the entire symbol is outlined, like a group, rather than just showing a cross at the symbol location), and you can select such symbols by clicking near any of the snap positions.

You can also use a stylesheet to define additional mark shapes, arrow shapes, or tiling patterns.