Class: QgsTextRendererUtils

Utility functions for text rendering.

Added in version 3.10.

Static Methods

decodeBackgroundRotationType

Decodes a string representation of a background rotation type to a type.

decodeBackgroundSizeType

Decodes a string representation of a background size type to a type.

decodeShadowPlacementType

Decodes a string representation of a shadow placement type to a type.

decodeShapeType

Decodes a string representation of a background shape type to a type.

decodeTextOrientation

Attempts to decode a string representation of a text orientation.

encodeTextOrientation

Encodes a text orientation.

class qgis.core.QgsTextRendererUtils[source]

Bases: object

static decodeBackgroundRotationType(string: str | None) QgsTextBackgroundSettings.RotationType[source]

Decodes a string representation of a background rotation type to a type.

Parameters:

string (Optional[str])

Return type:

QgsTextBackgroundSettings.RotationType

static decodeBackgroundSizeType(string: str | None) QgsTextBackgroundSettings.SizeType[source]

Decodes a string representation of a background size type to a type.

Parameters:

string (Optional[str])

Return type:

QgsTextBackgroundSettings.SizeType

static decodeShadowPlacementType(string: str | None) QgsTextShadowSettings.ShadowPlacement[source]

Decodes a string representation of a shadow placement type to a type.

Parameters:

string (Optional[str])

Return type:

QgsTextShadowSettings.ShadowPlacement

static decodeShapeType(string: str | None) QgsTextBackgroundSettings.ShapeType[source]

Decodes a string representation of a background shape type to a type.

Parameters:

string (Optional[str])

Return type:

QgsTextBackgroundSettings.ShapeType

static decodeTextOrientation(name: str | None)[source]

Attempts to decode a string representation of a text orientation.

Parameters:
  • name (Optional[str]) -> (Qgis.TextOrientation) – encoded text orientation name

  • ok – if specified, will be set to True if the name was successfully decoded

Returns:

decoded text orientation

static encodeTextOrientation(orientation: Qgis.TextOrientation) str[source]

Encodes a text orientation.

Return type:

str

Returns:

encoded string

Parameters:

orientation (Qgis.TextOrientation)