Skip to content

Commit de18cc7

Browse files
committed
[needs-docs] Use a combo box in layout SVG settings dialog for text export format
This makes it match the label engine settings dialog, and opens the possibility for additional text export modes to be added in future. (cherry picked from commit 7b426c0)
1 parent b6cc3f4 commit de18cc7

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

src/app/layout/qgslayoutdesignerdialog.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,11 @@ bool QgsLayoutDesignerDialog::getSvgExportSettings( QgsLayoutExporter::SvgExport
40004000
QDialog dialog;
40014001
Ui::QgsSvgExportOptionsDialog options;
40024002
options.setupUi( &dialog );
4003-
options.chkTextAsOutline->setChecked( prevTextRenderFormat == QgsRenderContext::TextFormatAlwaysOutlines );
4003+
4004+
options.mTextRenderFormatComboBox->addItem( tr( "Always Export Text as Paths (Recommended)" ), QgsRenderContext::TextFormatAlwaysOutlines );
4005+
options.mTextRenderFormatComboBox->addItem( tr( "Always Export Text as Text Objects" ), QgsRenderContext::TextFormatAlwaysText );
4006+
4007+
options.mTextRenderFormatComboBox->setCurrentIndex( options.mTextRenderFormatComboBox->findData( prevTextRenderFormat ) );
40044008
options.chkMapLayersAsGroup->setChecked( layersAsGroup );
40054009
options.mClipToContentGroupBox->setChecked( cropToContents );
40064010
options.mForceVectorCheckBox->setChecked( previousForceVector );
@@ -4020,7 +4024,7 @@ bool QgsLayoutDesignerDialog::getSvgExportSettings( QgsLayoutExporter::SvgExport
40204024
marginBottom = options.mBottomMarginSpinBox->value();
40214025
marginLeft = options.mLeftMarginSpinBox->value();
40224026
includeMetadata = options.mIncludeMetadataCheckbox->isChecked();
4023-
QgsRenderContext::TextRenderFormat textRenderFormat = options.chkTextAsOutline->isChecked() ? QgsRenderContext::TextFormatAlwaysOutlines : QgsRenderContext::TextFormatAlwaysText;
4027+
QgsRenderContext::TextRenderFormat textRenderFormat = static_cast< QgsRenderContext::TextRenderFormat >( options.mTextRenderFormatComboBox->currentData().toInt() );
40244028

40254029
if ( mLayout )
40264030
{

src/ui/layout/qgssvgexportoptions.ui

+11-17
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<property name="title">
2020
<string>SVG Options</string>
2121
</property>
22-
<layout class="QVBoxLayout" name="verticalLayout_2">
23-
<item>
22+
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
23+
<item row="0" column="0" colspan="2">
2424
<widget class="QCheckBox" name="chkMapLayersAsGroup">
2525
<property name="text">
2626
<string>Export map layers as SVG groups (may affect label placement)</string>
@@ -30,23 +30,17 @@
3030
</property>
3131
</widget>
3232
</item>
33-
<item>
34-
<widget class="QCheckBox" name="chkTextAsOutline">
35-
<property name="enabled">
36-
<bool>true</bool>
37-
</property>
38-
<property name="toolTip">
39-
<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>
40-
</property>
33+
<item row="3" column="1">
34+
<widget class="QComboBox" name="mTextRenderFormatComboBox"/>
35+
</item>
36+
<item row="3" column="0">
37+
<widget class="QLabel" name="label_6">
4138
<property name="text">
42-
<string>Render map labels as outlines</string>
43-
</property>
44-
<property name="checked">
45-
<bool>true</bool>
39+
<string>Text export</string>
4640
</property>
4741
</widget>
4842
</item>
49-
<item>
43+
<item row="1" column="0" colspan="2">
5044
<widget class="QCheckBox" name="mForceVectorCheckBox">
5145
<property name="toolTip">
5246
<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 @@
5650
</property>
5751
</widget>
5852
</item>
59-
<item>
53+
<item row="2" column="0" colspan="2">
6054
<widget class="QCheckBox" name="mIncludeMetadataCheckbox">
6155
<property name="text">
6256
<string>Export RDF metadata</string>
@@ -214,9 +208,9 @@
214208
</customwidgets>
215209
<tabstops>
216210
<tabstop>chkMapLayersAsGroup</tabstop>
217-
<tabstop>chkTextAsOutline</tabstop>
218211
<tabstop>mForceVectorCheckBox</tabstop>
219212
<tabstop>mIncludeMetadataCheckbox</tabstop>
213+
<tabstop>mTextRenderFormatComboBox</tabstop>
220214
<tabstop>mClipToContentGroupBox</tabstop>
221215
<tabstop>mTopMarginSpinBox</tabstop>
222216
<tabstop>mLeftMarginSpinBox</tabstop>

0 commit comments

Comments
 (0)