File: gimptexttool.xml

package info (click to toggle)
gimp 2.2.13-1etch4
  • links: PTS
  • area: main
  • in suites: etch
  • size: 94,832 kB
  • ctags: 47,113
  • sloc: ansic: 524,858; xml: 36,798; lisp: 9,870; sh: 9,409; makefile: 7,923; python: 2,674; perl: 2,589; yacc: 520; lex: 334
file content (363 lines) | stat: -rw-r--r-- 21,562 bytes parent folder | download | duplicates (2)
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 
               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="libgimp-gimptexttool">
<refmeta>
<refentrytitle role="top_of_page">gimptexttool</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBGIMP Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>gimptexttool</refname>
<refpurpose>Functions for controlling the text tool.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



<link linkend="gint32">gint32</link>      <link linkend="gimp-text-fontname">gimp_text_fontname</link>              (<link linkend="gint32">gint32</link> image_ID,
                                             <link linkend="gint32">gint32</link> drawable_ID,
                                             <link linkend="gdouble">gdouble</link> x,
                                             <link linkend="gdouble">gdouble</link> y,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> border,
                                             <link linkend="gboolean">gboolean</link> antialias,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *fontname);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-text-get-extents-fontname">gimp_text_get_extents_fontname</link>  (const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *fontname,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height,
                                             <link linkend="gint">gint</link> *ascent,
                                             <link linkend="gint">gint</link> *descent);
<link linkend="gint32">gint32</link>      <link linkend="gimp-text">gimp_text</link>                       (<link linkend="gint32">gint32</link> image_ID,
                                             <link linkend="gint32">gint32</link> drawable_ID,
                                             <link linkend="gdouble">gdouble</link> x,
                                             <link linkend="gdouble">gdouble</link> y,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> border,
                                             <link linkend="gboolean">gboolean</link> antialias,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *foundry,
                                             const <link linkend="gchar">gchar</link> *family,
                                             const <link linkend="gchar">gchar</link> *weight,
                                             const <link linkend="gchar">gchar</link> *slant,
                                             const <link linkend="gchar">gchar</link> *set_width,
                                             const <link linkend="gchar">gchar</link> *spacing,
                                             const <link linkend="gchar">gchar</link> *registry,
                                             const <link linkend="gchar">gchar</link> *encoding);
<link linkend="gboolean">gboolean</link>    <link linkend="gimp-text-get-extents">gimp_text_get_extents</link>           (const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *foundry,
                                             const <link linkend="gchar">gchar</link> *family,
                                             const <link linkend="gchar">gchar</link> *weight,
                                             const <link linkend="gchar">gchar</link> *slant,
                                             const <link linkend="gchar">gchar</link> *set_width,
                                             const <link linkend="gchar">gchar</link> *spacing,
                                             const <link linkend="gchar">gchar</link> *registry,
                                             const <link linkend="gchar">gchar</link> *encoding,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height,
                                             <link linkend="gint">gint</link> *ascent,
                                             <link linkend="gint">gint</link> *descent);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
Functions for controlling the text tool.

</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="gimp-text-fontname" role="function"/>gimp_text_fontname ()</title>
<indexterm><primary>gimp_text_fontname</primary></indexterm><programlisting><link linkend="gint32">gint32</link>      gimp_text_fontname              (<link linkend="gint32">gint32</link> image_ID,
                                             <link linkend="gint32">gint32</link> drawable_ID,
                                             <link linkend="gdouble">gdouble</link> x,
                                             <link linkend="gdouble">gdouble</link> y,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> border,
                                             <link linkend="gboolean">gboolean</link> antialias,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *fontname);</programlisting>
<para>
Add text at the specified location as a floating selection or a new
layer.
</para>
<para>
This tool requires a fontname matching an installed PangoFT2 font.
You can specify the fontsize in units of pixels or points, and the
appropriate metric is specified using the size_type argument. The x
and y parameters together control the placement of the new text by
specifying the upper left corner of the text bounding box. If the
specified drawable parameter is valid, the text will be created as a
floating selection attached to the drawable. If the drawable
parameter is not valid (-1), the text will appear as a new layer.
Finally, a border can be specified around the final rendered text.
The border is measured in pixels.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>image_ID</parameter>&nbsp;:</term>
<listitem><simpara> The image.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable_ID</parameter>&nbsp;:</term>
<listitem><simpara> The affected drawable: (-1 for a new text layer).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara> The x coordinate for the left of the text bounding box.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara> The y coordinate for the top of the text bounding box.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> The text to generate (in UTF-8 encoding).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>border</parameter>&nbsp;:</term>
<listitem><simpara> The size of the border.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>antialias</parameter>&nbsp;:</term>
<listitem><simpara> Antialiasing.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> The size of text in either pixels or points.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size_type</parameter>&nbsp;:</term>
<listitem><simpara> The units of specified size.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fontname</parameter>&nbsp;:</term>
<listitem><simpara> The name of the font.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The new text layer or -1 if no layer was created.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-text-get-extents-fontname" role="function"/>gimp_text_get_extents_fontname ()</title>
<indexterm><primary>gimp_text_get_extents_fontname</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_text_get_extents_fontname  (const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *fontname,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height,
                                             <link linkend="gint">gint</link> *ascent,
                                             <link linkend="gint">gint</link> *descent);</programlisting>
