Tizen Native API

This group provides functions that operate on single line, single style text objects.

For multiline and multiple style text, see Textblock Object Functions.

Remarks:
We do not guarantee any proper results if you create a Text object without setting the evas engine.

Functions

Evas_Objectevas_object_text_add (Evas *e)
 Creates a new text object on the provided canvas.
void evas_object_text_font_source_set (Evas_Object *obj, const char *font)
 Sets the font (source) file to be used on a given text object.
const char * evas_object_text_font_source_get (const Evas_Object *obj)
 Gets the font file's path which is being used on a given text object.
void evas_object_text_font_set (Evas_Object *obj, const char *font, Evas_Font_Size size)
 Sets the font family and size on a given text object.
void evas_object_text_font_get (const Evas_Object *obj, const char **font, Evas_Font_Size *size)
 Gets the font family and size in use on a given text object.
void evas_object_text_text_set (Evas_Object *obj, const char *text)
 Sets the text string to be displayed by the given text object.
const char * evas_object_text_text_get (const Evas_Object *obj)
 Gets the text string currently being displayed by the given text object.
void evas_object_text_bidi_delimiters_set (Evas_Object *obj, const char *delim)
 Sets the BiDi delimiters used in the textblock.
const char * evas_object_text_bidi_delimiters_get (const Evas_Object *obj)
 Gets the BiDi delimiters used in the textblock.
void evas_object_text_ellipsis_set (Evas_Object *obj, double ellipsis)
 Sets the ellipsis that should be used for the text object.
double evas_object_text_ellipsis_get (const Evas_Object *obj)
 Gets the ellipsis currently set on the text object.
Eina_Bool evas_object_text_char_pos_get (const Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
 Gets the position and dimension information of a character within a text Evas_Object.
int evas_object_text_last_up_to_pos (const Evas_Object *obj, Evas_Coord x, Evas_Coord y)
 Gets the logical position of the last char in the text up to the given position.
This is NOT the position of the last char because of the possibility of RTL in the text.
Evas_Text_Style_Type evas_object_text_style_get (const Evas_Object *obj)
 Gets the style on use on the given text object.
void evas_object_text_style_set (Evas_Object *obj, Evas_Text_Style_Type type)
 Sets the style to apply on the given text object.
void evas_object_text_shadow_color_set (Evas_Object *obj, int r, int g, int b, int a)
 Sets the shadow color for the given text object.
void evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a)
 Gets the shadow color for the given text object.
void evas_object_text_glow_color_set (Evas_Object *obj, int r, int g, int b, int a)
 Sets the glow color for the given text object.
void evas_object_text_glow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a)
 Gets the glow color for the given text object.
void evas_object_text_glow2_color_set (Evas_Object *obj, int r, int g, int b, int a)
 Sets the 'glow 2' color for the given text object.
void evas_object_text_glow2_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a)
 Gets the 'glow 2' color for the given text object.
void evas_object_text_outline_color_set (Evas_Object *obj, int r, int g, int b, int a)
 Sets the outline color for the given text object.
void evas_object_text_outline_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a)
 Gets the outline color for the given text object.
void evas_object_text_style_pad_get (const Evas_Object *obj, int *l, int *r, int *t, int *b)
 Gets the text style pad of a text object.
Evas_BiDi_Direction evas_object_text_direction_get (const Evas_Object *obj)
 Gets the direction of the text currently being displayed in the text object.
void evas_object_text_filter_program_set (Evas_Object *obj, const char *arg)
 Sets an Evas filter program on this Text Object.
void evas_object_text_filter_source_set (Evas_Object *obj, const char *name, Evas_Object *source)
 Binds an object to use as a mask or texture with Evas Filters. This automatically creates a new RGBA buffer containing the source object's pixels (as it is rendered).

Typedefs

typedef enum _Evas_Text_Style_Type Evas_Text_Style_Type

Defines

#define EVAS_TEXT_STYLE_BASIC_SET(x, s)   do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0)
 Definition for text style type creation macro. Use style types on the 's' arguments, being 'x' your style variable.
