File: scripterapi-textframes.html

package info (click to toggle)
scribus-doc 1.2.1-2
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 2,920 kB
  • ctags: 374
  • sloc: makefile: 387; xml: 110
file content (108 lines) | stat: -rw-r--r-- 8,571 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<qt>
<title>Handling Text Frames</title>
<h2>Handling Text Frames</h2>

<dl>

<dt><a name="-deleteText"><strong>deleteText</strong></a>(...)</dt>
<dd><code><a href="#-deleteText">deleteText</a>(["name"])</code>
<p>Deletes any text in the text frame "name". If there is some text selected, only the selected text will be deleted. If "name" is not given the currently selected item is used.</p></dd>
	
<dt><a name="-getAllText"><strong>getAllText</strong></a>(...)</dt>
<dd><code><a href="#-getAllText">getAllText</a>(["name"]) -&gt; string</code>
<p>Returns the text of the text frame "name" and of all text frames which are linked with this frame. If this textframe has some text selected, the selected text is returned. If "name" is not given the currently selected item is used.</p></dd></dt>
	
<dt><a name="-getColumnGap"><strong>getColumnGap</strong></a>(...)</dt>
<dd><code><a href="#-getColumnGap">getColumnGap</a>(["name"]) -&gt; float</code>
<p>Returns the column gap size of the text frame "name" expressed in points. If "name" is not given the currently selected item is used.</p></dd>
	
<dt><a name="-getColumns"><strong>getColumns</strong></a>(...)</dt>
<dd><code><a href="#-getColumns">getColumns</a>(["name"]) -&gt; integer</code> 
<p>Gets the number of columns of the text frame "name". If "name" is not given the currently selected item is used.</p></dd> 
	
<dt><a name="-getFont"><strong>getFont</strong></a>(...)</dt>
<dd><code><a href="#-getFont">getFont</a>(["name"]) -&gt; string</code>
<p>Returns the font name for the text frame "name". If this text frame has some text selected the value assigned to the first character of the selection is returned. If "name" is not given the currently selected item is used.</p></dd> 
	
<dt><a name="-getFontSize"><strong>getFontSize</strong></a>(...)</dt>
<dd><code><a href="#-getFontSize">getFontSize</a>(["name"]) -&gt; float</code>
<p>Returns the font size in points for the text frame "name". If this text frame has some text selected the value assigned to the first character of the selection is returned. If "name" is not given the currently selected item is used.</p></dd>
	
<dt><a name="-getLineSpacing"><strong>getLineSpacing</strong></a>(...)</dt>
<dd><code><a href="#-getLineSpacing">getLineSpacing</a>(["name"]) -&gt; float</code>
<p>Returns the line spacing ("leading") of the text frame "name" expressed in points. If "name" is not given the currently selected item is used.</p></dd>
	
<dt><a name="-getText"><strong>getText</strong></a>(...)</dt>
<dd><code><a href="#-getText">getText</a>(["name"]) -&gt; string</code>
<p>Returns the text of the text frame "name". If this text frame has some text selected, the selected text is returned. All text in the frame, not just currently visible text, is returned. If "name" is not given the currently selected item is used.</p></dd>

<dt><a name="-getTextColor"><strong>getTextColor</strong></a>(...)</dt>
<dd><code><a href="#-getLineColor">getLineColor</a>(["name"]) -&gt; string</code>
<p>Returns the name of the line color of the object "name". If "name" is not given the currently selected item is used.</p></dd>

<dt><a name="-getTextLength"><strong>getTextLength</strong></a>(...)</dt>
<dd><code><a href="#-getTextLength">getTextLength</a>(["name"]) -&gt; integer</code>
<p>Returns the length of the text in the text frame "name". If "name" is not given the currently selected item is used.</p></dd>

<dt><a name="-getTextShade"><strong>getTextShade</strong></a>(...)</dt>
<dd><code><a href="#-getLineShade">getLineShade</a>(["name"]) -&gt; integer</code>
<p>Returns the shading value of the line color of the object "name". If "name" is not given the currently selected item is used.</p></dd>
	
<dt><a name="-insertText"><strong>insertText</strong></a>(...)</dt>
<dd><code><a href="#-insertText">insertText</a>("text", pos, ["name"])</code>
<p>Inserts the text "text" at the position "pos" into the text frame. Text must be UTF encoded (see <a href="#-setText">setText</a>() as reference) The first character has an index of 0. "name" If "name" is not given the currently selected Item is used.</p>
<p>May throw IndexError for an insertion out of bounds.</p></dd>
	
