diff --git a/qgreenland/util/qgis/project.py b/qgreenland/util/qgis/project.py index a788f7a1..724f73b0 100644 --- a/qgreenland/util/qgis/project.py +++ b/qgreenland/util/qgis/project.py @@ -275,6 +275,29 @@ def _add_decorations(project: qgc.QgsProject) -> None: project.writeEntry("CopyrightLabel", "/MarginH", 0) project.writeEntry("CopyrightLabel", "/MarginV", 0) + # Add buffer around copyright text + # TODO: can we figure out a way to export `text_format` to xml so that it + # can be written to the project file without hard-coding everything? The + # `text_format` (`QgsTextFormat`) object has a `writeXml` method but it is + # unclear how to apply it to the project file: + # ``` + # text_format = qgc.QgsTextFormat() + # buffer_settings = text_format.buffer() + # buffer_settings.setEnabled(True) + # text_format.setBuffer(buffer_settings) + # text_format.write_xml(...) + # ``` + project.writeEntry( + "CopyrightLabel", + "/Font", + ( + '' + ), + ) + # Add Image (QGreenland logo): project.writeEntry("Image", "/Enabled", True) project.writeEntry("Image", "/Placement", 0)