#define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s)   do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0)
 Definition for text style type creation macro. This one imposes shadow directions on the style type variable -- use the EVAS_TEXT_STYLE_SHADOW_DIRECTION_* values on 's', incrementally.

Typedef Documentation

Types of styles to be applied on text objects. The EVAS_TEXT_STYLE_SHADOW_DIRECTION_* ones are to be ORed together with others imposing shadow, to change shadow's direction


Enumeration Type Documentation

Types of styles to be applied on text objects. The EVAS_TEXT_STYLE_SHADOW_DIRECTION_* ones are to be ORed together with others imposing shadow, to change shadow's direction

Enumerator:
EVAS_TEXT_STYLE_PLAIN 

Plain, standard text

EVAS_TEXT_STYLE_SHADOW 

Text with shadow underneath

EVAS_TEXT_STYLE_OUTLINE 

Text with an outline

EVAS_TEXT_STYLE_SOFT_OUTLINE 

Text with a soft outline

EVAS_TEXT_STYLE_GLOW 

Text with a glow effect

EVAS_TEXT_STYLE_OUTLINE_SHADOW 

Text with both outline and shadow effects

EVAS_TEXT_STYLE_FAR_SHADOW 

Text with (far) shadow underneath

EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW 

Text with outline and soft shadow effects combined

EVAS_TEXT_STYLE_SOFT_SHADOW 

Text with (soft) shadow underneath

EVAS_TEXT_STYLE_FAR_SOFT_SHADOW 

Text with (far soft) shadow underneath

EVAS_TEXT_STYLE_TIZEN_SOFT_GLOW_SHADOW 

Tizen::Graphics::Effect::EFFECT_FOR_TEXT_ON_HOME_SCREEN_ICON

EVAS_TEXT_STYLE_TIZEN_SHADOW 

Tizen::Graphics::Effect::EFFECT_FOR_TEXT_ON_DYNAMIC_BOX_IMPORT_IMAGE

EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT 

Tizen::Graphics::Effect::EFFECT_FOR_TEXT_ON_DYNAMIC_BOX_IMAGE Shadow growing to bottom right

EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM 

Shadow growing to the bottom

EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT 

Shadow growing to bottom left

EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT 

Shadow growing to the left

EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT 

Shadow growing to top left

EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP 

Shadow growing to the top

EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT 

Shadow growing to top right

EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT 

Shadow growing to the right


Function Documentation

Creates a new text object on the provided canvas.

Since :
2.3.1
Remarks:
Text objects are for simple, single line text elements. If you want more elaborated text blocks, see Textblock Object Functions.
Parameters:
[in]eThe canvas to create the text object on
Returns:
A pointer to a new text object on success,
otherwise NULL on error
See also:
evas_object_text_font_source_set()
evas_object_text_font_set()
evas_object_text_text_set()
const char* evas_object_text_bidi_delimiters_get ( const Evas_Object obj)

Gets the BiDi delimiters used in the textblock.

Since (EFL) :
1.1
Since :
2.3.1
Remarks:
BiDi delimiters are use for in-paragraph separation of bidi segments. This is useful for example in recipients fields of e-mail clients where bidi oddities can occur when mixing RTL and LTR.
Parameters:
[in]objThe given text object
Returns:
A null terminated string of delimiters, for example, ",|",
otherwise NULL if empty
void evas_object_text_bidi_delimiters_set ( Evas_Object obj,
const char *  delim 
)

Sets the BiDi delimiters used in the textblock.

Since (EFL) :
1.1
Since :
2.3.1
Remarks:
BiDi delimiters are use for in-paragraph separation of bidi segments. This is useful for example in recipients fields of e-mail clients where bidi oddities can occur when mixing RTL and LTR.
Parameters:
[in]objThe given text object
[in]delimA null terminated string of delimiters, for example ",|"
Eina_Bool evas_object_text_char_pos_get ( const Evas_Object obj,
int  pos,
Evas_Coord cx,
Evas_Coord cy,
Evas_Coord cw,
Evas_Coord ch 
)

Gets the position and dimension information of a character within a text Evas_Object.

