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, 2009 Henrik Tidefelt -->
18 <section id="dynamic/text">
21 <p>The bindings in this section are closely related to the <em>text state parameters</em> in <str-PDF />.</p>
24 <dynamic-variable name="text_font">
25 <type><named-type name="Font" /></type>
26 <default><inline>FONT_HELVETICA</inline></default>
28 <p>Intended to be used when creating text using the built-in mechanisms of <str-PDF />.</p>
32 <dynamic-variable name="text_size">
33 <type><named-type name="Length" /></type>
34 <default><physical><scalar>10</scalar><unit>bp</unit></physical></default>
35 <constraint><self /> > <physical><scalar>0</scalar><unit>bp</unit></physical></constraint>
37 <p>Intended to be used as the size of text.</p>
41 <dynamic-variable name="text_horizontalscaling">
42 <type><named-type name="Float" /></type>
43 <default><scalar>1</scalar></default>
44 <constraint><self /> > <scalar>0</scalar></constraint>
46 <p>Horizontal scaling of the font.</p>
50 <dynamic-variable name="text_rendering">
51 <type><named-type name="TextRenderingMode" /></type>
53 <p>Text rendering mode.</p>
55 <p><em>Design note:</em> It would have been possible to split the rendering mode into two separate dynamic variables; one for stroking, and one for filling. One obvious benefit of this would have been that the special type <named-type name="TextRenderingMode" /> would not have been necessary. However, the rendering mode is usually perceived as one entity; controlling one of the two flags while not caring about the other seems very unlikely. This is why the two are kept together.</p>
63 <dynamic-variable name="text_knockout">
64 <type><named-type name="Boolean" /></type>
65 <default><const-false /></default>
67 <p>The text knockout mode. Refer to the <str-PDF /> reference for details.</p>
71 <dynamic-variable name="text_characterspacing">
72 <type><union-type><named-type name="Length" /> <named-type name="Float" /></union-type></type>
73 <default><physical><scalar>0</scalar><unit>bp</unit></physical></default>
75 <p>Extra space to add between characters.</p>
76 <p>A <named-type name="Float" /> is interpreted as a scaling of <dynamic name="text_size" />.</p>
80 <dynamic-variable name="text_wordspacing">
81 <type><union-type><named-type name="Length" /> <named-type name="Float" /></union-type></type>
82 <default><physical><scalar>0</scalar><unit>bp</unit></physical></default>
84 <p>Extra space to add at each space character.</p>
85 <p>A <named-type name="Float" /> is interpreted as a scaling of <dynamic name="text_size" />.</p>
89 <dynamic-variable name="text_leading">
90 <type><union-type><named-type name="Length" /> <named-type name="Float" /></union-type></type>
91 <default><scalar>1</scalar></default>
93 <p>The vertical distance between lines of text.</p>
94 <p>A <named-type name="Float" /> is interpreted as a scaling of <dynamic name="text_size" />.</p>
98 <dynamic-variable name="text_rise">
99 <type><union-type><named-type name="Length" /> <named-type name="Float" /></union-type></type>
100 <default><scalar>1</scalar></default>
102 <p>Vertical offset of the text from the normal baseline.</p>
103 <p>A <named-type name="Float" /> is interpreted as a scaling of <dynamic name="text_size" />.</p>