Class: QgsFontMarkerSymbolLayer

A marker symbol layer which displays characters rendered using a font.

Class Hierarchy

Inheritance diagram of qgis.core.QgsFontMarkerSymbolLayer

Base classes

QgsMarkerSymbolLayer

Abstract base class for marker symbol layers.

QgsSymbolLayer

Abstract base class for symbol layers.

Methods

character

Returns the character(s) used when rendering points.

fontFamily

Returns the font family name for the associated font which will be used to render the point.

fontStyle

Returns the font style for the associated font which will be used to render the point.

penJoinStyle

Returns the stroke join style.

setCharacter

Sets the character(s) used when rendering points.

setFontFamily

Sets the font family for the font which will be used to render the point.

setFontStyle

Sets the font style for the font which will be used to render the point.

setPenJoinStyle

Sets the stroke join style.

setStrokeWidth

Set's the marker's stroke width.

setStrokeWidthMapUnitScale

Sets the stroke width map unit scale.

setStrokeWidthUnit

Sets the stroke width unit.

strokeWidth

Returns the marker's stroke width.

strokeWidthMapUnitScale

Returns the stroke width map unit scale.

strokeWidthUnit

Returns the stroke width unit.

Static Methods

create

Creates a new QgsFontMarkerSymbolLayer from a property map (see properties())

createFromSld

Creates a new QgsFontMarkerSymbolLayer from an SLD XML element.

resolveFonts

Resolves fonts from a properties map, raising warnings in the specified context if the required fonts are not available on the system.

class qgis.core.QgsFontMarkerSymbolLayer[source]

Bases: QgsMarkerSymbolLayer

__init__(fontFamily: str | None = '', chr: str | None = '', pointSize: float = DEFAULT_FONTMARKER_SIZE, color: QColor | Qt.GlobalColor = DEFAULT_FONTMARKER_COLOR, angle: float = DEFAULT_FONTMARKER_ANGLE)

Constructs a font marker symbol layer.

Parameters:
  • fontFamily (Optional[str] = '')

  • chr (Optional[str] = '')

  • pointSize (float = DEFAULT_FONTMARKER_SIZE)

  • color (Union[QColor, Qt.GlobalColor] = DEFAULT_FONTMARKER_COLOR)

  • angle (float = DEFAULT_FONTMARKER_ANGLE)

character(self) str[source]

Returns the character(s) used when rendering points.

See also

setCharacter()

Return type:

str

static create(properties: Dict[str, Any] = {}) QgsSymbolLayer | None[source]

Creates a new QgsFontMarkerSymbolLayer from a property map (see properties())

Parameters:

properties (Dict[str, Any] = {})

Return type:

Optional[QgsSymbolLayer]

static createFromSld(element: QDomElement) QgsSymbolLayer | None[source]

Creates a new QgsFontMarkerSymbolLayer from an SLD XML element.

Parameters:

element (QDomElement)

Return type:

Optional[QgsSymbolLayer]

fontFamily(self) str[source]

Returns the font family name for the associated font which will be used to render the point.

See also

setFontFamily()

Return type:

str

fontStyle(self) str[source]

Returns the font style for the associated font which will be used to render the point.

See also

setFontStyle()

Added in version 3.14.

Return type:

str

penJoinStyle(self) Qt.PenJoinStyle[source]

Returns the stroke join style.

Return type:

Qt.PenJoinStyle

static resolveFonts(properties: Dict[str, Any], context: QgsReadWriteContext)[source]

Resolves fonts from a properties map, raising warnings in the specified context if the required fonts are not available on the system.

Added in version 3.20.

Parameters:
setCharacter(self, chr: str | None)[source]

Sets the character(s) used when rendering points.

See also

character()

Parameters:

chr (Optional[str])

setFontFamily(self, family: str | None)[source]

Sets the font family for the font which will be used to render the point.

See also

fontFamily()

Parameters:

family (Optional[str])

setFontStyle(self, style: str | None)[source]

Sets the font style for the font which will be used to render the point.

See also

fontStyle()

Added in version 3.14.

Parameters:

style (Optional[str])

setPenJoinStyle(self, style: Qt.PenJoinStyle)[source]

Sets the stroke join style.

See also

penJoinStyle()

Parameters:

style (Qt.PenJoinStyle)

setStrokeWidth(self, width: float)[source]

Set’s the marker’s stroke width. Units are set by setStrokeWidthUnit().

See also

strokeWidth()

Parameters:

width (float)

setStrokeWidthMapUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the stroke width map unit scale.

See also

setStrokeWidth()

Parameters:

scale (QgsMapUnitScale)

setStrokeWidthUnit(self, unit: Qgis.RenderUnit)[source]

Sets the stroke width unit.

See also

setStrokeWidth()

Parameters:

unit (Qgis.RenderUnit)

strokeWidth(self) float[source]

Returns the marker’s stroke width. Units are retrieved by strokeWidthUnit()

See also

setStrokeWidth()

Return type:

float

strokeWidthMapUnitScale(self) QgsMapUnitScale

Returns the stroke width map unit scale.

See also

strokeWidth()

Return type:

QgsMapUnitScale

strokeWidthUnit(self) Qgis.RenderUnit[source]

Returns the stroke width unit.

See also

strokeWidth()

Return type:

Qgis.RenderUnit