This function is used to obtain the X, Y, width and height of a the character located at pos within the Evas_Object obj. obj must be a text object as created with evas_object_text_add(). Any of the Evas_Coord parameters (cx, cy, cw, ch) may be NULL in which case no value is assigned to that parameter.

Since :
2.3.1
Parameters:
[in]objThe text object to retrieve position information for
[in]posThe character position to request co-ordinates for
[out]cxA pointer to an Evas_Coord to store the X value in (can be NULL)
[out]cyA pointer to an Evas_Coord to store the Y value in (can be NULL)
[out]cwA pointer to an Evas_Coord to store the Width value in (can be NULL)
[out]chA pointer to an Evas_Coord to store the Height value in (can be NULL)
Returns:
EINA_FALSE if the information is obtained successfully, otherwise EINA_TRUE on error
Evas_BiDi_Direction evas_object_text_direction_get ( const Evas_Object obj)

Gets the direction of the text currently being displayed in the text object.

Since :
2.3.1
Parameters:
[in]objThe given evas text object
Returns:
The direction of the text
double evas_object_text_ellipsis_get ( const Evas_Object obj)

Gets the ellipsis currently set on the text object.

Since (EFL) :
1.8
Since :
2.3.1
Parameters:
[in]objThe given text object
Returns:
The ellipsis set on the text object
See also:
evas_object_text_ellipsis_set()
void evas_object_text_ellipsis_set ( Evas_Object obj,
double  ellipsis 
)

Sets the ellipsis that should be used for the text object.

This is a value between 0.0 and 1.0 indicating the position of the text to be shown. 0.0 means the start is shown and the end trimmed, 1.0 means the beginning is trimmed and the end is shown, and any value in between causes ellipsis to be added in both the end of the text and the requested part to be shown.

Since (EFL) :
1.8
Since :
2.3.1
Remarks:
-1.0 means ellipsis is turned off.
Parameters:
[in]objThe given text object
[in]ellipsisThe ellipsis
void evas_object_text_filter_program_set ( Evas_Object obj,
const char *  arg 
)

Sets an Evas filter program on this Text Object.

Since (EFL) :
1.9. Backported for Tizen (1.7.99).
Since :
2.3.1
Remarks:
If the program fails to compile (syntax error, invalid buffer name, etc...), the standard text effects are applied instead (SHADOW, etc...).
EXPERIMENTAL FEATURE. This is an unstable API, please use this only for testing purposes.
Parameters:
[in]objThe given evas text object
[in]argThe program code, as defined by the "Evas filters script language". Pass NULL to remove the former program and switch back to the standard text effects.
void evas_object_text_filter_source_set ( Evas_Object obj,
const char *  name,
Evas_Object source 
)

Binds an object to use as a mask or texture with Evas Filters. This automatically creates a new RGBA buffer containing the source object's pixels (as it is rendered).

Since (EFL) :
1.9. Backported for Tizen (1.7.99).
Since :
2.3.1
Remarks:
EXPERIMENTAL FEATURE. This is an unstable API, please use this only for testing purposes.
Parameters:
[in]objThe given evas object
[in]nameThe object name as used in the program code
[in]sourceThe evas object to use through proxy rendering
See also:
evas_obj_text_filter_program_set
void evas_object_text_font_get ( const Evas_Object obj,
const char **  font,
Evas_Font_Size size 
)

Gets the font family and size in use on a given text object.

This function allows the font name and size of a text object to be queried. Be aware that the font name string is still owned by Evas and should not have free() called on it by the caller of the function.

Since :
2.3.1
Parameters:
[in]objThe evas text object to query for font information
[out]fontA pointer to the location to store the font name in
[out]sizeA pointer to the location to store the font size in
See also:
evas_object_text_font_set()
void evas_object_text_font_set ( Evas_Object obj,
const char *  font,
Evas_Font_Size  size 
)

Sets the font family and size on a given text object.

This function allows the font name and size of a text object to be set. The font string has to follow fontconfig's convention on naming fonts, as it is the underlying library used to query system fonts by Evas (see the fc-list command's output, on your system, to get an idea).

