r22218 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 9 11:48:22 UTC 2017


Author: jghali
Date: Thu Nov  9 11:48:22 2017
New Revision: 22218

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22218
Log:
#14189: Fonts can't be outlined when exporting PDF/X

Added:
    trunk/Scribus/scribus/ui/fontembeddingcombo.cpp
    trunk/Scribus/scribus/ui/fontembeddingcombo.h
    trunk/Scribus/scribus/ui/fontembeddingmodel.cpp
    trunk/Scribus/scribus/ui/fontembeddingmodel.h
Modified:
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
    trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
    trunk/Scribus/scribus/ui/tabpdfoptions.cpp
    trunk/Scribus/scribus/ui/tabpdfoptions.ui
    trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj
    trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj.filters
    trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
    trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt	(original)
+++ trunk/Scribus/scribus/CMakeLists.txt	Thu Nov  9 11:48:22 2017
@@ -354,6 +354,8 @@
 	ui/extimageprops.h
 	ui/filedialogeventcatcher.h
 	ui/fontcombo.h
+	ui/fontembeddingcombo.h
+	ui/fontembeddingmodel.h
 	ui/fontlistview.h
 	ui/fontreplacedialog.h
 	ui/gradientaddedit.h
@@ -832,6 +834,8 @@
 	ui/extimageprops.cpp
 	ui/filedialogeventcatcher.cpp
 	ui/fontcombo.cpp
+	ui/fontembeddingcombo.cpp
+	ui/fontembeddingmodel.cpp
 	ui/fontlistview.cpp
 	ui/fontreplacedialog.cpp
 	ui/gradientaddedit.cpp

Modified: trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexport.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexport.cpp	Thu Nov  9 11:48:22 2017
@@ -110,12 +110,12 @@
 
 PDFOptions::PDFFontEmbedding Prefs_PDFExport::fontEmbeddingMode()
 {
-	return (PDFOptions::PDFFontEmbedding) fontEmbeddingCombo->currentIndex();
+	return fontEmbeddingCombo->embeddingMode();
 }
 
 QStringList Prefs_PDFExport::fontsToEmbed()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 	if (embeddingMode != PDFOptions::EmbedFonts)
 		return QStringList();
 
@@ -127,7 +127,7 @@
 
 QStringList Prefs_PDFExport::fontsToSubset()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 	if (embeddingMode != PDFOptions::EmbedFonts)
 		return QStringList();
 
@@ -139,7 +139,7 @@
 
 QStringList Prefs_PDFExport::fontsToOutline()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 	if (embeddingMode != PDFOptions::OutlineFonts)
 		return QStringList();
 
@@ -303,6 +303,7 @@
 	maxExportResolutionSpinBox->setValue(prefsData->pdfPrefs.PicRes);
 	maxExportResolutionSpinBox->setEnabled(prefsData->pdfPrefs.RecalcPic);
 