<para>
Get extents of the bounding box for the specified text.
</para>
<para>
This tool returns the width and height of a bounding box for the
specified text string with the specified font information. Ascent
and descent for the specified font are returned as well.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> The text to generate (in UTF-8 encoding).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> The size of text in either pixels or points.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size_type</parameter>&nbsp;:</term>
<listitem><simpara> The units of specified size.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>fontname</parameter>&nbsp;:</term>
<listitem><simpara> The name of the font.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> The width of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> The height of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ascent</parameter>&nbsp;:</term>
<listitem><simpara> The ascent of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>descent</parameter>&nbsp;:</term>
<listitem><simpara> The descent of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-text" role="function" condition="deprecated:"/>gimp_text ()</title>
<indexterm role="deprecated"><primary>gimp_text</primary></indexterm><programlisting><link linkend="gint32">gint32</link>      gimp_text                       (<link linkend="gint32">gint32</link> image_ID,
                                             <link linkend="gint32">gint32</link> drawable_ID,
                                             <link linkend="gdouble">gdouble</link> x,
                                             <link linkend="gdouble">gdouble</link> y,
                                             const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gint">gint</link> border,
                                             <link linkend="gboolean">gboolean</link> antialias,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *foundry,
                                             const <link linkend="gchar">gchar</link> *family,
                                             const <link linkend="gchar">gchar</link> *weight,
                                             const <link linkend="gchar">gchar</link> *slant,
                                             const <link linkend="gchar">gchar</link> *set_width,
                                             const <link linkend="gchar">gchar</link> *spacing,
                                             const <link linkend="gchar">gchar</link> *registry,
                                             const <link linkend="gchar">gchar</link> *encoding);</programlisting>
<warning><para><literal>gimp_text</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
This procedure is deprecated! Use <link linkend="gimp-text-fontname"><function>gimp_text_fontname()</function></link> instead.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>image_ID</parameter>&nbsp;:</term>
<listitem><simpara> The image.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable_ID</parameter>&nbsp;:</term>
<listitem><simpara> The affected drawable: (-1 for a new text layer).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>x</parameter>&nbsp;:</term>
<listitem><simpara> The x coordinate for the left of the text bounding box.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>y</parameter>&nbsp;:</term>
<listitem><simpara> The y coordinate for the top of the text bounding box.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> The text to generate (in UTF-8 encoding).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>border</parameter>&nbsp;:</term>
<listitem><simpara> The size of the border.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>antialias</parameter>&nbsp;:</term>
<listitem><simpara> Antialiasing.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> The size of text in either pixels or points.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size_type</parameter>&nbsp;:</term>
<listitem><simpara> The units of specified size.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>foundry</parameter>&nbsp;:</term>
<listitem><simpara> The font foundry.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>family</parameter>&nbsp;:</term>
<listitem><simpara> The font family.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>weight</parameter>&nbsp;:</term>
<listitem><simpara> The font weight.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>slant</parameter>&nbsp;:</term>
<listitem><simpara> The font slant.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>set_width</parameter>&nbsp;:</term>
<listitem><simpara> The font set-width.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>spacing</parameter>&nbsp;:</term>
<listitem><simpara> The font spacing.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>registry</parameter>&nbsp;:</term>
<listitem><simpara> The font registry.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>encoding</parameter>&nbsp;:</term>
<listitem><simpara> The font encoding.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> The new text layer or -1 if no layer was created.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="gimp-text-get-extents" role="function" condition="deprecated:"/>gimp_text_get_extents ()</title>
<indexterm role="deprecated"><primary>gimp_text_get_extents</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>    gimp_text_get_extents           (const <link linkend="gchar">gchar</link> *text,
                                             <link linkend="gdouble">gdouble</link> size,
                                             <link linkend="GimpSizeType">GimpSizeType</link> size_type,
                                             const <link linkend="gchar">gchar</link> *foundry,
                                             const <link linkend="gchar">gchar</link> *family,
                                             const <link linkend="gchar">gchar</link> *weight,
                                             const <link linkend="gchar">gchar</link> *slant,
                                             const <link linkend="gchar">gchar</link> *set_width,
                                             const <link linkend="gchar">gchar</link> *spacing,
                                             const <link linkend="gchar">gchar</link> *registry,
                                             const <link linkend="gchar">gchar</link> *encoding,
                                             <link linkend="gint">gint</link> *width,
                                             <link linkend="gint">gint</link> *height,
                                             <link linkend="gint">gint</link> *ascent,
                                             <link linkend="gint">gint</link> *descent);</programlisting>
<warning><para><literal>gimp_text_get_extents</literal> is deprecated and should not be used in newly-written code.</para></warning>
<para>
This procedure is deprecated! Use <link linkend="gimp-text-get-extents-fontname"><function>gimp_text_get_extents_fontname()</function></link>
instead.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>text</parameter>&nbsp;:</term>
<listitem><simpara> The text to generate (in UTF-8 encoding).
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> The size of text in either pixels or points.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size_type</parameter>&nbsp;:</term>
<listitem><simpara> The units of specified size.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>foundry</parameter>&nbsp;:</term>
<listitem><simpara> The font foundry.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>family</parameter>&nbsp;:</term>
<listitem><simpara> The font family.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>weight</parameter>&nbsp;:</term>
<listitem><simpara> The font weight.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>slant</parameter>&nbsp;:</term>
<listitem><simpara> The font slant.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>set_width</parameter>&nbsp;:</term>
<listitem><simpara> The font set-width.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>spacing</parameter>&nbsp;:</term>
<listitem><simpara> The font spacing.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>registry</parameter>&nbsp;:</term>
<listitem><simpara> The font registry.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>encoding</parameter>&nbsp;:</term>
<listitem><simpara> The font encoding.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> The width of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> The height of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ascent</parameter>&nbsp;:</term>
<listitem><simpara> The ascent of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>descent</parameter>&nbsp;:</term>
<listitem><simpara> The descent of the specified font.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> TRUE on success.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>