Since :
2.3.1
Parameters:
[in]objThe text object to set font for
[in]fontThe font (family) name
[in]sizeThe font size, in points
See also:
evas_object_text_font_get()
evas_object_text_font_source_set()
const char* evas_object_text_font_source_get ( const Evas_Object obj)

Gets the font file's path which is being used on a given text object.

Since :
2.3.1
Parameters:
[in]objThe text object to set the font for
Returns:
The font file's path
See also:
evas_object_text_font_get() for more details
void evas_object_text_font_source_set ( Evas_Object obj,
const char *  font 
)

Sets the font (source) file to be used on a given text object.

This function allows the font file to be explicitly set for a given text object, overriding system lookup, which first occurs in the given file's contents.

Since :
2.3.1
Parameters:
[in]objThe text object to set font for
[in]fontThe font file's path
See also:
evas_object_text_font_get()
void evas_object_text_glow2_color_get ( const Evas_Object obj,
int *  r,
int *  g,
int *  b,
int *  a 
)

Gets the 'glow 2' color for the given text object.

Since :
2.3.1
Remarks:
Use NULL pointers on the color components that you are not interested in: they are ignored by the function.
Parameters:
[in]objThe given Evas text object
[out]rThe pointer to variable to hold the red component of the given color
[out]gThe pointer to variable to hold the green component of the given color
[out]bThe pointer to variable to hold the blue component of the given color
[out]aThe pointer to variable to hold the alpha component of the given color
See also:
evas_object_text_glow2_color_set() for more details.
void evas_object_text_glow2_color_set ( Evas_Object obj,
int  r,
int  g,
int  b,
int  a 
)

Sets the 'glow 2' color for the given text object.

Since :
2.3.1
Remarks:
'Glow 2' effects, which are glowing colors decorating the text's (immediate) surroundings, are shown if the object is set to the EVAS_TEXT_STYLE_GLOW style. See also evas_object_text_glow_color_set().
Parameters:
[in]objThe given Evas text object
[in]rThe red component of the given color
[in]gThe green component of the given color
[in]bThe blue component of the given color
[in]aThe alpha component of the given color
See also:
evas_object_text_glow2_color_get()
void evas_object_text_glow_color_get ( const Evas_Object obj,
int *  r,
int *  g,
int *  b,
int *  a 
)

Gets the glow color for the given text object.

Since :
2.3.1
Remarks:
Use NULL pointers on the color components that you are not interested in: they are ignored by the function.
Parameters:
[in]objThe given Evas text object.
[out]rThe pointer to variable to hold the red component of the given color
[out]gThe pointer to variable to hold the green component of the given color
[out]bThe pointer to variable to hold the blue component of the given color
[out]aThe pointer to variable to hold the alpha component of the given color
See also:
evas_object_text_glow_color_set() for more details.
void evas_object_text_glow_color_set ( Evas_Object obj,
int  r,
int  g,
int  b,
int  a 
)

Sets the glow color for the given text object.

Since :
2.3.1
Remarks:
Glow effects, which are glowing colors decorating the text's surroundings, are shown if the object is set to the EVAS_TEXT_STYLE_GLOW style.
Glow effects are placed from a short distance of the text itself, but no touching it. For glowing effects right on the borders of the glyphs, see 'glow 2' effects (evas_object_text_glow2_color_set()).
Parameters:
[in]objThe given Evas text object
[in]rThe red component of the given color
[in]gThe green component of the given color
[in]bThe blue component of the given color
[in]aThe alpha component of the given color
See also:
evas_object_text_glow_color_get()

Gets the logical position of the last char in the text up to the given position.
This is NOT the position of the last char because of the possibility of RTL in the text.

Since :
2.3.1
Parameters:
[in]objThe text object
[in]xThe X co-ordinate
[in]yThe Y co-ordinate
Returns:
The logical The positoin of the last char in the text up to the given position
void evas_object_text_outline_color_get ( const Evas_Object obj,
int *  r,
int *  g,
int *  b,
int *  a 
)

Gets the outline color for the given text object.

