Functions that operate on single line, single style text objects. More...
Macros | |
#define | EVAS_TEXT_STYLE_BASIC_SET(x, s) do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0) |
Text style type creation macro. More... | |
#define | EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(x, s) do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_SHADOW_DIRECTION) | (s); } while (0) |
Text style type creation macro. More... | |
Typedefs | |
typedef enum _Evas_Text_Style_Type | Evas_Text_Style_Type |
Types of styles to be applied on text objects. More... | |
Enumerations | |
enum | _Evas_Text_Style_Type { EVAS_TEXT_STYLE_PLAIN, EVAS_TEXT_STYLE_SHADOW, EVAS_TEXT_STYLE_OUTLINE, EVAS_TEXT_STYLE_SOFT_OUTLINE, EVAS_TEXT_STYLE_GLOW, EVAS_TEXT_STYLE_OUTLINE_SHADOW, EVAS_TEXT_STYLE_FAR_SHADOW, EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW, EVAS_TEXT_STYLE_SOFT_SHADOW, EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4), EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = (0x1 << 4), EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4), EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = (0x3 << 4), EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = (0x4 << 4), EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = (0x5 << 4), EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = (0x6 << 4), EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = (0x7 << 4) } |
Functions | |
Evas_Object * | evas_object_text_add (Evas *e) |
Creates a new text object on the provided canvas. More... | |
void | evas_object_text_font_source_set (Evas_Object *obj, const char *font) |
Set the font (source) file to be used on a given text object. More... | |
const char * | evas_object_text_font_source_get (const Evas_Object *obj) |
Get the font file's path which is being used on a given text object. More... | |
void | evas_object_text_font_set (Evas_Object *obj, const char *font, Evas_Font_Size size) |
Set the font family and size on a given text object. More... | |
void | evas_object_text_font_get (const Evas_Object *obj, const char **font, Evas_Font_Size *size) |
Retrieve the font family and size in use on a given text object. More... | |
void | evas_object_text_text_set (Evas_Object *obj, const char *text) |
Sets the text string to be displayed by the given text object. More... | |
const char * | evas_object_text_text_get (const Evas_Object *obj) |
Retrieves the text string currently being displayed by the given text object. More... | |
void | evas_object_text_bidi_delimiters_set (Evas_Object *obj, const char *delim) |
Sets the BiDi delimiters used in the textblock. More... | |
const char * | evas_object_text_bidi_delimiters_get (const Evas_Object *obj) |
Gets the BiDi delimiters used in the textblock. More... | |
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) |
Retrieve position and dimension information of a character within a text Evas_Object . More... | |
int | evas_object_text_last_up_to_pos (const Evas_Object *obj, Evas_Coord x, Evas_Coord y) |
Returns the logical position of the last char in the text up to the pos given. More... | |
Evas_Text_Style_Type | evas_object_text_style_get (const Evas_Object *obj) |
Retrieves the style on use on the given text object. More... | |
void | evas_object_text_style_set (Evas_Object *obj, Evas_Text_Style_Type type) |
Sets the style to apply on the given text object. More... | |
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. More... | |
void | evas_object_text_shadow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Retrieves the shadow color for the given text object. More... | |
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. More... | |
void | evas_object_text_glow_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Retrieves the glow color for the given text object. More... | |
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. More... | |
void | evas_object_text_glow2_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Retrieves the 'glow 2' color for the given text object. More... | |
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. More... | |
void | evas_object_text_outline_color_get (const Evas_Object *obj, int *r, int *g, int *b, int *a) |
Retrieves the outline color for the given text object. More... | |
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. More... | |
Evas_BiDi_Direction | evas_object_text_direction_get (const Evas_Object *obj) |
Retrieves the direction of the text currently being displayed in the text object. More... | |
Detailed Description
Functions that operate on single line, single style text objects.
For multiline and multiple style text, see Textblock Object Functions.
See some examples on this group of functions.
- Warning
- We don't guarantee any proper results if you create a Text object without setting the evas engine.
Macro Definition Documentation
#define EVAS_TEXT_STYLE_BASIC_SET | ( | x, | |
s | |||
) | do { x = ((x) & ~EVAS_TEXT_STYLE_MASK_BASIC) | (s); } while (0) |
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) |
Text style type creation macro.
This one will impose shadow directions on the style type variable – use the EVAS_TEXT_STYLE_SHADOW_DIRECTION_*
values on 's', incrementally.
Typedef Documentation
typedef enum _Evas_Text_Style_Type Evas_Text_Style_Type |
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
Function Documentation
Evas_Object* evas_object_text_add | ( | Evas * | e | ) |
Creates a new text object on the provided canvas.
- Parameters
-
e The canvas to create the text object on.
- Returns
NULL
on error, a pointer to a new text object on success.
Text objects are for simple, single line text elements. If you want more elaborated text blocks, see Textblock Object Functions.
const char* evas_object_text_bidi_delimiters_get | ( | const Evas_Object * | obj | ) |
Gets the BiDi delimiters used in the textblock.
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
-
obj The given text object.
- Returns
- A null terminated string of delimiters, e.g ",|". If empty, returns NULL.
- Since
- 1.1
void evas_object_text_bidi_delimiters_set | ( | Evas_Object * | obj, |
const char * | delim | ||
) |
Sets the BiDi delimiters used in the textblock.
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
-
obj The given text object. delim A null terminated string of delimiters, e.g ",|".
- Since
- 1.1
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 | ||
) |
Retrieve 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 will be assigned to that parameter.
- Parameters
-
obj The text object to retrieve position information for. pos The character position to request co-ordinates for. cx A pointer to an Evas_Coord
to store the X value in (can be NULL).cy A pointer to an Evas_Coord
to store the Y value in (can be NULL).cw A pointer to an Evas_Coord
to store the Width value in (can be NULL).ch A pointer to an Evas_Coord
to store the Height value in (can be NULL).
- Returns
EINA_FALSE
on success,EINA_TRUE
on error.
Evas_BiDi_Direction evas_object_text_direction_get | ( | const Evas_Object * | obj | ) |
Retrieves the direction of the text currently being displayed in the text object.
- Parameters
-
obj The given evas text object.
- Returns
- the direction of the text
void evas_object_text_font_get | ( | const Evas_Object * | obj, |
const char ** | font, | ||
Evas_Font_Size * | size | ||
) |
Retrieve the font family and size in use on a given text object.
- Parameters
-
obj The evas text object to query for font information. font A pointer to the location to store the font name in. size A pointer to the location to store the font size in.
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.
- See Also
- evas_object_text_font_set()
void evas_object_text_font_set | ( | Evas_Object * | obj, |
const char * | font, | ||
Evas_Font_Size | size | ||
) |
Set the font family and size on a given text object.
- Parameters
-
obj The text object to set font for. font The font (family) name. size The font size, in points.
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's the underlying library used to query system fonts by Evas (see the fc-list
command's output, on your system, to get an idea).
References evas_event_feed_mouse_move().
const char* evas_object_text_font_source_get | ( | const Evas_Object * | obj | ) |
Get the font file's path which is being used on a given text object.
- Parameters
-
obj The text object to set 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 | ||
) |
Set the font (source) file to be used on a given text object.
- Parameters
-
obj The text object to set font for. font The font file's path.
This function allows the font file to be explicitly set for a given text object, overriding system lookup, which will first occur in the given file's contents.
- 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 | ||
) |
Retrieves the 'glow 2' color for the given text object.
- Parameters
-
obj The given Evas text object. r Pointer to variable to hold the red component of the given color. g Pointer to variable to hold the green component of the given color. b Pointer to variable to hold the blue component of the given color. a Pointer to variable to hold the alpha component of the given color.
- Note
- Use
NULL
pointers on the color components you're not interested in: they'll be ignored by the function.
- 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.
- Parameters
-
obj The given Evas text object. r The red component of the given color. g The green component of the given color. b The blue component of the given color. a The alpha component of the given color.
'Glow 2' effects, which are glowing colors decorating the text's (immediate) surroundings, will just be shown if the object is set to the EVAS_TEXT_STYLE_GLOW style. See also evas_object_text_glow_color_set().
void evas_object_text_glow_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Retrieves the glow color for the given text object.
- Parameters
-
obj The given Evas text object. r Pointer to variable to hold the red component of the given color. g Pointer to variable to hold the green component of the given color. b Pointer to variable to hold the blue component of the given color. a Pointer to variable to hold the alpha component of the given color.
- Note
- Use
NULL
pointers on the color components you're not interested in: they'll be ignored by the function.
- 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.
- Parameters
-
obj The given Evas text object. r The red component of the given color. g The green component of the given color. b The blue component of the given color. a The alpha component of the given color.
Glow effects, which are glowing colors decorating the text's surroundings, will just be shown if the object is set to the EVAS_TEXT_STYLE_GLOW style.
- Note
- 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()).
int evas_object_text_last_up_to_pos | ( | const Evas_Object * | obj, |
Evas_Coord | x, | ||
Evas_Coord | y | ||
) |
Returns the logical position of the last char in the text up to the pos given.
this is NOT the position of the last char because of the possibility of RTL in the text.
void evas_object_text_outline_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Retrieves the outline color for the given text object.
- Parameters
-
obj The given Evas text object. r Pointer to variable to hold the red component of the given color. g Pointer to variable to hold the green component of the given color. b Pointer to variable to hold the blue component of the given color. a Pointer to variable to hold the alpha component of the given color.
- Note
- Use
NULL
pointers on the color components you're not interested in: they'll be ignored by the function.
- 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.
- Parameters
-
obj The given Evas text object. r The red component of the given color. g The green component of the given color. b The blue component of the given color. a The alpha component of the given color.
Outline effects (colored lines around text glyphs) will just be shown if the object is set to one of the following styles:
void evas_object_text_shadow_color_get | ( | const Evas_Object * | obj, |
int * | r, | ||
int * | g, | ||
int * | b, | ||
int * | a | ||
) |
Retrieves the shadow color for the given text object.
- Parameters
-
obj The given Evas text object. r Pointer to variable to hold the red component of the given color. g Pointer to variable to hold the green component of the given color. b Pointer to variable to hold the blue component of the given color. a Pointer to variable to hold the alpha component of the given color.
- Note
- Use
NULL
pointers on the color components you're not interested in: they'll be ignored by the function.
- 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.
- Parameters
-
obj The given Evas text object. r The red component of the given color. g The green component of the given color. b The blue component of the given color. a The alpha component of the given color.
Shadow effects, which are fading colors decorating the text underneath it, will just be shown if the object is set to one of the following styles:
- EVAS_TEXT_STYLE_SHADOW
- EVAS_TEXT_STYLE_OUTLINE_SHADOW
- EVAS_TEXT_STYLE_FAR_SHADOW
- EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW
- EVAS_TEXT_STYLE_SOFT_SHADOW
- EVAS_TEXT_STYLE_FAR_SOFT_SHADOW
One can also change the direction where the shadow grows to, with evas_object_text_style_set().
Evas_Text_Style_Type evas_object_text_style_get | ( | const Evas_Object * | obj | ) |
Retrieves the style on use on the given text object.
- Parameters
-
obj the given text object to set style on.
- Returns
- the style type in use.
- See Also
- evas_object_text_style_set() for more details.
References EVAS_TEXT_STYLE_PLAIN.
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.
- Parameters
-
obj The given text object. l The left pad (or NULL
).r The right pad (or NULL
).t The top pad (or NULL
).b The bottom pad (or NULL
).
void evas_object_text_style_set | ( | Evas_Object * | obj, |
Evas_Text_Style_Type | type | ||
) |
Sets the style to apply on the given text object.
- Parameters
-
obj the given text object to set style on. type a style type.
Text object styles are one of the values 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.
- Note
- One may 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:

const char* evas_object_text_text_get | ( | const Evas_Object * | obj | ) |
Retrieves the text string currently being displayed by the given text object.
- Parameters
-
obj The given text object.
- Returns
- The text string currently being displayed on it.
- Note
- Do not free() the return value.
- 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.
- Parameters
-
obj The text object to set text string on. text Text string to display on it.
- See Also
- evas_object_text_text_get()
References evas_event_feed_mouse_move().