scistag.imagestag.formatted_text.FormattedText

class FormattedText(text, font, h_align=HTextAlignment.LEFT, v_align=VTextAlignment.TOP, line_spacing=0)[source]

Bases: object

Helper class which helps printing and aligning multi-line and in the future also multi-format texts.

Parameters
  • text (str) – The text to be verified

  • font (Font) – The font to be used

  • h_align (HTextAlignment) – The horizontal text alignment

  • v_align (VTextAlignment) – The vertical text alignment

  • line_spacing (int) – Defines the additional space between each line in pixels.

Methods

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

font

The font to be used

line_spacing

The additional space between each line in pixels

element_widths

Contains the width of every single text element

width

The text's width in pixels

height

The text's height in pixels

text_positions

The position (relative to the starting point) of each line

y_offsets

The y offset for each row

element_widths

Contains the width of every single text element

font

The font to be used

height

The text’s height in pixels

line_spacing

The additional space between each line in pixels

text_positions

The position (relative to the starting point) of each line

width

The text’s width in pixels

y_offsets

The y offset for each row