Previous topic

efl.evas.Polygon Class

Next topic

efl.evas.Textblock Class

efl.evas.Text Class

class efl.evas.Text

Bases: efl.evas.Object

A Text object.

Parameters:
  • canvas (Canvas) – Evas canvas for this object
  • font (string) – Font name
  • shadow_color (tuple of ints) – The shadow color
  • glow_color (tuple of ints) – The primary glow color
  • glow2_color (tuple of ints) – The secondary glow color
  • outline_color (tuple of ints) – The outline color
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
ascent None
Type:int
ascent_get()
char_coords_get(x, y)

Retrieve position and dimension information of a character at desired position.

Like char_pos_get(), but instead of providing the character index one can give its position.

Parameters:
  • x
  • y
Return type:

(int x, int y, int w, int h)

char_pos_get(char_index)

Retrieve position and dimension information of a character.

This function is used to obtain the x, y, width and height of a the character located at char_index within this object.

Parameters:char_index – index of desired character.
Return type:(int x, int y, int w, int h)
descent None
Type:int
descent_get()
font None

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

Parameters:
  • 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).

See:font_source
font_get()
font_set(font, size=10)
font_source None

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

Parameters: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:font
font_source_get()
font_source_set(value)
glow2_color None
Type:(int r, int g, int b, int a)
glow2_color_get()
glow2_color_set(r, g, b, a)
glow_color None
Type:(int r, int g, int b, int a)
glow_color_get()
glow_color_set(r, g, b, a)
horiz_advance None
Type:int
horiz_advance_get()
inset None
Type:int
inset_get()
max_ascent None
Type:int
max_ascent_get()
max_descent None
Type:int
max_descent_get()
outline_color None
Type:(int r, int g, int b, int a)
outline_color_get()
outline_color_set(r, g, b, a)
shadow_color None
Type:(int r, int g, int b, int a)
shadow_color_get()
shadow_color_set(r, g, b, a)
style None

Text drawing style.

One of:

  • 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
Type:Evas_Text_Style_Type
style_get()
style_pad None
Type:(int l, int r, int t, int b)
style_pad_get()
style_set(value)
text None

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

Type:unicode
text_get()
text_set(value)
vert_advance None
Type:int
vert_advance_get()