Skip to content
Permalink
Browse files
[needs-docs] Use a combo box in layout SVG settings dialog for text e…
…xport format

This makes it match the label engine settings dialog, and opens the possibility
for additional text export modes to be added in future.
  • Loading branch information
nyalldawson committed Dec 11, 2018
1 parent cd8b91b commit 15abbcf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
@@ -3998,7 +3998,11 @@ bool QgsLayoutDesignerDialog::getSvgExportSettings( QgsLayoutExporter::SvgExport
QDialog dialog;
Ui::QgsSvgExportOptionsDialog options;
options.setupUi( &dialog );
options.chkTextAsOutline->setChecked( prevTextRenderFormat == QgsRenderContext::TextFormatAlwaysOutlines );

options.mTextRenderFormatComboBox->addItem( tr( "Always Export Text as Paths (Recommended)" ), QgsRenderContext::TextFormatAlwaysOutlines );
options.mTextRenderFormatComboBox->addItem( tr( "Always Export Text as Text Objects" ), QgsRenderContext::TextFormatAlwaysText );

options.mTextRenderFormatComboBox->setCurrentIndex( options.mTextRenderFormatComboBox->findData( prevTextRenderFormat ) );
options.chkMapLayersAsGroup->setChecked( layersAsGroup );
options.mClipToContentGroupBox->setChecked( cropToContents );
options.mForceVectorCheckBox->setChecked( previousForceVector );
@@ -4018,7 +4022,7 @@ bool QgsLayoutDesignerDialog::getSvgExportSettings( QgsLayoutExporter::SvgExport
marginBottom = options.mBottomMarginSpinBox->value();
marginLeft = options.mLeftMarginSpinBox->value();
includeMetadata = options.mIncludeMetadataCheckbox->isChecked();
QgsRenderContext::TextRenderFormat textRenderFormat = options.chkTextAsOutline->isChecked() ? QgsRenderContext::TextFormatAlwaysOutlines : QgsRenderContext::TextFormatAlwaysText;
QgsRenderContext::TextRenderFormat textRenderFormat = static_cast< QgsRenderContext::TextRenderFormat >( options.mTextRenderFormatComboBox->currentData().toInt() );

if ( mLayout )
{
@@ -19,8 +19,8 @@
<property name="title">
<string>SVG Options</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="chkMapLayersAsGroup">
<property name="text">
<string>Export map layers as SVG groups (may affect label placement)</string>
@@ -30,23 +30,17 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkTextAsOutline">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Uncheck to render map labels as text objects. This will degrade the quality of the map labels but allow editing in vector illustration software.</string>
</property>
<item row="3" column="1">
<widget class="QComboBox" name="mTextRenderFormatComboBox"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Render map labels as outlines</string>
</property>
<property name="checked">
<bool>true</bool>
<string>Text export</string>
</property>
</widget>
</item>
<item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="mForceVectorCheckBox">
<property name="toolTip">
<string>If checked, the layout will always be kept as vector objects when exported to a compatible format, even if the appearance of the resultant file does not match the layouts settings. If unchecked, some elements in the layout may be rasterized in order to keep their appearance intact.</string>
@@ -56,7 +50,7 @@
</property>
</widget>
</item>
<item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="mIncludeMetadataCheckbox">
<property name="text">
<string>Export RDF metadata</string>
@@ -214,9 +208,9 @@
</customwidgets>
<tabstops>
<tabstop>chkMapLayersAsGroup</tabstop>
<tabstop>chkTextAsOutline</tabstop>
<tabstop>mForceVectorCheckBox</tabstop>
<tabstop>mIncludeMetadataCheckbox</tabstop>
<tabstop>mTextRenderFormatComboBox</tabstop>
<tabstop>mClipToContentGroupBox</tabstop>
<tabstop>mTopMarginSpinBox</tabstop>
<tabstop>mLeftMarginSpinBox</tabstop>

0 comments on commit 15abbcf

Please sign in to comment.