1 <!-- This file is part of Shapes. -->
3 <!-- Shapes is free software: you can redistribute it and/or modify -->
4 <!-- it under the terms of the GNU General Public License as published by -->
5 <!-- the Free Software Foundation, either version 3 of the License, or -->
6 <!-- any later version. -->
8 <!-- Shapes is distributed in the hope that it will be useful, -->
9 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
10 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
11 <!-- GNU General Public License for more details. -->
13 <!-- You should have received a copy of the GNU General Public License -->
14 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
16 <!-- Copyright 2008, 2010 Henrik Tidefelt -->
18 <section id="dynamic/graphic">
19 <title>Graphics</title>
21 <p>The bindings in this section are closely related to the <em>graphics state parameters</em> in <str-PDF />.</p>
22 <p>Many of these dynamic variables can be set to a <named-type name="Void" /> value, which means that painted objects do not specify the property for themselves, but inherit the property from the context where they appear. This feature is a low-level <str-PDF /> trick, and the effects may be (or at least seem) unpredictable.</p>
25 <dynamic-variable name="width">
26 <type><union-type><named-type name="Length" /> <named-type name="Void" /></union-type></type>
27 <default><physical><scalar>1</scalar><unit>bp</unit></physical></default>
28 <constraint><self /> ≥ <physical><scalar>0</scalar><unit>bp</unit></physical></constraint>
30 <p>Intended to be used as the width when paths are stroked. A value of <physical><scalar>0</scalar><unit>bp</unit></physical> has a special meaning in <str-PDF />, being that the stroke shall be as thin as possible without dissappearing on the rendering device. On high resolution printers, this may result in a line which is very hard to read, while such a line shall allways be clearly visible on a computer screen.</p>
31 <p>Note that if the width is inherited from the context, it will not be possible to compute a correct bounding box of a stroked object.</p>
35 <dynamic-variable name="stroking">
36 <type><union-type><named-type name="Color" /> <named-type name="Void" /></union-type></type>
37 <default><value name="GRAY_BLACK" /></default>
39 <p>Color used when paths are stroked.</p>
42 <dynamic name="strokingalpha" />
46 <dynamic-variable name="nonstroking">
47 <type><union-type><named-type name="Color" /> <named-type name="Void" /></union-type></type>
48 <default><value name="GRAY_BLACK" /></default>
50 <p>Color used when paths are filled (or, more generally, anything but stroked). (The name is inherited from <str-PDF />.)</p>
53 <dynamic name="nonstrokingalpha" />
57 <dynamic-variable name="cap">
58 <type><union-type><named-type name="CapStyle" /> <named-type name="Void" /></union-type></type>
59 <default><value name="CAP_BUTT" /></default>
61 <p>Line cap style.</p>
65 <dynamic-variable name="join">
66 <type><union-type><named-type name="JoinStyle" /> <named-type name="Void" /></union-type></type>
67 <default><value name="JOIN_MITER" /></default>
69 <p>Line join style.</p>
72 <dynamic name="miterlimit" />
76 <dynamic-variable name="miterlimit">
77 <type><union-type><named-type name="Float" /> <named-type name="Void" /></union-type></type>
78 <default><eq>10</eq></default>
79 <constraint><self /> ≥ <eq>1</eq></constraint>
81 <p>Miter limit value to use when <dynamic name="join" /> is <value name="JOIN_MITER" />.</p>
85 <dynamic-variable name="dash">
86 <type><union-type><named-type name="Dash" /> <named-type name="Void" /></union-type></type>
87 <default><inline>[dashpattern]</inline></default>
89 <p>Dash pattern to use for strokes. (The default value gives solid lines.)</p>
92 <value name="dashpattern" />
96 <dynamic-variable name="strokingalpha">
97 <type><union-type><named-type name="Alpha" /> <named-type name="Void" /></union-type></type>
98 <default><inline>[shape 1]</inline></default>
100 <p>Alpha settings for stroking operations.</p>
103 <value name="alphashape" /> <value name="alphaopacity" /> <dynamic name="stroking" />
107 <dynamic-variable name="nonstrokingalpha">
108 <type><union-type><named-type name="Alpha" /> <named-type name="Void" /></union-type></type>
109 <default><inline>[shape 1]</inline></default>
111 <p>Alpha settings for nonstroking operations.</p>
114 <value name="alphashape" /> <value name="alphaopacity" /> <dynamic name="nonstroking" />
118 <dynamic-variable name="blend">
119 <type><union-type><named-type name="BlendMode" /> <named-type name="Void" /></union-type></type>
120 <default><value name="BLEND_NORMAL" /></default>
126 <dynamic-variable name="blendspace">
127 <type><named-type name="ColorSpace" /></type>
128 <default><em>(inherited)</em></default>
130 <p>Color space for blending.</p>
134 <dynamic-variable name="spot">
135 <type><named-type name="Drawable" /></type>
136 <default><inline>dynamic [spot (0m,0m)]</inline></default>
137 <constraint><em>Cannot be changed!</em></constraint>
139 <p>A function call with fixed arguments (or no arguments at all) is like a dynamic variable, and then a dynamic variable is generally preferred over the function call since using a dynamic variable emphasizes the dynamic nature of the expression. Since the need for a spot at the origin (which can then be transformed to any desired position) is so frequent, this dynamic variable is simply an alternative to calling <value name="spot" /> with the origin as argument.</p>
140 <p>The value of this dynamic variable will depend on other dynamic variables, compare <value name="spot" />.</p>