scistag.imagestag.text_alignment_definitions.VTextAlignment¶
- class VTextAlignment(value)[source]¶
Bases:
IntEnumDefines the vertical placement of a text (line-wise)
Note that you can not center a multi-line text using a vertical alignment.
If you want to center multi-line text use the anchor parameter of the drawing function and use a “top” vertical alignment for the printing.
See
RegionAnchor.Methods
Attributes
Text is written to the bottom of a y starting point
Text is (line-wise) centered relative to a y starting point around it's ascending size span (with no respect to descending characters).
Text is (line-wise) centered relative to a y starting point around it's full size span.
Text is printed relative to it's baseline ("on top of this baseline) where the y then equals the low left pixel of a non-descending character such as an x.
Text is printed to the top of a y starting point with it's full height - so no pixel will be below the defined starting point.
__doc____members____module__- classmethod _missing_(value)[source]¶
Returns a value from a short code
- Parameters
value (
str) – Either an alignment to copy or one of the following string codes: - “t” / “top” for TOP aligned text - “c” / “center” for CENTERED text (centered on ascend) - “rc” / “realCenter” for REAL_CENTER text (centered on row height) - “b” / “bottom” for bottom aligned text - “bl” / “baseline” for text aligned on the baseline- Return type
- Returns
The corresponding enum value
- BASELINE = 3¶
Text is printed relative to it’s baseline (“on top of this baseline) where the y then equals the low left pixel of a non-descending character such as an x.
- BOTTOM = 4¶
Text is printed to the top of a y starting point with it’s full height - so no pixel will be below the defined starting point.
- CENTER = 1¶
Text is (line-wise) centered relative to a y starting point around it’s ascending size span (with no respect to descending characters). This in many cases looks more natural, especially when just upper case characters or dashes are being used.
- REAL_CENTER = 2¶
Text is (line-wise) centered relative to a y starting point around it’s full size span.
- TOP = 0¶
Text is written to the bottom of a y starting point