scistag.imagestag.formatted_text.FormattedText¶
- class FormattedText(text, font, h_align=HTextAlignment.LEFT, v_align=VTextAlignment.TOP, line_spacing=0)[source]¶
Bases:
objectHelper class which helps printing and aligning multi-line and in the future also multi-format texts.
- Parameters
text (
str) – The text to be verifiedfont (
Font) – The font to be usedh_align (
HTextAlignment) – The horizontal text alignmentv_align (
VTextAlignment) – The vertical text alignmentline_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)
The font to be used
The additional space between each line in pixels
Contains the width of every single text element
The text's width in pixels
The text's height in pixels
The position (relative to the starting point) of each line
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