Class: QgsFontMarkerSymbolLayer¶
- class qgis.core.QgsFontMarkerSymbolLayer(fontFamily: str = '', chr: str = '', pointSize: float = DEFAULT_FONTMARKER_SIZE, color: QColor | Qt.GlobalColor = DEFAULT_FONTMARKER_COLOR, angle: float = DEFAULT_FONTMARKER_ANGLE)¶
Bases:
QgsMarkerSymbolLayer
Constructs a font marker symbol layer.
Methods
- param point:
Returns the character(s) used when rendering points.
- rtype:
QgsFontMarkerSymbolLayer
Copies all data defined properties of this layer to another symbol layer.
Copies paint effect of this layer to another symbol layer
Creates a new
QgsFontMarkerSymbolLayer
from a property map (seeproperties()
)Creates a new
QgsFontMarkerSymbolLayer
from an SLD XMLelement
.Returns the font family name for the associated font which will be used to render the point.
Returns the font style for the associated font which will be used to render the point.
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layers- rtype:
str
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker's anchor point.
Returns the stroke join style.
- rtype:
Dict[str, Any]
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layers- param point:
Resolves fonts from a
properties
map, raising warnings in the specifiedcontext
if the required fonts are not available on the system.Restores older data defined properties from string map.
Sets the character(s) used when rendering points.
Sets the font
family
for the font which will be used to render the point.Sets the font
style
for the font which will be used to render the point.- param unit:
Sets the stroke join
style
.- param color:
Set's the marker's stroke
width
.Sets the stroke width map unit
scale
.Sets the stroke width
unit
.Returns
True
if the symbol layer should be rendered using the selection color from the render context.- param context:
- param context:
- rtype:
QColor
Returns the marker's stroke width.
Returns the stroke width map unit scale.
Returns the stroke width unit.
- rtype:
bool
- param doc:
- bounds(self, point: QPointF | QPoint, context: QgsSymbolRenderContext) QRectF ¶
- Parameters:
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- Return type:
QRectF
- character(self) str ¶
Returns the character(s) used when rendering points.
See also
- Return type:
str
- clone(self) QgsFontMarkerSymbolLayer ¶
- Return type:
- copyDataDefinedProperties(self, destLayer: QgsSymbolLayer)¶
Copies all data defined properties of this layer to another symbol layer.
- Parameters:
destLayer – destination layer
- copyPaintEffect(self, destLayer: QgsSymbolLayer)¶
Copies paint effect of this layer to another symbol layer
- Parameters:
destLayer – destination layer
- create(properties: Dict[str, Any] = {}) QgsSymbolLayer ¶
Creates a new
QgsFontMarkerSymbolLayer
from a property map (seeproperties()
)- Parameters:
properties (Dict[str) –
- Return type:
- createFromSld(element: QDomElement) QgsSymbolLayer ¶
Creates a new
QgsFontMarkerSymbolLayer
from an SLD XMLelement
.- Parameters:
element (QDomElement) –
- Return type:
- fontFamily(self) str ¶
Returns the font family name for the associated font which will be used to render the point.
See also
- Return type:
str
- fontStyle(self) str ¶
Returns the font style for the associated font which will be used to render the point.
See also
New in version 3.14.
- Return type:
str
- installMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, install masks on
context
painter ifrecursive
isTrue
masks are installed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- layerType(self) str ¶
- Return type:
str
- markerOffset(self, context: QgsSymbolRenderContext) Tuple[float, float] ¶
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point.
- Parameters:
context – symbol render context
offsetX – will be set to required horizontal offset (in painter units)
offsetY – will be set to required vertical offset (in painter units)
- markerOffset2(self, context: QgsSymbolRenderContext, width: float, height: float, widthUnit: Qgis.RenderUnit, heightUnit: Qgis.RenderUnit, widthMapUnitScale: QgsMapUnitScale, heightMapUnitScale: QgsMapUnitScale) Tuple[float, float] ¶
Note
available in Python bindings as markerOffset2
- markerOffsetWithWidthAndHeight(self, context: QgsSymbolRenderContext, width: float, height: float) Tuple[float, float] ¶
Calculates the required marker offset, including both the symbol offset and any displacement required to align with the marker’s anchor point.
- Parameters:
context – symbol render context
width – marker width
height – marker height
offsetX – will be set to required horizontal offset (in painter units)
offsetY – will be set to required vertical offset (in painter units)
Note
available in Python as markerOffsetWithWidthAndHeight
- penJoinStyle(self) Qt.PenJoinStyle ¶
Returns the stroke join style.
See also
- Return type:
Qt.PenJoinStyle
- properties(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- removeMasks(self, context: QgsRenderContext, recursive: bool)¶
When rendering, remove previously installed masks from
context
painter ifrecursive
isTrue
masks are removed recursively for all children symbol layersSee also
prepareMasks()
See also
New in version 3.30.
- renderPoint(self, point: QPointF | QPoint, context: QgsSymbolRenderContext)¶
- Parameters:
point (Union[QPointF) –
context (QgsSymbolRenderContext) –
- resolveFonts(properties: Dict[str, Any], context: QgsReadWriteContext)¶
Resolves fonts from a
properties
map, raising warnings in the specifiedcontext
if the required fonts are not available on the system.New in version 3.20.
- Parameters:
properties (Dict[str) –
context (QgsReadWriteContext) –
- restoreOldDataDefinedProperties(self, stringMap: Dict[str, Any])¶
Restores older data defined properties from string map.
- setCharacter(self, chr: str)¶
Sets the character(s) used when rendering points.
See also
- Parameters:
chr (str) –
- setFontFamily(self, family: str)¶
Sets the font
family
for the font which will be used to render the point.See also
- Parameters:
family (str) –
- setFontStyle(self, style: str)¶
Sets the font
style
for the font which will be used to render the point.See also
New in version 3.14.
- Parameters:
style (str) –
- setOutputUnit(self, unit: Qgis.RenderUnit)¶
- Parameters:
unit (Qgis.RenderUnit) –
- setPenJoinStyle(self, style: Qt.PenJoinStyle)¶
Sets the stroke join
style
.See also
- Parameters:
style (Qt.PenJoinStyle) –
- setStrokeColor(self, color: QColor | Qt.GlobalColor)¶
- Parameters:
color (Union[QColor) –
- setStrokeWidth(self, width: float)¶
Set’s the marker’s stroke
width
. Units are set bysetStrokeWidthUnit()
.See also
See also
See also
- Parameters:
width (float) –
- setStrokeWidthMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the stroke width map unit
scale
.See also
See also
See also
- Parameters:
scale (QgsMapUnitScale) –
- setStrokeWidthUnit(self, unit: Qgis.RenderUnit)¶
Sets the stroke width
unit
.See also
See also
See also
- Parameters:
unit (Qgis.RenderUnit) –
- shouldRenderUsingSelectionColor(self, context: QgsSymbolRenderContext) bool ¶
Returns
True
if the symbol layer should be rendered using the selection color from the render context.New in version 3.34.
- startRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- stopRender(self, context: QgsSymbolRenderContext)¶
- Parameters:
context (QgsSymbolRenderContext) –
- strokeColor(self) QColor ¶
- Return type:
QColor
- strokeWidth(self) float ¶
Returns the marker’s stroke width. Units are retrieved by
strokeWidthUnit()
See also
See also
See also
- Return type:
float
- strokeWidthMapUnitScale(self) QgsMapUnitScale ¶
Returns the stroke width map unit scale.
See also
See also
See also
- Return type:
- strokeWidthUnit(self) Qgis.RenderUnit ¶
Returns the stroke width unit.
See also
See also
See also
- Return type:
- usesMapUnits(self) bool ¶
- Return type:
bool
- writeSldMarker(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any])¶
- Parameters:
doc (QDomDocument) –
element (QDomElement) –
props (Dict[str) –