1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) INRIA - Djalel Abdemouche
5 * Copyright (C) INRIA - Jean-Baptiste silvy
7 * This file must be used under the terms of the CeCILL.
8 * This source file is licensed as described in the file COPYING, which
9 * you should have received as part of this distribution. The terms
10 * are also available at
11 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
14 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="text_properties">
16 <refname>text properties</refname>
17 <refpurpose>description of the Text entity
22 <title>Description</title>
23 <para>The Text entity is a leaf of the graphics entities hierarchy. This
24 entity defines the parameters for string drawing
30 <para>This property contains the handle of the parent. The parent of the
31 text entity should be of the type <literal>"Axes"</literal> or
32 <literal>"Compound"</literal>.
37 <term>children: </term>
40 This property contains a vector with the <literal>children</literal> of
41 the handle. However, text handles currently do not have any
42 <literal>children</literal>.
47 <term>visible: </term>
50 This field contains the <literal>visible</literal> property value for
51 the entity . It should be <literal>"on" </literal> or <literal>"off"</literal> .By
52 default, the text is visible, the value's property is
53 <literal>"on"</literal>. If <literal>"off"</literal> the text is not displayed on
61 <para>the matrix containing the strings of the object. The rows of the
62 matrix are displayed horizontally and the columns vertically.
65 Starting from Scilab 5.2, it is possible to write <link linkend="math_rendering_features_in_graphic">LaTeX or MathML expression</link>.
70 <term>alignment: </term>
72 <para>Specify how the strings are aligned in their columns. The value
73 must be <emphasis role="bold">'left'</emphasis>,<emphasis role="bold"> 'center' </emphasis>or <emphasis role="bold">'right'</emphasis>.
81 This field is the vector <literal>[x,y,[z]]</literal> of the origin of
82 the text in the data units of the axes.
90 This field takes the values <literal>"on"</literal> or
91 <literal>"off"</literal>. If <literal>"on"</literal> a box is draw around the text
92 with a line on its edge and a background.
97 <term>line_mode: </term>
99 <para>This boolean property allows to draw or not a line around the box
100 when the <literal>box</literal> property is <literal>"on"</literal>. If
101 <literal>line_mode</literal> is <literal>"off"</literal>, the line of the box is
107 <term>fill_mode: </term>
109 <para>This boolean property allows to draw or not the background of the
110 box when the <literal>box</literal> property is <literal>"on"</literal>. If
111 <literal>fill_mode</literal> is <literal>"off"</literal>, the background of the
112 box is not transparent.
117 <term>text_box: </term>
119 <para>A two dimensional vector specifying the size of a rectangle in user coordinates.
120 The rectangle is used when the text_box_mode property is set to
121 <emphasis role="bold">'centered'</emphasis> or <emphasis role="bold">'filled'</emphasis>.
126 <term>text_box_mode: </term>
129 May have three different value : <emphasis role="bold">'off'</emphasis>,
130 <emphasis role="bold">'centered'</emphasis> or <emphasis role="bold">'filled'</emphasis>. If <emphasis role="bold">'off'</emphasis>, the
131 strings are displayed using the given font and the data field
132 specifies the position of the lower-left point of the text. If
133 <emphasis role="bold">'centered'</emphasis>, the text is displayed in the middle of the
134 rectangle whose size is given by text_box. If <emphasis role="bold">'filled'</emphasis> the
135 font size of the strings will be expanded to fill the rectangle.
138 When using <emphasis role="bold">'off'</emphasis> or <emphasis role="bold">'centered'</emphasis> modes,
139 text size remains constant upon zooming. They are the best modes to create annotations
140 in a graph. On the contrary, when using the <emphasis role="bold">'filled'</emphasis> mode, the text size follow
141 the graphic scale. It is then possible to zoom upon text objects.
146 <term>auto_dimensionning: </term>
149 auto_dimensionning set to "off" is equivalent to text_box_mode set to "filled". If text_box_mode is "off" or "centered" then it implies that auto_dimensionning is "on".
154 <term>font_foreground: </term>
156 <para>This field contains the color used to display the characters of
157 the text. Its value should be a color index (relative to the current
163 <term>foreground: </term>
165 <para>This field contains the color used to display the line on the edge
166 of the box. Its value should be a color index (relative to the current
172 <term>background: </term>
174 <para>This field contains the color used to fill the box around of the
175 text. Its value should be a color index (relative to the current
181 <term>font_size: </term>
183 <para>It is a scalar specifying the displayed characters size.
184 If <literal>fractional_font</literal> property is <literal>"off"</literal>
185 only the integer part of the value is used.
186 For more information see <link linkend="graphics_fonts">graphics_fonts</link>.
191 <term>font_style: </term>
193 <para>Specifies the font used to display the character strings.
194 This is a positive integer referecing one of the loaded fonts.
195 Its value must be between 0, referecing the first font,
196 and the number of loaded fonts minus one, referencing the last font.
197 For more information see <link linkend="graphics_fonts">graphics_fonts</link>.
202 <term>fractional_font: </term>
205 This property specify whether text is displayed using fractional font sizes.
206 Its value must be either <literal>"on"</literal> or <literal>"off"</literal>.
207 If <literal>"on"</literal> the floating point value of <literal>font_size</literal>
208 is used for display and the font is anti-aliased. If <literal>"off"</literal> only the integer part is used
209 and the font is not smoothed.
214 <term>font_angle: </term>
216 <para>This property determines the orientation of the text string.
217 Specify value of rotation in degrees.
222 <term>clip_state: </term>
225 This field contains the <literal>clip_state</literal> property value for
226 the text. Its value should be :
231 <literal>"off"</literal> this means that the text is not
237 <literal>"clipgrf"</literal> this means that the text is clipped
238 outside the Axes box.
243 <literal>"on"</literal> this means that the text is clipped outside
244 the rectangle given by the property <literal>clip_box</literal>.
251 <term>clip_box: </term>
254 This field contains the <literal>clip_box</literal> property. Its value
255 should be an empty matrix if clip_state is "off" or the vector
256 <literal>[x,y,w,h</literal>] (upper-left point width height).
261 <term>user_data: </term>
263 <para>This field can be use to store any scilab variable in the text
264 data structure, and to retreive it.
271 <title>Examples</title>
272 <programlisting role="example"><![CDATA[
273 a=get("current_axes");
274 a.data_bounds=[0,0;1,1];
275 a.axes_visible = 'on' ;
277 xstring(0.5,0.5,"Scilab is not esilaB",0,0)
279 t=get("hdl") //get the handle of the newly created object
281 t.font_foreground=6; // change font properties
286 t.text=["SCILAB","is";"not","esilaB"] ; // change the text
287 t.font_angle=90 ; // turn the strings
289 t.text_box_mode = 'centered' ; // the text is now centered on [0.5,0.5].
290 t.alignment = 'center' ;
291 t.box = 'on' ; // draw a box around the text
293 // Only valid from Scilab 5.2
294 mathml="<mrow> <mfrac> <mrow> <mi>d</mi> <mi>y</mi> </mrow> <mrow> <mi>d</mi> <mi>x</mi> </mrow> </mfrac> <mo>=</mo> <mfrac> <mn>1</mn> <msup> <mi>y</mi> <mn>2</mn> </msup> </mfrac> </mrow>";
295 t.text=["SCILAB","can write LaTeX :","$\frac{abc}{xyz}$";"or","MathML :",mathml] ;
300 a=get("current_axes");
301 a.data_bounds=[0,0;1,1];
302 a.axes_visible = 'on' ;
304 xstring(0,0,"Scilab is not esilaB",0,0)
313 <refsection role="see also">
314 <title>See Also</title>
315 <simplelist type="inline">
317 <link linkend="set">set</link>
320 <link linkend="get">get</link>
323 <link linkend="delete">delete</link>
326 <link linkend="xtitle">xtitle</link>
329 <link linkend="graphics_entities">graphics_entities</link>