예제 #1
0
파일: qgis.py 프로젝트: robbriers/slyr
def append_CharacterMarkerSymbolLayer(symbol, layer):
    """
    Appends a CharacterMarkerSymbolLayer to a symbol
    """
    font_family = layer.font
    character = chr(layer.unicode)
    color = symbol_color_to_qcolor(layer.color)
    angle = convert_angle(layer.angle)

    out = QgsFontMarkerSymbolLayer(font_family, character, layer.size, color, angle)
    out.setSizeUnit(QgsUnitTypes.RenderPoints)

    out.setEnabled(layer.enabled)
    out.setLocked(layer.locked)
    # TODO ArcGIS does not have the same offset/rotation linkages as QGIS does!
    out.setOffset(QPointF(layer.x_offset, layer.y_offset))
    out.setOffsetUnit(QgsUnitTypes.RenderPoints)

    symbol.appendSymbolLayer(out)
예제 #2
0
파일: qgis.py 프로젝트: zyxgis/slyr
def append_CharacterMarkerSymbolLayerAsFont(symbol, layer, context: Context):
    """
    Appends a CharacterMarkerSymbolLayer to a symbol, using QGIS font marker symbols
    """
    font_family = layer.font
    character = chr(layer.unicode)
    color = symbol_color_to_qcolor(layer.color)
    angle = convert_angle(layer.angle)

    out = QgsFontMarkerSymbolLayer(font_family, character,
                                   context.convert_size(layer.size), color,
                                   angle)
    out.setSizeUnit(context.units)

    out.setEnabled(layer.enabled)
    out.setLocked(layer.locked)

    out.setOffset(
        adjust_offset_for_rotation(
            QPointF(context.convert_size(layer.x_offset),
                    -context.convert_size(layer.y_offset)), layer.angle))
    out.setOffsetUnit(context.units)

    symbol.appendSymbolLayer(out)