<dt><a name="-selectText"><strong>selectText</strong></a>(...)</dt>
<dd><code><a href="#-selectText">selectText</a>(start, count, ["name"])</code>
<p>Selects "count" characters of text in the text frame "name" starting from the character "start". Character counting starts at 0. If "count" is zero, any text selection will be cleared.  If "name" is not given the currently selected item is used.</p>
<p>May throw IndexError if the selection is outside the bounds of the text.</p></dd>
	
<dt><a name="-setColumns"><strong>setColumns</strong></a>(...)</dt>
<dd><code><a href="#-setColumns">setColumns</a>(nr, ["name"])</code>
<p>Sets the number of columns of the text frame "name" to the integer "nr". If "name" is not given the currently selected item is used.</p>
<p>May throw ValueError if number of columns is not at least one.</p></dd>
	
<dt><a name="-setColumnGap"><strong>setColumnGap</strong></a>(...)</dt>
<dd><code><a href="#-setColumnGap">setColumnGap</a>(size, ["name"])</code>
<p>Sets the column gap of the text frame "name" to the value "size". If "name" is not given the currently selected item is used.</p>
<p>May throw ValueError if the column gap is out of bounds (must be positive).</p></dd> 
	
<dt><a name="-setFont"><strong>setFont</strong></a>(...)</dt>
<dd><code><a href="#-setFont">setFont</a>("font", ["name"])</code>
<p>Sets the font of the text frame "name" to "font". If there is some text selected only the selected text is changed.  If "name" is not given the currently selected item is used.</p>
<p>May throw ValueError if the font cannot be found.</p></dd>

<dt><a name="-setFontSize"><strong>setFontSize</strong></a>(...)</dt>
<dd><code><a href="#-setFontSize">setFontSize</a>(size, ["name"])</code>
<p>Sets the font size of the text frame "name" to "size". "size" is treated as a value in points. If there is some text selected only the selected text is changed. "size" must be in the range 1 to 512. If "name" is not given the currently selected item is used.</p>
<p>May throw ValueError for a font size that's out of bounds.</p></dd>
	
<dt><a name="-setLineSpacing"><strong>setLineSpacing</strong></a>(...)</dt>
<dd><code><a href="#-setLineSpacing">setLineSpacing</a>(size, ["name"])</code>
<p>Sets the line spacing ("leading") of the text frame "name" to "size". "size" is a value in points. If "name" is not given the currently selected item is used.</p>
<p>May throw ValueError if the line spacing is out of bounds.</p></dd>
	
<dt><a name="-setText"><strong>setText</strong></a>(...)</dt>
<dd><code><a href="#-setText">setText</a>("text", ["name"])</code>
<p>Sets the text of the text frame "name" to the text of the string "text". Text must be UTF8 encoded - use e.g. unicode(text, 'iso-8859-2'). See the FAQ for more details. If "name" is not given the currently selected item is used.</p></dd>

<dt><a name="-setTextAlignment"><strong>setTextAlignment</strong></a>(...)</dt>
<dd><code><a href="#-setTextAlignment">setTextAlignment</a>(align, ["name"])</code>
<p>Sets the text alignment of the text frame "name" to the specified alignment. If "name" is not given the currently selected item is used. "align" should be one of the ALIGN_ constants defined in this module - see dir(scribus).</p> 
<p>May throw ValueError for an invalid alignment constant.</p></dd>

<dt><a name="-setTextColor"><strong>setTextColor</strong></a>(...)</dt>
<dd><code><a href="#-setTextColor">setTextColor</a>("color", ["name"])</code>
<p>Sets the text color of the text frame "name" to the color "color". If there is some text selected only the selected text is changed. If "name" is not given the currently selected item is used.</p></dd>

<dt><a name="-setTextShade"><strong>setTextShade</strong></a>(...)</dt>
<dd><code><a href="#-setTextShade">setTextShade</a>(shade, ["name"])</code>
<p>Sets the shading of the text color of the object "name" to "shade". If there is some text selected only the selected text is changed. "shade" must be an integer value in the range from 0 (lightest) to 100 (full color intensity). If "name" is not given the currently selected item is used.</p></dd>

<dt><a name="-setTextStroke"><strong>setTextStroke</strong></a>(...)</dt>
<dd><code><a href="#-setTextStroke">setTextStroke</a>("color", ["name"])</code>
<p>Set "color" of the text stroke. If "name" is not given the currently selected item is used.</p></dd>

</dl>
</qt>