Since :
2.3.1
Remarks:
Use NULL pointers on the color components that you are not interested in: they are ignored by the function.
Parameters:
[in]objThe given Evas text object
[out]rThe pointer to the variable to hold the red component of the given color
[out]gThe pointer to the variable to hold the green component of the given color
[out]bThe pointer to the variable to hold the blue component of the given color
[out]aThe pointer to the variable to hold the alpha component of the given color
See also:
evas_object_text_outline_color_set() for more details.
void evas_object_text_outline_color_set ( Evas_Object obj,
int  r,
int  g,
int  b,
int  a 
)

Sets the outline color for the given text object.

Since :
2.3.1
Remarks:
Outline effects (colored lines around text glyphs) are just shown if the object is set to one of the following styles:
Parameters:
[in]objThe given Evas text object
[in]rThe red component of the given color
[in]gThe green component of the given color
[in]bThe blue component of the given color
[in]aThe alpha component of the given color
See also:
evas_object_text_outline_color_get()
void evas_object_text_shadow_color_get ( const Evas_Object obj,
int *  r,
int *  g,
int *  b,
int *  a 
)

Gets the shadow color for the given text object.

Since :
2.3.1
Remarks:
Use NULL pointers on the color components that you are not interested in: they are ignored by the function.
Parameters:
[in]objThe given Evas text object
[out]rThe pointer to variable to hold the red component of the given color
[out]gThe pointer to variable to hold the green component of the given color
[out]bThe pointer to variable to hold the blue component of the given color
[out]aThe pointer to variable to hold the alpha component of the given color
See also:
evas_object_text_shadow_color_set() for more details.
void evas_object_text_shadow_color_set ( Evas_Object obj,
int  r,
int  g,
int  b,
int  a 
)

Sets the shadow color for the given text object.

Since :
2.3.1
Remarks:
Shadow effects, which are fading colors decorating the text underneath it, are just shown if the object is set to one of the following styles:
You can also change the direction where the shadow grows to, with evas_object_text_style_set().
Parameters:
[in]objThe given Evas text object
[in]rThe red component of the given color
[in]gThe green component of the given color
[in]bThe blue component of the given color
[in]aThe alpha component of the given color
See also:
evas_object_text_shadow_color_get()

Gets the style on use on the given text object.

Since :
2.3.1
Parameters:
[in]objThe given text object to set style on
Returns:
The style type in use
See also:
evas_object_text_style_set() for more details.
void evas_object_text_style_pad_get ( const Evas_Object obj,
int *  l,
int *  r,
int *  t,
int *  b 
)

Gets the text style pad of a text object.

Since :
2.3.1
Parameters:
[in]objThe given text object
[out]lThe left pad (or NULL)
[out]rThe right pad (or NULL)
[out]tThe top pad (or NULL)
[out]bThe bottom pad (or NULL)

Sets the style to apply on the given text object.

Since :
2.3.1
Remarks:
Valid text object styles are defined in Evas_Text_Style_Type. Some of those values are combinations of more than one style, and some account for the direction of the rendering of shadow effects.
You can use the helper macros EVAS_TEXT_STYLE_BASIC_SET and EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET to assemble a style value.
The following figure illustrates the text styles:
text-styles.png
Parameters:
[in]objThe given text object to set style on
[in]typeThe style type
See also:
evas_object_text_style_get()
evas_object_text_shadow_color_set()
evas_object_text_outline_color_set()
evas_object_text_glow_color_set()
evas_object_text_glow2_color_set()
const char* evas_object_text_text_get ( const Evas_Object obj)

Gets the text string currently being displayed by the given text object.

Since :
2.3.1
Remarks:
Do not free() the return value.
Parameters:
[in]objThe given text object
Returns:
The text string currently being displayed on it
See also:
evas_object_text_text_set()
void evas_object_text_text_set ( Evas_Object obj,
const char *  text 
)

Sets the text string to be displayed by the given text object.

Since :
2.3.1
Parameters:
[in]objThe text object to set text string on
[in]textThe text string to display on it
See also:
evas_object_text_text_get()