str2d.Str2D.validate_halign

classmethod Str2D.validate_halign(halign: str) str[source]

Validate the horizontal alignment. The horizontal alignment can be ‘left’, ‘center’, or ‘right’. It will lower case the input and raise a ValueError if the input is not one of the valid options.

Parameters:

halign (str) – The horizontal alignment.

Returns:

The validated horizontal alignment.

Return type:

str

Raises:

ValueError – If the horizontal alignment is not ‘left’, ‘center’, or ‘right’.