+	fontEmbeddingCombo->setEmbeddingMode(prefsData->pdfPrefs.FontEmbedding);
 	if (m_doc != 0 && exportingPDF)
 	{
 //	Build a list of all Fonts used in Annotations;
@@ -691,7 +692,7 @@
 	prefsData->pdfPrefs.MirrorV = pageMirrorVerticalToolButton->isChecked();
 	prefsData->pdfPrefs.RotateDeg = rotationComboBox->currentIndex() * 90;
 	prefsData->pdfPrefs.Articles = saveLinkedTextFramesAsArticlesCheckBox->isChecked();
-	prefsData->pdfPrefs.FontEmbedding = (PDFOptions::PDFFontEmbedding) fontEmbeddingCombo->currentIndex();
+	prefsData->pdfPrefs.FontEmbedding = fontEmbeddingCombo->embeddingMode();
 	prefsData->pdfPrefs.Encrypt = useEncryptionCheckBox->isChecked();
 	prefsData->pdfPrefs.UseLPI = useCustomRenderingCheckBox->isChecked();
 	prefsData->pdfPrefs.UseSpotColors = !convertSpotsToProcessCheckBox->isChecked();
@@ -1060,7 +1061,7 @@
 
 	if (i < 3)  // not PDF/X
 	{
-		fontEmbeddingCombo->setEnabled(true);
+		fontEmbeddingCombo->setNoEmbeddingEnabled(true);
 		enablePDFXWidgets(false);
 		tabWidget->setTabEnabled(2, true);
 		outputIntentionComboBox->setEnabled(true);
@@ -1097,13 +1098,18 @@
 			emit hasInfo();
 	}
 
-	fontEmbeddingCombo->setCurrentIndex(0);
-	fontEmbeddingCombo->setEnabled(false);
-
-	embeddedFontsListWidget->setEnabled(true);
-	embedAllButton->setEnabled(true);
-	subsettedFontsListWidget->setEnabled(true);
-	subsetAllButton->setEnabled(true);
+	PDFOptions::PDFFontEmbedding oldEmbeddingMode = fontEmbeddingCombo->embeddingMode();
+	fontEmbeddingCombo->setNoEmbeddingEnabled(false);
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
+
+	if (oldEmbeddingMode != embeddingMode)
+		embeddedFontsListWidget->clearSelection();
+	embeddedFontsListWidget->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	embedAllButton->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	if (oldEmbeddingMode != embeddingMode)
+		subsettedFontsListWidget->clearSelection();
+	subsettedFontsListWidget->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	subsetAllButton->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
 	toSubsetButton->setEnabled(true);
 	fromSubsetButton->setEnabled(true);
 
@@ -1365,7 +1371,7 @@
 
 void Prefs_PDFExport::EmbeddingModeChange()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 
 	embeddedFontsListWidget->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
 	embedAllButton->setEnabled(embeddingMode == PDFOptions::EmbedFonts);

Modified: trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui	(original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui	Thu Nov  9 11:48:22 2017
@@ -1306,23 +1306,7 @@
           </widget>
          </item>
          <item>
-          <widget class="QComboBox" name="fontEmbeddingCombo">
-           <item>
-            <property name="text">
-             <string>Embed or Subset</string>
-            </property>
-           </item>
-           <item>
-            <property name="text">
-             <string>Outline All Fonts</string>
-            </property>
-           </item>
-           <item>
-            <property name="text">
-             <string>Do Not Embed</string>
-            </property>
-           </item>
-          </widget>
+          <widget class="FontEmbeddingCombo" name="fontEmbeddingCombo"/>
          </item>
         </layout>
        </item>
@@ -1803,6 +1787,11 @@
    <class>ScrSpinBox</class>
    <extends>QDoubleSpinBox</extends>
    <header>ui/scrspinbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>FontEmbeddingCombo</class>
+   <extends>QComboBox</extends>
+   <header>ui/fontembeddingcombo.h</header>
   </customwidget>
   <customwidget>
    <class>NewMarginWidget</class>

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/scribus/ui/tabpdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.cpp	(original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.cpp	Thu Nov  9 11:48:22 2017
@@ -295,12 +295,12 @@
 
 PDFOptions::PDFFontEmbedding TabPDFOptions::fontEmbeddingMode()
 {
-	return (PDFOptions::PDFFontEmbedding) fontEmbeddingCombo->currentIndex();
+	return fontEmbeddingCombo->embeddingMode();
 }
 
 QStringList TabPDFOptions::fontsToEmbed()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 	if (embeddingMode != PDFOptions::EmbedFonts)
 		return QStringList();
 
@@ -312,7 +312,7 @@
 
 QStringList TabPDFOptions::fontsToSubset()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 	if (embeddingMode != PDFOptions::EmbedFonts)
 		return QStringList();
 
@@ -324,7 +324,7 @@
 
 QStringList TabPDFOptions::fontsToOutline()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 	if (embeddingMode != PDFOptions::OutlineFonts)
 		return QStringList();
 
@@ -396,7 +396,11 @@
 		Opts.Version == PDFOptions::PDFVersion_X3  ||
 		Opts.Version == PDFOptions::PDFVersion_X4 )
 	{
-		Opts.FontEmbedding = PDFOptions::EmbedFonts;
+		if (Opts.FontEmbedding != PDFOptions::EmbedFonts &&
+			Opts.FontEmbedding != PDFOptions::OutlineFonts)
+		{
+			Opts.FontEmbedding = PDFOptions::EmbedFonts;
+		}
 	}
 	fontEmbeddingCombo->setCurrentIndex((int) Opts.FontEmbedding);
 
@@ -744,7 +748,7 @@
 	pdfOptions.pageRangeSelection = AllPages->isChecked() ? 0 : 1;
 	pdfOptions.pageRangeString = PageNr->text();
 	pdfOptions.Articles = Article->isChecked();
-	pdfOptions.FontEmbedding =  (PDFOptions::PDFFontEmbedding) fontEmbeddingCombo->currentIndex();
+	pdfOptions.FontEmbedding =  fontEmbeddingCombo->embeddingMode();
 	pdfOptions.Encrypt = Encry->isChecked();
 	pdfOptions.UseLPI = UseLPI->isChecked();
 	pdfOptions.UseSpotColors = !useSpot->isChecked();
@@ -937,7 +941,7 @@
 
 	if (a < 3)  // not PDF/X
 	{
-		fontEmbeddingCombo->setEnabled(true);
+		fontEmbeddingCombo->setNoEmbeddingEnabled(true);
 		X3Group->setEnabled(false);
 		setTabEnabled(indexOf(tabSecurity), true);
 		OutCombo->setEnabled(true);
@@ -969,15 +973,20 @@
 		EmbedProfs2->setEnabled(false);
 	}
 
-	fontEmbeddingCombo->setCurrentIndex(0);
-	fontEmbeddingCombo->setEnabled(false);
-
-	EmbedList->setEnabled(true);
-	EmbedFonts->setEnabled(true);
-	SubsetList->setEnabled(true);
-	SubsetFonts->setEnabled(true);
-	ToSubset->setEnabled(true);
-	FromSubset->setEnabled(true);
+	PDFOptions::PDFFontEmbedding oldEmbeddingMode = fontEmbeddingCombo->embeddingMode();
+	fontEmbeddingCombo->setNoEmbeddingEnabled(false);
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
+
+	if (oldEmbeddingMode != embeddingMode)
+		EmbedList->clearSelection();
+	EmbedList->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	EmbedFonts->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	if (oldEmbeddingMode != embeddingMode)
+		SubsetList->clearSelection();
+	SubsetList->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	SubsetFonts->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	ToSubset->setEnabled(false); // Will be enabled when user select a font in appropriate list
+	FromSubset->setEnabled(false); // Will be enabled when user select a font in appropriate list
 
 	EmbedAll();
 	CheckBox10->setChecked(false);
@@ -1320,7 +1329,7 @@
 
 void TabPDFOptions::EmbeddingModeChange()
 {
-	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingCombo->embeddingMode();
 
 	EmbedList->clearSelection();
 	EmbedList->setEnabled(embeddingMode == PDFOptions::EmbedFonts);

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/scribus/ui/tabpdfoptions.ui
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.ui	(original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.ui	Thu Nov  9 11:48:22 2017
@@ -516,23 +516,7 @@
           </widget>
          </item>
          <item>
-          <widget class="QComboBox" name="fontEmbeddingCombo">
-           <item>
-            <property name="text">
-             <string>Embed or Subset</string>
-            </property>
-           </item>
-           <item>
-            <property name="text">
-             <string>Outline All Fonts</string>
-            </property>
-           </item>
-           <item>
-            <property name="text">
-             <string>Do Not Embed</string>
-            </property>
-           </item>
-          </widget>
+          <widget class="FontEmbeddingCombo" name="fontEmbeddingCombo"/>
          </item>
         </layout>
        </item>
@@ -1925,6 +1909,11 @@
    <class>ScrSpinBox</class>
    <extends>QDoubleSpinBox</extends>
    <header>ui/scrspinbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>FontEmbeddingCombo</class>
+   <extends>QComboBox</extends>
+   <header>ui/fontembeddingcombo.h</header>
   </customwidget>
  </customwidgets>
  <tabstops>

Modified: trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj
==============================================================================
--- trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj	(original)
+++ trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj	Thu Nov  9 11:48:22 2017
@@ -577,6 +577,8 @@
     <moc Include="..\..\..\scribus\ui\propertywidget_pathtext.h" />
     <moc Include="..\..\..\scribus\ui\propertywidget_textcolor.h" />
     <moc Include="..\..\..\scribus\ui\pagepropertiesdialog.h" />
+    <moc Include="..\..\..\scribus\ui\fontembeddingcombo.h" />
+    <moc Include="..\..\..\scribus\ui\fontembeddingmodel.h" />
     <ClInclude Include="..\..\..\scribus\ui\propertywidgetbase.h" />
     <moc Include="..\..\..\scribus\pslib.h" />
     <moc Include="..\..\..\scribus\ui\query.h" />
@@ -954,6 +956,8 @@
     <ClCompile Include="..\..\..\scribus\filewatcher.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\fontcombo.cpp" />
     <ClCompile Include="..\..\..\scribus\fontlistmodel.cpp" />
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingcombo.cpp" />
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingmodel.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\fontlistview.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\fontreplacedialog.cpp" />
     <ClCompile Include="..\..\..\scribus\fpoint.cpp" />

Modified: trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj.filters
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj.filters
==============================================================================
--- trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj.filters	(original)
+++ trunk/Scribus/win32/msvc2012/scribus-main/Scribus.vcxproj.filters	Thu Nov  9 11:48:22 2017
@@ -725,6 +725,12 @@
     <ClInclude Include="..\..\..\scribus\fonts\fontfeatures.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\scribus\ui\fontembeddingmodel.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\scribus\ui\fontembeddingcombo.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\scribus\desaxe\digester.cpp">
@@ -2324,6 +2330,12 @@
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\scribus\fonts\fontfeatures.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingcombo.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingmodel.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>

Modified: trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj
==============================================================================
--- trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj	(original)
+++ trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj	Thu Nov  9 11:48:22 2017
@@ -577,6 +577,8 @@
     <moc Include="..\..\..\scribus\ui\propertywidget_pathtext.h" />
     <moc Include="..\..\..\scribus\ui\propertywidget_textcolor.h" />
     <moc Include="..\..\..\scribus\ui\pagepropertiesdialog.h" />
+    <moc Include="..\..\..\scribus\ui\fontembeddingcombo.h" />
+    <moc Include="..\..\..\scribus\ui\fontembeddingmodel.h" />
     <ClInclude Include="..\..\..\scribus\ui\propertywidgetbase.h" />
     <moc Include="..\..\..\scribus\pslib.h" />
     <moc Include="..\..\..\scribus\ui\query.h" />
@@ -954,6 +956,8 @@
     <ClCompile Include="..\..\..\scribus\filewatcher.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\fontcombo.cpp" />
     <ClCompile Include="..\..\..\scribus\fontlistmodel.cpp" />
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingcombo.cpp" />
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingmodel.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\fontlistview.cpp" />
     <ClCompile Include="..\..\..\scribus\ui\fontreplacedialog.cpp" />
     <ClCompile Include="..\..\..\scribus\fpoint.cpp" />

Modified: trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22218&path=/trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters
==============================================================================
--- trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters	(original)
+++ trunk/Scribus/win32/msvc2015/scribus-main/Scribus.vcxproj.filters	Thu Nov  9 11:48:22 2017
@@ -725,6 +725,12 @@
     <ClInclude Include="..\..\..\scribus\fonts\fontfeatures.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\scribus\ui\fontembeddingmodel.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\..\scribus\ui\fontembeddingcombo.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\scribus\desaxe\digester.cpp">
@@ -2324,6 +2330,12 @@
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\scribus\fonts\fontfeatures.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingmodel.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\..\scribus\ui\fontembeddingcombo.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>




More information about the scribus-commit mailing list