Macros | Enumerations | Functions
Text Object Functions

Functions that operate on single line, single style text objects. More...

Macros

#define EVAS_TEXT_STYLE_MASK_BASIC   0xf
 
#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_MASK_SHADOW_DIRECTION   (0x7 << 4)
 
#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...
 

Enumerations

enum  Evas_Text_Style_Type {
  EVAS_TEXT_STYLE_PLAIN = 0,
  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 = 0,
  EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM = 16,
  EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT = 32,
  EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT = 48,
  EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT = 64,
  EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP = 80,
  EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT = 96,
  EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT = 112
}
 Types of styles to be applied on text objects. More...
 

Functions

Evas_Objectevas_object_text_add (Evas *e)
 Creates a new text object on the provided canvas. More...
 
void evas_object_text_text_set (Eo *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 Eo *obj)
 Retrieves the text string currently being displayed by the given text object. More...
 
void evas_object_text_font_source_set (Eo *obj, const char *font_source)
 Set the font (source) file to be used on a given text object. More...
 
const char * evas_object_text_font_source_get (const Eo *obj)
 Get the font file's path which is being used on a given text object. More...
 
void evas_object_text_font_set (Eo *obj, const char *font, Evas_Font_Size size)
 Set the font family or filename, and size on a given text object. More...
 
void evas_object_text_font_get (const Eo *obj, const char **font, Evas_Font_Size *size)
 Retrieve the font family and size in use on a given 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

◆ EVAS_TEXT_STYLE_BASIC_SET

#define EVAS_TEXT_STYLE_BASIC_SET (   x,
 
)    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.

◆ EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET

#define EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET (   x,
 
)    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.

Enumeration Type Documentation

◆ Evas_Text_Style_Type

Types of styles to be applied on text objects.

The EVAS_TEXT_STYLE_SHADOW_DIRECTION_* ones are to be OR'ed together with others imposing shadow, to change the shadow's direction.

See also
evas_object_text_style_set()
evas_object_text_style_get()
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_SHADOW_DIRECTION_BOTTOM_RIGHT 

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

◆ evas_object_text_add()

Evas_Object* evas_object_text_add ( Evas e)

Creates a new text object on the provided canvas.

Parameters
eThe 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.

See also
evas_object_text_font_source_set()
evas_object_text_font_set()
evas_object_text_text_set()

References EINA_FALSE, eina_inlist_append(), EINA_INLIST_FOREACH, EINA_INLIST_GET, eina_inlist_prepend_relative(), eina_inlist_remove(), eina_list_free(), EINA_SAFETY_ON_FALSE_RETURN_VAL, EINA_SAFETY_ON_NULL_RETURN, EINA_SAFETY_ON_TRUE_RETURN, eina_streq(), eina_stringshare_replace(), EINA_TRUE, EINA_UNUSED, and EVAS_CANVAS_CLASS.

Referenced by edje_edit_part_name_set().

◆ evas_object_text_text_set()

void evas_object_text_text_set ( Eo *  obj,
const char *  text 
)

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

See also
evas_object_text_text_get()
Parameters
[in]textText string to display on it.

◆ evas_object_text_text_get()

const char* evas_object_text_text_get ( const Eo *  obj)

Retrieves the text string currently being displayed by 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()

◆ evas_object_text_font_source_set()

void evas_object_text_font_source_set ( Eo *  obj,
const char *  font_source 
)

Set 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 will first occur in the given file's contents.

See also
evas_object_text_font_get()
Parameters
[in]font_sourceThe font file's path.

Referenced by edje_edit_part_name_set().

◆ evas_object_text_font_source_get()

const char* evas_object_text_font_source_get ( const Eo *  obj)

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

Returns
The font file's path.
See also
evas_object_text_font_get() for more details

◆ evas_object_text_font_set()

void evas_object_text_font_set ( Eo *  obj,
const char *  font,
Evas_Font_Size  size 
)

Set the font family or filename, 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'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). Alternatively, one can use a full path to a font file.

See also
evas_object_text_font_get()
evas_object_text_font_source_set()
Parameters
[in]fontThe font family name or filename.
[in]sizeThe font size, in points.

◆ evas_object_text_font_get()

void evas_object_text_font_get ( const Eo *  obj,
const char **  font,
Evas_Font_Size size 
)

Retrieve 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.

See also
evas_object_text_font_set()
Parameters
[out]fontThe font family name or filename.
[out]sizeThe font size, in points.