r20122 by jghali - new font options GUI for pdf export

scribus-commit scribus-commit at lists.scribus.net
Sun May 24 01:58:39 UTC 2015


Author: jghali
Date: Sun May 24 01:58:38 2015
New Revision: 20122

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20122
Log:
new font options GUI for pdf export

Modified:
    trunk/Scribus/scribus/pdfoptions.h
    trunk/Scribus/scribus/pdfoptionsio.cpp
    trunk/Scribus/scribus/pdfoptionsio.h
    trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/ui/pdfexportdialog.cpp
    trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
    trunk/Scribus/scribus/ui/prefs_pdfexport.h
    trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
    trunk/Scribus/scribus/ui/tabpdfoptions.cpp
    trunk/Scribus/scribus/ui/tabpdfoptions.h
    trunk/Scribus/scribus/ui/tabpdfoptions.ui

Modified: trunk/Scribus/scribus/pdfoptions.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/pdfoptions.h
==============================================================================
--- trunk/Scribus/scribus/pdfoptions.h (original)
+++ trunk/Scribus/scribus/pdfoptions.h Sun May 24 01:58:38 2015
@@ -74,6 +74,13 @@
 		Compression_None = 3
 	};
 
+	enum PDFFontEmbedding
+	{
+		EmbedFonts = 0,
+		OutlineFonts = 1,
+		DontEmbed  = 2
+	};
+
 	/**
 	 * @author Craig Ringer
 	 * @brief Sanity check the options defined.
@@ -111,6 +118,7 @@
 	PDFVersion Version;
 	int  Resolution;
 	int  Binding;
+	PDFFontEmbedding FontEmbedding;
 	QList<QString> EmbedList;
 	QList<QString> SubsetList;
 	QList<QString> OutlineList;

Modified: trunk/Scribus/scribus/pdfoptionsio.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/pdfoptionsio.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfoptionsio.cpp (original)
+++ trunk/Scribus/scribus/pdfoptionsio.cpp Sun May 24 01:58:38 2015
@@ -129,6 +129,20 @@
 	addElem(m_root, "pdfVersion", pdfVersString);
 	addElem(m_root, "resolution", m_opts->Resolution);
 	addElem(m_root, "binding", m_opts->Binding);
+	QString embeddingModeString;
+	switch (m_opts->FontEmbedding)
+	{
+		case PDFOptions::OutlineFonts:
+			embeddingModeString = "OutlineFonts";
+			break;
+		case PDFOptions::DontEmbed:
+			embeddingModeString = "DontEmbed";
+			break;
+		default:
+			embeddingModeString = "EmbedFonts";
+			break;
+	}
+	addElem(m_root, "fontEmbedding", embeddingModeString);
 	addList(m_root, "embedFonts", m_opts->EmbedList);
 	addList(m_root, "subsetFonts", m_opts->SubsetList);
 	addElem(m_root, "mirrorH", m_opts->MirrorH);
@@ -351,6 +365,8 @@
 		return false;
 	if (!readElem(m_root, "binding", &m_opts->Binding))
 		return false;
+	if (!readPDFFontEmbeddingMode())
+		return false;
 	if (!readList(m_root, "embedFonts", &m_opts->EmbedList))
 		return false;
 	if (!readList(m_root, "subsetFonts", &m_opts->SubsetList))
@@ -471,6 +487,34 @@
 			.arg(QObject::tr("<pdfVersion> invalid", "Load PDF settings"));
 		return false;
 	}
+}
+
+bool PDFOptionsIO::readPDFFontEmbeddingMode()
+{
+	QString embeddingMode;
+	if (!readElem(m_root, "fontEmbedding", &embeddingMode))
+		return false;
+
+	if (embeddingMode == "EmbedFonts")
+	{
+		m_opts->FontEmbedding = PDFOptions::EmbedFonts;
+		return true;
+	}
+	else if (embeddingMode == "OutlineFonts")
+	{
+		m_opts->FontEmbedding = PDFOptions::OutlineFonts;
+		return true;
+	}
+	else if (embeddingMode == "DontEmbed")
+	{
+		m_opts->FontEmbedding = PDFOptions::DontEmbed;
+		return true;
+	}
+
+	m_opts->FontEmbedding = PDFOptions::EmbedFonts;
+	m_error = QObject::tr("Unable to read settings XML: %1")
+			.arg(QObject::tr("<fontEmbedding> invalid", "Load PDF settings"));
+	return false;
 }
 
 // returns a null node on failure

Modified: trunk/Scribus/scribus/pdfoptionsio.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/pdfoptionsio.h
==============================================================================
--- trunk/Scribus/scribus/pdfoptionsio.h (original)
+++ trunk/Scribus/scribus/pdfoptionsio.h Sun May 24 01:58:38 2015
@@ -121,6 +121,7 @@
 	bool readList(QDomElement& parent, QString name, QList<QString>* value);
 
 	bool readPDFVersion();
+	bool readPDFFontEmbeddingMode();
 	bool readPresentationData();
 	bool readLPISettings();
 

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Sun May 24 01:58:38 2015
@@ -1183,6 +1183,7 @@
 				m_Doc->pdfOptions().Resolution = pg.attribute("Resolution").toInt();
 				m_Doc->pdfOptions().Binding = pg.attribute("Binding").toInt();
 				m_Doc->pdfOptions().fileName = "";
+				m_Doc->pdfOptions().FontEmbedding = PDFOptions::EmbedFonts;
 				m_Doc->pdfOptions().isGrayscale = false;
 				m_Doc->pdfOptions().UseRGB = static_cast<bool>(pg.attribute("RGBMode", "0").toInt());
 				m_Doc->pdfOptions().UseProfiles = static_cast<bool>(pg.attribute("UseProfiles", "0").toInt());

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sun May 24 01:58:38 2015
@@ -1536,6 +1536,7 @@
 	doc->pdfOptions().Resolution = attrs.valueAsInt("Resolution");
 	doc->pdfOptions().Binding    = attrs.valueAsInt("Binding");
 	doc->pdfOptions().fileName   = "";
+	doc->pdfOptions().FontEmbedding = (PDFOptions::PDFFontEmbedding) attrs.valueAsInt("FontEmbedding", 0);
 	doc->pdfOptions().isGrayscale   = attrs.valueAsBool("Grayscale", false);
 	doc->pdfOptions().UseRGB        = attrs.valueAsBool("RGBMode", false);
 	doc->pdfOptions().UseProfiles   = attrs.valueAsBool("UseProfiles", false);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Sun May 24 01:58:38 2015
@@ -641,6 +641,7 @@
 				m_Doc->pdfOptions().Resolution = pg.attribute("Resolution").toInt();
 				m_Doc->pdfOptions().Binding = pg.attribute("Binding").toInt();
 				m_Doc->pdfOptions().fileName = "";
+				m_Doc->pdfOptions().FontEmbedding = PDFOptions::EmbedFonts;
 				m_Doc->pdfOptions().isGrayscale = static_cast<bool>(pg.attribute("Grayscale", "0").toInt());
 				m_Doc->pdfOptions().UseRGB = static_cast<bool>(pg.attribute("RGBMode", "0").toInt());
 				m_Doc->pdfOptions().UseProfiles = static_cast<bool>(pg.attribute("UseProfiles", "0").toInt());

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun May 24 01:58:38 2015
@@ -3066,7 +3066,7 @@
 	doc->pdfOptions().Articles   = attrs.valueAsBool("Articles");
 	doc->pdfOptions().Thumbnails = attrs.valueAsBool("Thumbnails");
 	doc->pdfOptions().Compress   = attrs.valueAsBool("Compress");
-	doc->pdfOptions().CompressMethod = (PDFOptions::PDFCompression)attrs.valueAsInt("CMethod", 0);
+	doc->pdfOptions().CompressMethod = (PDFOptions::PDFCompression) attrs.valueAsInt("CMethod", 0);
 	doc->pdfOptions().Quality    = attrs.valueAsInt("Quality", 0);
 	doc->pdfOptions().RecalcPic  = attrs.valueAsBool("RecalcPic");
 	doc->pdfOptions().embedPDF   = attrs.valueAsBool("EmbedPDF", false);
@@ -3084,6 +3084,8 @@
 	doc->pdfOptions().Resolution = attrs.valueAsInt("Resolution");
 	doc->pdfOptions().Binding    = attrs.valueAsInt("Binding");
 	doc->pdfOptions().fileName   = "";
+
+	doc->pdfOptions().FontEmbedding = (PDFOptions::PDFFontEmbedding) attrs.valueAsInt("FontEmbedding", 0);
 	doc->pdfOptions().isGrayscale   = attrs.valueAsBool("Grayscale", false);
 	doc->pdfOptions().UseRGB        = attrs.valueAsBool("RGBMode", false);
 	doc->pdfOptions().UseProfiles   = attrs.valueAsBool("UseProfiles", false);
@@ -3127,7 +3129,7 @@
 	doc->pdfOptions().openAction    = attrs.valueAsString("openAction", "");
 
 	QStringRef tagName = reader.name();
-	while(!reader.atEnd() && !reader.hasError())
+	while (!reader.atEnd() && !reader.hasError())
 	{
 		reader.readNext();
 		if (reader.isEndElement() && (reader.name() == tagName))
@@ -3136,7 +3138,7 @@
 			continue;
 		QStringRef tName = reader.name();
 		attrs = reader.scAttributes();
-		if(tName == "LPI")
+		if (tName == "LPI")
 		{
 			struct LPIData lpo;
 			lpo.Angle     = attrs.valueAsInt("Angle");
@@ -3144,19 +3146,19 @@
 			lpo.SpotFunc  = attrs.valueAsInt("SpotFunction");
 			doc->pdfOptions().LPISettings[attrs.valueAsString("Color")] = lpo;
 		}
-		if(tName == "Fonts")
+		if (tName == "Fonts")
 		{
 			QString fname = attrs.valueAsString("Name");
 			if (!doc->pdfOptions().EmbedList.contains(fname))
 				doc->pdfOptions().EmbedList.append(fname);
 		}
-		if(tName == "Subset")
+		if (tName == "Subset")
 		{
 			QString sname = attrs.valueAsString("Name");
 			if (!doc->pdfOptions().SubsetList.contains(sname))
 				doc->pdfOptions().SubsetList.append(sname);
 		}
-		if(tName == "Effekte")
+		if (tName == "Effekte")
 		{
 			struct PDFPresentationData ef;
 			ef.pageEffectDuration =  attrs.valueAsInt("pageEffectDuration");

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sun May 24 01:58:38 2015
@@ -1073,6 +1073,7 @@
 	docu.writeAttribute("RotateDeg", static_cast<int>(m_Doc->pdfOptions().RotateDeg));
 	docu.writeAttribute("PresentMode", static_cast<int>(m_Doc->pdfOptions().PresentMode));
 	docu.writeAttribute("RecalcPic", static_cast<int>(m_Doc->pdfOptions().RecalcPic));
+	docu.writeAttribute("FontEmbedding", static_cast<int>(m_Doc->pdfOptions().FontEmbedding));
 	docu.writeAttribute("Grayscale", static_cast<int>(m_Doc->pdfOptions().isGrayscale));
 	docu.writeAttribute("RGBMode", static_cast<int>(m_Doc->pdfOptions().UseRGB));
 	docu.writeAttribute("UseProfiles", static_cast<int>(m_Doc->pdfOptions().UseProfiles));
@@ -1118,16 +1119,21 @@
 	docu.writeAttribute("openAfterExport", static_cast<int>(m_Doc->pdfOptions().openAfterExport));
 	docu.writeAttribute("PageLayout", m_Doc->pdfOptions().PageLayout);
 	docu.writeAttribute("openAction", m_Doc->pdfOptions().openAction);
-	for (int pdoF = 0; pdoF < m_Doc->pdfOptions().EmbedList.count(); ++pdoF)
+
+	const QList<QString>& embedList = m_Doc->pdfOptions().EmbedList;
+	for (int pdoF = 0; pdoF < embedList.count(); ++pdoF)
 	{
 		docu.writeEmptyElement("Fonts");
-		docu.writeAttribute("Name", m_Doc->pdfOptions().EmbedList[pdoF]);
-	}
-	for (int pdoS = 0; pdoS < m_Doc->pdfOptions().SubsetList.count(); ++pdoS)
+		docu.writeAttribute("Name", embedList.at(pdoF));
+	}
+
+	const QList<QString>& subsetList = m_Doc->pdfOptions().SubsetList;
+	for (int pdoS = 0; pdoS < subsetList.count(); ++pdoS)
 	{
 		docu.writeEmptyElement("Subset");
-		docu.writeAttribute("Name", m_Doc->pdfOptions().SubsetList[pdoS]);
-	}
+		docu.writeAttribute("Name", subsetList.at(pdoS));
+	}
+
 	QMap<QString,LPIData>::Iterator itlp;
 	for (itlp = m_Doc->pdfOptions().LPISettings.begin(); itlp != m_Doc->pdfOptions().LPISettings.end(); ++itlp)
 	{

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sun May 24 01:58:38 2015
@@ -429,6 +429,7 @@
 	appPrefs.pdfPrefs.Version = PDFOptions::PDFVersion_14;
 	appPrefs.pdfPrefs.Resolution = 300;
 	appPrefs.pdfPrefs.Binding = 0;
+	appPrefs.pdfPrefs.FontEmbedding = PDFOptions::EmbedFonts;
 	appPrefs.pdfPrefs.EmbedList.clear();
 	appPrefs.pdfPrefs.SubsetList.clear();
 	appPrefs.pdfPrefs.MirrorH = false;
@@ -1738,6 +1739,7 @@
 	pdf.setAttribute("PicRes", appPrefs.pdfPrefs.PicRes);
 	pdf.setAttribute("Resolution", appPrefs.pdfPrefs.Resolution);
 	pdf.setAttribute("Version", appPrefs.pdfPrefs.Version);
+	pdf.setAttribute("FontEmbedding", static_cast<int>(appPrefs.pdfPrefs.FontEmbedding));
 	pdf.setAttribute("Intent", appPrefs.pdfPrefs.Intent);
 	pdf.setAttribute("Intent2", appPrefs.pdfPrefs.Intent2);
 	pdf.setAttribute("SolidProfile", appPrefs.pdfPrefs.SolidProf);
@@ -2470,10 +2472,11 @@
 			appPrefs.pdfPrefs.RotateDeg = dc.attribute("RotateDeg", "0").toInt();
 			appPrefs.pdfPrefs.PresentMode = static_cast<bool>(dc.attribute("PresentMode").toInt());
 			appPrefs.pdfPrefs.PicRes = dc.attribute("PicRes").toInt();
-			appPrefs.pdfPrefs.Version = (PDFOptions::PDFVersion)dc.attribute("Version").toInt();
+			appPrefs.pdfPrefs.Version = (PDFOptions::PDFVersion) dc.attribute("Version").toInt();
 			appPrefs.pdfPrefs.Resolution = dc.attribute("Resolution").toInt();
 			appPrefs.pdfPrefs.Binding = dc.attribute("Binding").toInt();
 			appPrefs.pdfPrefs.fileName = "";
+			appPrefs.pdfPrefs.FontEmbedding = (PDFOptions::PDFFontEmbedding)  dc.attribute("FontEmbedding", "0").toInt();
 			appPrefs.pdfPrefs.isGrayscale = static_cast<bool>(dc.attribute("Grayscale", "0").toInt());
 			appPrefs.pdfPrefs.UseRGB = static_cast<bool>(dc.attribute("RGBMode", "0").toInt());
 			appPrefs.pdfPrefs.UseProfiles = static_cast<bool>(dc.attribute("UseProfiles", "0").toInt());

Modified: trunk/Scribus/scribus/ui/pdfexportdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/ui/pdfexportdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pdfexportdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/pdfexportdialog.cpp Sun May 24 01:58:38 2015
@@ -239,9 +239,10 @@
 	m_opts.CompressMethod = (PDFOptions::PDFCompression) Options->CMethod->currentIndex();
 	m_opts.Quality = Options->CQuality->currentIndex();
 	m_opts.Resolution = Options->Resolution->value();
+	m_opts.FontEmbedding = Options->fontEmbeddingMode();
 	m_opts.EmbedList = Options->fontsToEmbed();
 	m_opts.SubsetList = Options->fontsToSubset();
-    m_opts.OutlineList = Options->fontsToOutline();
+	m_opts.OutlineList = Options->fontsToOutline();
 	m_opts.RecalcPic = Options->DSColor->isChecked();
 	m_opts.PicRes = Options->ValC->value();
 	m_opts.embedPDF = Options->EmbedPDF->isChecked();

Modified: trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/ui/prefs_pdfexport.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexport.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexport.cpp Sun May 24 01:58:38 2015
@@ -12,7 +12,6 @@
 #include "ui/createrange.h"
 #include "prefsstructs.h"
 
-#include "fontlistmodel.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
 #include "scribusview.h"
@@ -32,10 +31,8 @@
 	pageMirrorVerticalToolButton->setIcon(QIcon(loadIcon("16/flip-object-vertical.png")));
 	unitChange(0);
 	languageChange();
-    
-    FontTable->setModel(new FontListModel(this, doc));
-    FontTable->resizeColumnsToContents();
-    
+
+	connect(fontEmbeddingCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(EmbeddingModeChange()));
 	connect(exportChosenPagesRadioButton, SIGNAL(toggled(bool)), this, SLOT(enableRangeControls(bool)));
 	connect(exportRangeMorePushButton, SIGNAL(clicked()), this, SLOT(createPageNumberRange()));
 	connect(maxResolutionLimitCheckBox, SIGNAL(clicked()), this, SLOT(setMaximumResolution()));
@@ -111,34 +108,63 @@
 {
 }
 
+PDFOptions::PDFFontEmbedding Prefs_PDFExport::fontEmbeddingMode()
+{
+	return (PDFOptions::PDFFontEmbedding) fontEmbeddingCombo->currentIndex();
+}
+
 QStringList Prefs_PDFExport::fontsToEmbed()
 {
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	if (embeddingMode != PDFOptions::EmbedFonts)
+		return QStringList();
+
 	QStringList fonts;
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-	for (int i = 0; i < table->rowCount(); ++i)
-        if (table->data(table->index(i, FontListModel::FontEmbed)).toBool())
-            fonts.append(table->data(table->index(i, FontListModel::FontName)).toString());
+	for (int i = 0; i < embeddedFontsListWidget->count(); ++i)
+		fonts.append(embeddedFontsListWidget->item(i)->text());
 	return fonts;
 }
 
 QStringList Prefs_PDFExport::fontsToSubset()
 {
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	if (embeddingMode != PDFOptions::EmbedFonts)
+		return QStringList();
+
 	QStringList fonts;
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int i = 0; i < table->rowCount(); ++i)
-        if (table->data(table->index(i, FontListModel::FontSubset)).toBool())
-            fonts.append(table->data(table->index(i, FontListModel::FontName)).toString());
+	for (int i = 0; i < subsettedFontsListWidget->count(); ++i)
+		fonts.append(subsettedFontsListWidget->item(i)->text());
 	return fonts;
 }
 
 QStringList Prefs_PDFExport::fontsToOutline()
 {
-    QStringList fonts;
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int i = 0; i < table->rowCount(); ++i)
-        if (table->data(table->index(i, FontListModel::FontOutline)).toBool())
-            fonts.append(table->data(table->index(i, FontListModel::FontName)).toString());
-    return fonts;
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	if (embeddingMode != PDFOptions::OutlineFonts)
+		return QStringList();
+
+	if (m_doc)
+		return m_doc->usedFonts().keys();
+	return QStringList();
+}
+
+QListWidgetItem* Prefs_PDFExport::addFontItem(QString fontName, QListWidget* fontList)
+{
+	QListWidgetItem* item = 0;
+	if (!AllFonts.contains(fontName))
+		return 0;
+
+	const ScFace face = AllFonts.value(fontName);
+	if (face.isReplacement())
+		item = new QListWidgetItem( QIcon(loadIcon("font_subst16.png")), fontName, fontList );
+	else if (face.type() == ScFace::TYPE1)
+		item = new QListWidgetItem( QIcon(loadIcon("font_type1_16.png")), fontName, fontList );
+	else if (face.type() == ScFace::TTF)
+		item = new QListWidgetItem( QIcon(loadIcon("font_truetype16.png")), fontName, fontList );
+	else if (face.type() == ScFace::OTF)
+		item = new QListWidgetItem( QIcon(loadIcon("font_otf16.png")), fontName, fontList );
+
+	return item;
 }
 
 void Prefs_PDFExport::unitChange(int unitIndex)
@@ -327,42 +353,27 @@
 			}
 			allItems.clear();
 		}
-        
-        FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-        table->setFonts(m_doc->usedFonts().keys());
-        if (!FontTable->isSortingEnabled())
-            FontTable->sortByColumn(FontListModel::SortIndex, Qt::AscendingOrder);
-#if 0
-		QMap<QString,int>::const_iterator it;
-		availableFontsListWidget->clear();
-		for (it = m_doc->usedFonts().constBegin(); it != m_doc->usedFonts().constEnd(); ++it)
-		{
-			if (AllFonts[it.key()].isReplacement())
-				new QListWidgetItem( QIcon(loadIcon("font_subst16.png")), it.key(), availableFontsListWidget );
-			else if (AllFonts[it.key()].type() == ScFace::TYPE1)
-				new QListWidgetItem( QIcon(loadIcon("font_type1_16.png")), it.key(), availableFontsListWidget );
-			else if (AllFonts[it.key()].type() == ScFace::TTF)
-				new QListWidgetItem( QIcon(loadIcon("font_truetype16.png")), it.key(), availableFontsListWidget );
-			else if (AllFonts[it.key()].type() == ScFace::OTF)
-				new QListWidgetItem( QIcon(loadIcon("font_otf16.png")), it.key(), availableFontsListWidget );
-		}
-		toEmbedButton->setEnabled(false);
-		fromEmbedButton->setEnabled(false);
-		toOutlineButton->setEnabled(false);
-		fromOutlineButton->setEnabled(false);
-
-        if ((Opts.EmbedList.count() == 0) && (Opts.SubsetList.count() == 0) && (Opts.firstUse))
+		toSubsetButton->setEnabled(false);
+		fromSubsetButton->setEnabled(false);
+
+		if ((Opts.EmbedList.count() == 0) && (Opts.SubsetList.count() == 0) && (Opts.firstUse))
 			EmbedAll();
 		else
 		{
+			QStringList docFonts = m_doc->usedFonts().keys();
 			embeddedFontsListWidget->clear();
-			for (int fe = 0; fe < Opts.EmbedList.count(); ++fe)
-				embeddedFontsListWidget->addItem(Opts.EmbedList[fe]);
-			if (Opts.SubsetList.count() != 0)
+			subsettedFontsListWidget->clear();
+			for (int fe = 0; fe < docFonts.count(); ++ fe)
 			{
-				outlinedFontsListWidget->clear();
-				for (int fe = 0; fe < Opts.SubsetList.count(); ++fe)
-					outlinedFontsListWidget->addItem(Opts.SubsetList[fe]);
+				QString fontName = docFonts.at(fe);
+				if (Opts.EmbedList.contains(fontName))
+					addFontItem(fontName, embeddedFontsListWidget);
+				else
+				{
+					addFontItem(fontName, subsettedFontsListWidget);
+					if (!Opts.SubsetList.contains(fontName))
+						Opts.SubsetList.append(fontName);
+				}
 			}
 			QMap<QString, QString>::Iterator itAnn;
 			for (itAnn = AnnotationFonts.begin(); itAnn != AnnotationFonts.end(); ++itAnn)
@@ -370,19 +381,17 @@
 				QList<QListWidgetItem *> itEmbed = embeddedFontsListWidget->findItems(itAnn.key(), Qt::MatchExactly);
 				if (itEmbed.count() == 0)
 				{
-					embeddedFontsListWidget->addItem(itAnn.key());
-					embeddedFontsListWidget->item(embeddedFontsListWidget->count()-1)->setFlags(Qt::ItemIsEnabled);
+					QListWidgetItem* item = addFontItem(itAnn.key(), embeddedFontsListWidget);
+					item->setFlags(Qt::ItemIsEnabled);
 				}
-				QList<QListWidgetItem *> itOutline = outlinedFontsListWidget->findItems(itAnn.key(), Qt::MatchExactly);
-				for (int itOut = 0; itOut < itOutline.count(); ++itOut)
+				QList<QListWidgetItem *> itSubset = subsettedFontsListWidget->findItems(itAnn.key(), Qt::MatchExactly);
+				for (int itOut = 0; itOut < itSubset.count(); ++itOut)
 				{
-					QListWidgetItem* item = itOutline[itOut];
-					delete outlinedFontsListWidget->takeItem(outlinedFontsListWidget->row(item));
+					QListWidgetItem* item = itSubset[itOut];
+					delete subsettedFontsListWidget->takeItem(subsettedFontsListWidget->row(item));
 				}
 			}
 		}
-#endif
-
 		enabledEffectsCheckBox->setChecked(Opts.PresentMode);
 		showPagePreviewsCheckBox->setChecked(false);
 		effectsPageListWidget->clear();
@@ -623,15 +632,12 @@
 
 	if (m_doc != 0 && exportingPDF)
 	{
-//		connect(embedAllButton, SIGNAL(clicked()), this, SLOT(EmbedAll()));
-//		connect(availableFontsListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelAFont(QListWidgetItem*)));
-//		connect(embeddedFontsListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelEFont(QListWidgetItem*)));
-//		connect(toEmbedButton, SIGNAL(clicked()), this, SLOT(PutToEmbed()));
-//		connect(fromEmbedButton, SIGNAL(clicked()), this, SLOT(RemoveEmbed()));
-//		connect(outlineAllButton, SIGNAL(clicked()), this, SLOT(OutlineAll()));
-//		connect(outlinedFontsListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelSFont(QListWidgetItem*)));
-//		connect(toOutlineButton, SIGNAL(clicked()), this, SLOT(PutToOutline()));
-//		connect(fromOutlineButton, SIGNAL(clicked()), this, SLOT(RemoveOutline()));
+		connect(embedAllButton, SIGNAL(clicked()), this, SLOT(EmbedAll()));
+		connect(embeddedFontsListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelEFont(QListWidgetItem*)));
+		connect(subsetAllButton, SIGNAL(clicked()), this, SLOT(SubsetAll()));
+		connect(subsettedFontsListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelSFont(QListWidgetItem*)));
+		connect(toSubsetButton, SIGNAL(clicked()), this, SLOT(PutToSubset()));
+		connect(fromSubsetButton, SIGNAL(clicked()), this, SLOT(RemoveSubset()));
 		connect(showPagePreviewsCheckBox, SIGNAL(clicked()), this, SLOT(PagePr()));
 		connect(effectsPageListWidget, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(SetPgEff()));
 		connect(effectTypeComboBox, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
@@ -642,7 +648,7 @@
 //		connect(pdfx3InfoStringLineEdit, SIGNAL(editingFinished()), this, SLOT(checkInfo()));
 		connect(useDocumentBleedsCheckBox, SIGNAL(clicked()), this, SLOT(doDocBleeds()));
 
-		EmbedAllFontsButton->setToolTip( "<qt>" + tr( "Embed fonts into the PDF. Embedding the fonts will preserve the layout and appearance of your document." ) + "</qt>");
+		embedAllButton->setToolTip( "<qt>" + tr( "Embed fonts into the PDF. Embedding the fonts will preserve the layout and appearance of your document." ) + "</qt>");
 		enabledEffectsCheckBox->setToolTip( "<qt>" + tr( "Enables presentation effects when using Adobe® Reader® and other PDF viewers which support this in full screen mode." ) + "</qt>");
 		showPagePreviewsCheckBox->setToolTip( "<qt>" + tr( "Show page previews of each page listed above." ) + "</qt>");
 		effectDurationSpinBox->setToolTip( "<qt>" + tr( "Length of time the page is shown before the presentation starts on the selected page. Setting 0 will disable automatic page transition." ) + "</qt>" );
@@ -652,8 +658,7 @@
 		effectInOutComboBox->setToolTip( "<qt>" + tr( "Starting position for the box and split effects." ) + "</qt>" );
 		effectDirectionComboBox->setToolTip( "<qt>" + tr( "Direction of the glitter or wipe effects." ) + "</qt>" );
 		applyEffectToAllPagesPushButton->setToolTip( "<qt>" + tr( "Apply the selected effect to all pages." ) + "</qt>" );
-		OutlineAllFontsButton->setToolTip( "<qt>" + tr("Convert all glyphs in the document to outlines.") + "</qt>");
-        SubsetAllFontsButton->setToolTip( "<qt>" + tr("Embed only subset fonts with glyphs used in the document into the PDF.") + "</qt>");
+		subsetAllButton->setToolTip( "<qt>" + tr("Embed only subset fonts with glyphs used in the document into the PDF.") + "</qt>");
 		singlePageRadioButton->setToolTip( "<qt>" + tr( "Show the document in single page mode" ) + "</qt>" );
 		continuousPagesRadioButton->setToolTip( "<qt>" + tr( "Show the document in single page mode with the pages displayed continuously end to end like a scroll" ) + "</qt>" );
 		doublePageLeftRadioButton->setToolTip( "<qt>" + tr( "Show the document with facing pages, starting with the first page displayed on the left" ) + "</qt>" );
@@ -686,6 +691,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.Encrypt = useEncryptionCheckBox->isChecked();
 	prefsData->pdfPrefs.UseLPI = useCustomRenderingCheckBox->isChecked();
 	prefsData->pdfPrefs.UseSpotColors = !convertSpotsToProcessCheckBox->isChecked();
@@ -1045,6 +1051,7 @@
 
 	if (i < 3)  // not PDF/X
 	{
+		fontEmbeddingCombo->setEnabled(true);
 		enablePDFXWidgets(false);
 		tabWidget->setTabEnabled(2, true);
 		outputIntentionComboBox->setEnabled(true);
@@ -1053,10 +1060,7 @@
 		if (m_doc != 0 && exportingPDF)
 		{
 			enabledEffectsCheckBox->setEnabled(true);
-			EmbedAllFontsButton->setEnabled(true);
-			//if (embeddedFontsListWidget->count() != 0)
-			//	fromEmbedButton->setEnabled(true);
-			//toEmbedButton->setEnabled(true);
+			embedAllButton->setEnabled(true);
 		}
 
 		return;
@@ -1078,13 +1082,22 @@
 		enabledEffectsCheckBox->setChecked(false);
 		enabledEffectsCheckBox->setEnabled(false);
 //		EmbedFonts->setEnabled(false);
-//		fromEmbedButton->setEnabled(false);
-//		toEmbedButton->setEnabled(false);
 		if (pdfx3InfoStringLineEdit->text().isEmpty())
 			emit noInfo();
 		else
 			emit hasInfo();
 	}
+
+	fontEmbeddingCombo->setCurrentIndex(0);
+	fontEmbeddingCombo->setEnabled(false);
+
+	embeddedFontsListWidget->setEnabled(true);
+	embedAllButton->setEnabled(true);
+	subsettedFontsListWidget->setEnabled(true);
+	subsetAllButton->setEnabled(true);
+	toSubsetButton->setEnabled(true);
+	fromSubsetButton->setEnabled(true);
+
 	enablePGI();
 	pdfx3OutputProfileComboBox->setEnabled(true);
 	pdfx3InfoStringLineEdit->setEnabled(true);
@@ -1131,71 +1144,67 @@
 	}
 }
 
+void Prefs_PDFExport::EmbedAll()
+{
+	embeddedFontsListWidget->clear();
+	subsettedFontsListWidget->clear();
+	toSubsetButton->setEnabled(false);
+	fromSubsetButton->setEnabled(false);
+
+	QStringList docFonts;
+	if (m_doc)
+		docFonts = m_doc->usedFonts().keys();
+
+	for (int a=0; a < docFonts.count(); ++a)
+	{
+		QString fontName = docFonts.at(a);
+		if (!AllFonts[fontName].subset())
+		{
+			QListWidgetItem* item = addFontItem(fontName, embeddedFontsListWidget);
+			if (AnnotationFonts.contains(item->text()))
+				item->setFlags(Qt::ItemIsEnabled);
+		}
+		else if (AnnotationFonts.contains(fontName))
+		{
+			QListWidgetItem* item = addFontItem(fontName, embeddedFontsListWidget);
+			item->setFlags(Qt::ItemIsEnabled);
+		}
+		else
+		{
+			addFontItem(fontName, subsettedFontsListWidget);
+		}
+	}
+}
+
 void Prefs_PDFExport::SubsetAll()
 {
-}
-
-void Prefs_PDFExport::EmbedAll()
-    {
-#if 0
 	embeddedFontsListWidget->clear();
-	outlinedFontsListWidget->clear();
-	fromEmbedButton->setEnabled(false);
-	toEmbedButton->setEnabled(false);
-	toOutlineButton->setEnabled(false);
-	fromOutlineButton->setEnabled(false);
-	for (int a=0; a < availableFontsListWidget->count(); ++a)
-	{
-		QListWidgetItem* item = availableFontsListWidget->item(a);
-		if ((item->flags() & Qt::ItemIsSelectable) == 0)
-			continue;
-		if (!AllFonts[item->text()].subset())
-		{
-			embeddedFontsListWidget->addItem(item->text());
-			if (AnnotationFonts.contains(item->text()))
-				embeddedFontsListWidget->item(embeddedFontsListWidget->count()-1)->setFlags(Qt::ItemIsEnabled);
+	subsettedFontsListWidget->clear();
+	toSubsetButton->setEnabled(false);
+	fromSubsetButton->setEnabled(false);
+
+	QStringList docFonts;
+	if (m_doc)
+		docFonts = m_doc->usedFonts().keys();
+
+	for (int a = 0; a < docFonts.count(); ++a)
+	{
+		QString fontName = docFonts.at(a);
+		if (AnnotationFonts.contains(fontName))
+		{
+			QListWidgetItem* item = addFontItem(fontName, embeddedFontsListWidget);
+			item->setFlags(Qt::ItemIsEnabled);
 		}
 		else
 		{
-			if (AnnotationFonts.contains(item->text()))
-			{
-				embeddedFontsListWidget->addItem(item->text());
-				embeddedFontsListWidget->item(embeddedFontsListWidget->count()-1)->setFlags(Qt::ItemIsEnabled);
-			}
-			else
-			{
-				outlinedFontsListWidget->addItem(item->text());
-			}
-		}
-	}
-#endif
+			addFontItem(fontName, subsettedFontsListWidget);
+		}
+	}
 }
 
 void Prefs_PDFExport::OutlineAll()
 {
-#if 0
-	embeddedFontsListWidget->clear();
-	outlinedFontsListWidget->clear();
-	fromEmbedButton->setEnabled(false);
-	toEmbedButton->setEnabled(false);
-	toOutlineButton->setEnabled(false);
-	fromOutlineButton->setEnabled(false);
-	for (int a = 0; a < availableFontsListWidget->count(); ++a)
-	{
-		QListWidgetItem* item = availableFontsListWidget->item(a);
-		if ((item->flags() & Qt::ItemIsSelectable) == 0)
-			continue;
-		if (AnnotationFonts.contains(item->text()))
-		{
-			embeddedFontsListWidget->addItem(item->text());
-			embeddedFontsListWidget->item(embeddedFontsListWidget->count()-1)->setFlags(Qt::ItemIsEnabled);
-		}
-		else
-		{
-			outlinedFontsListWidget->addItem(item->text());
-		}
-	}
-#endif
+	// Nothing to do at this point
 }
 
 void Prefs_PDFExport::doDocBleeds()
@@ -1270,62 +1279,33 @@
 	}
 }
 
-void Prefs_PDFExport::SelAFont(QListWidgetItem *c)
-{
-#if 0
+void Prefs_PDFExport::SelEFont(QListWidgetItem *c)
+{
 	if (c != NULL)
 	{
-		fromEmbedButton->setEnabled(false);
 		if (c->flags() & Qt::ItemIsSelectable)
-			toEmbedButton->setEnabled(true);
-		toOutlineButton->setEnabled(false);
-		fromOutlineButton->setEnabled(false);
+			toSubsetButton->setEnabled(true);
+		fromSubsetButton->setEnabled(false);
+		subsettedFontsListWidget->clearSelection();
+	}
+}
+
+void Prefs_PDFExport::SelSFont(QListWidgetItem *c)
+{
+	if (c != NULL)
+	{
+		if (pdfVersionComboBox->currentIndex() == 4)
+		{
+			if ((AllFonts[c->text()].type() == ScFace::OTF) || (AllFonts[c->text()].subset()))
+				fromSubsetButton->setEnabled(false);
+			else
+				fromSubsetButton->setEnabled(true);
+		}
+		else
+			fromSubsetButton->setEnabled(true);
+		toSubsetButton->setEnabled(false);
 		embeddedFontsListWidget->clearSelection();
-		outlinedFontsListWidget->clearSelection();
-	}
-#endif
-}
-
-void Prefs_PDFExport::SelEFont(QListWidgetItem *c)
-{
-#if 0
-	if (c != NULL)
-	{
-		if ((pdfVersionComboBox->currentIndex() < 3) && (c->flags() & Qt::ItemIsSelectable))
-			fromEmbedButton->setEnabled(true);
-		else
-			fromEmbedButton->setEnabled(false);
-		toEmbedButton->setEnabled(false);
-		if (c->flags() & Qt::ItemIsSelectable)
-			toOutlineButton->setEnabled(true);
-		fromOutlineButton->setEnabled(false);
-		availableFontsListWidget->clearSelection();
-		outlinedFontsListWidget->clearSelection();
-	}
-#endif
-}
-
-void Prefs_PDFExport::SelSFont(QListWidgetItem *c)
-{
-#if 0
-	if (c != NULL)
-	{
-		if (pdfVersionComboBox->currentIndex() == 4)
-		{
-			if ((AllFonts[c->text()].type() == ScFace::OTF) || (AllFonts[c->text()].subset()))
-				fromOutlineButton->setEnabled(false);
-			else
-				fromOutlineButton->setEnabled(true);
-		}
-		else
-			fromOutlineButton->setEnabled(true);
-		toOutlineButton->setEnabled(false);
-		toEmbedButton->setEnabled(false);
-		fromEmbedButton->setEnabled(false);
-		embeddedFontsListWidget->clearSelection();
-		availableFontsListWidget->clearSelection();
-	}
-#endif
+	}
 }
 
 void Prefs_PDFExport::PagePr()
@@ -1374,114 +1354,52 @@
 		maxExportResolutionSpinBox->setEnabled(false);
 }
 
-#if 0
-void Prefs_PDFExport::RemoveEmbed()
-{
+void Prefs_PDFExport::EmbeddingModeChange()
+{
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+
+	embeddedFontsListWidget->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	embedAllButton->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	subsettedFontsListWidget->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	subsetAllButton->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	toSubsetButton->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	fromSubsetButton->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+}
+
+void Prefs_PDFExport::RemoveSubset()
+{
+	QString currentFont = subsettedFontsListWidget->currentItem()->text();
+	const ScFace fontFace = AllFonts[currentFont];
+	if ((fontFace.type() != ScFace::OTF) && (!fontFace.subset()))
+	{
+		embeddedFontsListWidget->addItem(currentFont);
+		delete subsettedFontsListWidget->takeItem(subsettedFontsListWidget->currentRow());
+	}
+	subsettedFontsListWidget->clearSelection();
+	if (subsettedFontsListWidget->count() == 0)
+		fromSubsetButton->setEnabled(false);
+}
+
+void Prefs_PDFExport::PutToSubset()
+{
+	QString currentFont = embeddedFontsListWidget->currentItem()->text();
+	if (subsettedFontsListWidget->count() != 0)
+	{
+		if (subsettedFontsListWidget->findItems(currentFont, Qt::MatchExactly).count() == 0)
+			addFontItem(currentFont, subsettedFontsListWidget);
+	}
+	else
+	{
+		addFontItem(currentFont, subsettedFontsListWidget);
+	}
 	delete embeddedFontsListWidget->takeItem(embeddedFontsListWidget->currentRow());
 	embeddedFontsListWidget->clearSelection();
 	if (embeddedFontsListWidget->count() == 0)
 	{
-		fromEmbedButton->setEnabled(false);
-		toOutlineButton->setEnabled(false);
-	}
-	else
-	{
-		if (!embeddedFontsListWidget->item(embeddedFontsListWidget->currentRow())->flags() & Qt::ItemIsSelectable)
-		{
-			fromEmbedButton->setEnabled(false);
-			toOutlineButton->setEnabled(false);
-		}
-	}
-}
-
-void Prefs_PDFExport::PutToEmbed()
-{
-	QString currentFont = availableFontsListWidget->currentItem()->text();
-	if (embeddedFontsListWidget->count() != 0)
-	{
-		if (!AllFonts[currentFont].subset())
-		{
-			if (embeddedFontsListWidget->findItems(currentFont, Qt::MatchExactly).count() == 0)
-			{
-				embeddedFontsListWidget->addItem(currentFont);
-				if (AnnotationFonts.contains(currentFont))
-					embeddedFontsListWidget->item(embeddedFontsListWidget->count()-1)->setFlags(Qt::ItemIsEnabled);
-			}
-		}
-		else
-		{
-			if (outlinedFontsListWidget->count() != 0)
-			{
-				if (outlinedFontsListWidget->findItems(currentFont, Qt::MatchExactly).count() == 0)
-					outlinedFontsListWidget->addItem(currentFont);
-			}
-			else
-			{
-				outlinedFontsListWidget->addItem(currentFont);
-			}
-		}
-	}
-	else
-	{
-		if ((AllFonts[currentFont].type() != ScFace::OTF) && (!AllFonts[currentFont].subset()))
-		{
-			embeddedFontsListWidget->addItem(currentFont);
-			if (AnnotationFonts.contains(currentFont))
-				embeddedFontsListWidget->item(embeddedFontsListWidget->count()-1)->setFlags(Qt::ItemIsEnabled);
-		}
-		else
-		{
-			if (outlinedFontsListWidget->count() != 0)
-			{
-				if (outlinedFontsListWidget->findItems(currentFont, Qt::MatchExactly).count() == 0)
-					outlinedFontsListWidget->addItem(currentFont);
-			}
-			else
-			{
-				outlinedFontsListWidget->addItem(currentFont);
-			}
-		}
-	}
-}
-
-void Prefs_PDFExport::RemoveOutline()
-{
-	QString currentFont = outlinedFontsListWidget->currentItem()->text();
-	if ((AllFonts[currentFont].type() != ScFace::OTF) && (!AllFonts[currentFont].subset()))
-		embeddedFontsListWidget->addItem(currentFont);
-	delete outlinedFontsListWidget->takeItem(outlinedFontsListWidget->currentRow());
-	outlinedFontsListWidget->clearSelection();
-	if (outlinedFontsListWidget->count() == 0)
-		fromOutlineButton->setEnabled(false);
-}
-
-void Prefs_PDFExport::PutToOutline()
-{
-	QString currentFont = embeddedFontsListWidget->currentItem()->text();
-	if (outlinedFontsListWidget->count() != 0)
-	{
-		if (outlinedFontsListWidget->findItems(currentFont, Qt::MatchExactly).count() == 0)
-			outlinedFontsListWidget->addItem(currentFont);
-	}
-	else
-	{
-		outlinedFontsListWidget->addItem(currentFont);
-	}
-	delete embeddedFontsListWidget->takeItem(embeddedFontsListWidget->currentRow());
-	embeddedFontsListWidget->clearSelection();
-	if (embeddedFontsListWidget->count() == 0)
-	{
-		fromEmbedButton->setEnabled(false);
-		toOutlineButton->setEnabled(false);
-	}
-	else
-	{
-		if (!(embeddedFontsListWidget->currentItem()->flags() & Qt::ItemIsSelectable))
-		{
-			fromEmbedButton->setEnabled(false);
-			toOutlineButton->setEnabled(false);
-		}
-	}
-}
-
-#endif
+		toSubsetButton->setEnabled(false);
+	}
+	else if (!(embeddedFontsListWidget->currentItem()->flags() & Qt::ItemIsSelectable))
+	{
+		toSubsetButton->setEnabled(false);
+	}
+}

Modified: trunk/Scribus/scribus/ui/prefs_pdfexport.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/ui/prefs_pdfexport.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexport.h (original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexport.h Sun May 24 01:58:38 2015
@@ -30,8 +30,9 @@
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 		void enableCMS(bool);
 
+		PDFOptions::PDFFontEmbedding fontEmbeddingMode();
 		QStringList fontsToEmbed();
-        QStringList fontsToSubset();
+		QStringList fontsToSubset();
 		QStringList fontsToOutline();
 
 	signals:
@@ -57,21 +58,20 @@
 		void enablePDFX(int);
 		void SelLPIcol(int);
 		void DoDownsample();
-		//void RemoveEmbed();
-		//void PutToEmbed();
-		//void RemoveOutline();
-		//void PutToOutline();
-		void SelAFont(QListWidgetItem*);
+		void EmbeddingModeChange();
+		void RemoveSubset();
+		void PutToSubset();
 		void SelEFont(QListWidgetItem*);
 		void SelSFont(QListWidgetItem*);
 		void EmbedAll();
-        void SubsetAll();
+		void SubsetAll();
 		void OutlineAll();
 		void PagePr();
 		void doDocBleeds();
 		void SetEffOpts(int nr);
 
 	protected:
+		QListWidgetItem* addFontItem(QString fontName, QListWidget* fontList);
 		void setCustomRenderingWidgetsShown(bool);
 		void setSolidsImagesWidgetsShown(bool);
 		void enableCustomRenderingWidgets(bool);

Modified: trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui (original)
+++ trunk/Scribus/scribus/ui/prefs_pdfexportbase.ui Sun May 24 01:58:38 2015
@@ -38,7 +38,7 @@
    <item>
     <widget class="QTabWidget" name="tabWidget">
      <property name="currentIndex">
-      <number>5</number>
+      <number>0</number>
      </property>
      <widget class="QWidget" name="tabPages">
       <attribute name="title">
@@ -261,8 +261,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>563</width>
-            <height>454</height>
+            <width>577</width>
+            <height>455</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_19">
@@ -685,8 +685,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>563</width>
-            <height>636</height>
+            <width>577</width>
+            <height>606</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_8">
@@ -1012,8 +1012,8 @@
            <rect>
             <x>0</x>
             <y>0</y>
-            <width>563</width>
-            <height>471</height>
+            <width>577</width>
+            <height>436</height>
            </rect>
           </property>
           <layout class="QVBoxLayout" name="verticalLayout_18">
@@ -1295,172 +1295,130 @@
         </widget>
        </item>
        <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_7">
+         <item>
+          <widget class="QLabel" name="label_44">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>Embedding mode:</string>
+           </property>
+          </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 fonts</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Don't embed</string>
+            </property>
+           </item>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
         <layout class="QHBoxLayout" name="horizontalLayout_8">
          <item>
           <layout class="QVBoxLayout" name="verticalLayout_11">
            <item>
-            <widget class="QLabel" name="availableListLabel">
-             <property name="text">
-              <string>Used Fonts</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QTableView" name="FontTable">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QFrame" name="frame">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-               <horstretch>0</horstretch>
-               <verstretch>1</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="frameShape">
-              <enum>QFrame::StyledPanel</enum>
-             </property>
-             <property name="frameShadow">
-              <enum>QFrame::Raised</enum>
-             </property>
-             <widget class="QWidget" name="gridLayoutWidget">
-              <property name="geometry">
-               <rect>
-                <x>0</x>
-                <y>0</y>
-                <width>581</width>
-                <height>151</height>
-               </rect>
-              </property>
-              <layout class="QGridLayout" name="gridLayout_2" columnstretch="1,0">
-               <property name="sizeConstraint">
-                <enum>QLayout::SetDefaultConstraint</enum>
-               </property>
-               <property name="topMargin">
-                <number>0</number>
-               </property>
-               <property name="horizontalSpacing">
-                <number>0</number>
-               </property>
-               <property name="verticalSpacing">
-                <number>-1</number>
-               </property>
-               <item row="0" column="0">
-                <widget class="QLabel" name="label_45">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="locale">
-                  <locale language="C" country="AnyCountry"/>
-                 </property>
-                 <property name="text">
-                  <string>a) Embed fonts</string>
-                 </property>
-                 <property name="alignment">
-                  <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-                 </property>
-                 <property name="indent">
-                  <number>24</number>
-                 </property>
-                </widget>
-               </item>
-               <item row="2" column="0">
-                <widget class="QLabel" name="label_46">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="locale">
-                  <locale language="C" country="AnyCountry"/>
-                 </property>
-                 <property name="text">
-                  <string>c) Outline fonts</string>
-                 </property>
-                 <property name="indent">
-                  <number>24</number>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="1">
-                <widget class="QToolButton" name="SubsetAllFontsButton">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="locale">
-                  <locale language="C" country="AnyCountry"/>
-                 </property>
-                 <property name="text">
-                  <string>Subset all fonts</string>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="0">
-                <widget class="QLabel" name="label_44">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="locale">
-                  <locale language="C" country="AnyCountry"/>
-                 </property>
-                 <property name="text">
-                  <string>b) Subset fonts</string>
-                 </property>
-                 <property name="indent">
-                  <number>24</number>
-                 </property>
-                </widget>
-               </item>
-               <item row="2" column="1">
-                <widget class="QToolButton" name="OutlineAllFontsButton">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="text">
-                  <string>Outline all fonts</string>
-                 </property>
-                </widget>
-               </item>
-               <item row="0" column="1">
-                <widget class="QToolButton" name="EmbedAllFontsButton">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="locale">
-                  <locale language="C" country="AnyCountry"/>
-                 </property>
-                 <property name="text">
-                  <string>Embed all fonts</string>
-                 </property>
-                 <property name="autoExclusive">
-                  <bool>false</bool>
-                 </property>
-                </widget>
-               </item>
-              </layout>
-             </widget>
+            <widget class="QLabel" name="embedListLabel">
+             <property name="text">
+              <string>Fonts to Embed</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="embeddedFontsListWidget"/>
+           </item>
+           <item>
+            <widget class="QPushButton" name="embedAllButton">
+             <property name="text">
+              <string>Embed All</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_10">
+           <item>
+            <spacer name="verticalSpacer_20">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="toSubsetButton">
+             <property name="text">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="fromSubsetButton">
+             <property name="font">
+              <font>
+               <stylestrategy>PreferDefault</stylestrategy>
+              </font>
+             </property>
+             <property name="text">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_14">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_9">
+           <item>
+            <widget class="QLabel" name="subsetListLabel">
+             <property name="text">
+              <string>Fonts to Subset</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="subsettedFontsListWidget"/>
+           </item>
+           <item>
+            <widget class="QPushButton" name="subsetAllButton">
+             <property name="text">
+              <string>Subset All</string>
+             </property>
             </widget>
            </item>
           </layout>
@@ -1914,6 +1872,7 @@
   <tabstop>useDocumentBleedsCheckBox</tabstop>
   <tabstop>pdfx3OutputProfileComboBox</tabstop>
   <tabstop>pdfx3InfoStringLineEdit</tabstop>
+  <tabstop>subsettedFontsListWidget</tabstop>
   <tabstop>enabledEffectsCheckBox</tabstop>
   <tabstop>effectsPageListWidget</tabstop>
   <tabstop>effectTypeComboBox</tabstop>

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/ui/tabpdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.cpp (original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.cpp Sun May 24 01:58:38 2015
@@ -35,7 +35,6 @@
 
 
 #include "ui/createrange.h"
-#include "fontlistmodel.h"
 #include "pdfoptions.h"
 #include "prefsmanager.h"
 #include "scribuscore.h"
@@ -96,16 +95,10 @@
 
 	// Fonts tab
 	groupFontLayout->setAlignment( Qt::AlignTop );
-    FontTable->setModel(new FontListModel(this, doc));
-    FontTable->resizeColumnsToContents();
-    
-//	AvailFlist->setMaximumHeight(300);
-//	EmbedList->setMaximumHeight(105);
-//	ToEmbed->setIcon(QIcon(loadIcon("22/go-next.png")));
-//	FromEmbed->setIcon(QIcon(loadIcon("22/go-previous.png")));
-//	ToOutline->setIcon(QIcon(loadIcon("22/go-down.png")));
-//	FromOutline->setIcon(QIcon(loadIcon("22/go-up.png")));
-//	OutlineList->setMaximumHeight(105);c
+	EmbedList->setMaximumHeight(300);
+	SubsetList->setMaximumHeight(300);
+	ToSubset->setIcon(QIcon(loadIcon("22/go-next.png")));
+	FromSubset->setIcon(QIcon(loadIcon("22/go-previous.png")));
 
 	// Presentation tab
 	effectsLayout->setAlignment( Qt::AlignTop );
@@ -173,16 +166,13 @@
 
 	restoreDefaults(Optionen, AllFonts, PDFXProfiles, DocFonts);
 
-	connect(EmbedAllFontsButton, SIGNAL(clicked()), this, SLOT(EmbedAll()));
-    connect(SubsetAllFontsButton, SIGNAL(clicked()), this, SLOT(SubsetAll()));
-    connect(OutlineAllFontsButton, SIGNAL(clicked()), this, SLOT(OutlineAll()));
-//	connect(AvailFlist, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelAFont(QListWidgetItem*)));
-//	connect(EmbedList, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelEFont(QListWidgetItem*)));
-//	connect(ToEmbed, SIGNAL(clicked()), this, SLOT(PutToEmbed()));
-//	connect(FromEmbed, SIGNAL(clicked()), this, SLOT(RemoveEmbed()));
-//	connect(OutlineList, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelSFont(QListWidgetItem*)));
-//	connect(ToOutline, SIGNAL(clicked()), this, SLOT(PutToOutline()));
-//	connect(FromOutline, SIGNAL(clicked()), this, SLOT(RemoveOutline()));
+	connect(fontEmbeddingCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(EmbeddingModeChange()));
+	connect(EmbedFonts, SIGNAL(clicked()), this, SLOT(EmbedAll()));
+	connect(EmbedList, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelEFont(QListWidgetItem*)));
+	connect(SubsetFonts, SIGNAL(clicked()), this, SLOT(SubsetAll()));
+	connect(SubsetList, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(SelSFont(QListWidgetItem*)));
+	connect(ToSubset, SIGNAL(clicked()), this, SLOT(PutToSubset()));
+	connect(FromSubset, SIGNAL(clicked()), this, SLOT(RemoveSubset()));
 	connect(PagePrev, SIGNAL(clicked()), this, SLOT(PagePr()));
 	connect(Pages, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(SetPgEff(QListWidgetItem*, QListWidgetItem*)));
 	connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
@@ -235,9 +225,9 @@
 	ValC->setToolTip( "<qt>" + tr( "DPI (Dots Per Inch) for image export.") + "</qt>" );
 
 	// Tooltips : Fonts tab
-	EmbedAllFontsButton->setToolTip( "<qt>" + tr( "Embed fonts into the PDF. Embedding the fonts will preserve the layout and appearance of your document." ) + "</qt>");
+	EmbedFonts->setToolTip( "<qt>" + tr( "Embed fonts into the PDF. Embedding the fonts will preserve the layout and appearance of your document." ) + "</qt>");
 	CheckBox10->setToolTip( "<qt>" + tr( "Enables presentation effects when using Adobe® Reader® and other PDF viewers which support this in full screen mode." ) + "</qt>");
-	OutlineAllFontsButton->setToolTip( "<qt>" + tr("Convert all glyphs in the document to outlines.") + "</qt>");
+	SubsetFonts->setToolTip( "<qt>" + tr("Embed only subset fonts with glyphs used in the document into the PDF.") + "</qt>");
 
 	// Tooltips : Presentation tab
 	PagePrev->setToolTip( "<qt>" + tr( "Show page previews of each page listed above." ) + "</qt>");
@@ -301,64 +291,43 @@
 	InfoString->setToolTip( "<qt>" + tr( "Mandatory string for PDF/X or the PDF will fail PDF/X conformance. We recommend you use the title of the document." ) + "</qt>" );
 }
 
-static bool checkState(FontListModel* table, int row, int column)
-{
-    return table->data(table->index(row, column), Qt::CheckStateRole) == Qt::Checked;
-}
-
-static void setState(FontListModel* table, int row, int column)
-{
-    table->setData(table->index(row, column), Qt::CheckStateRole, Qt::Checked);
-}
-
-static void setState(FontListModel* table, QString name, int column)
-{
-    for (int row = 0; row < table->rowCount(); ++row)
-        if (name == table->nameForIndex(table->index(row, column)))
-            setState(table, row, column);
+PDFOptions::PDFFontEmbedding TabPDFOptions::fontEmbeddingMode()
+{
+	return (PDFOptions::PDFFontEmbedding) fontEmbeddingCombo->currentIndex();
 }
 
 QStringList TabPDFOptions::fontsToEmbed()
 {
-    QStringList fonts;
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int i = 0; i < table->rowCount(); ++i)
-        if (checkState(table, i, FontListModel::FontEmbed) &&
-            !checkState(table, i, FontListModel::FontSubset))
-        {
-            fonts.append(table->data(table->index(i, FontListModel::FontName)).toString());
-        }
-    return fonts;
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	if (embeddingMode != PDFOptions::EmbedFonts)
+		return QStringList();
+
+	QStringList fonts;
+	for (int i = 0; i < EmbedList->count(); ++i)
+		fonts.append(EmbedList->item(i)->text());
+	return fonts;
 }
 
 QStringList TabPDFOptions::fontsToSubset()
 {
-    QStringList fonts;
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int i = 0; i < table->rowCount(); ++i)
-    {
-        QString font = table->data(table->index(i, FontListModel::FontName)).toString();
-        if (checkState(table, i, FontListModel::FontSubset) &&
-            !checkState(table, i, FontListModel::FontOutline))
-        {
-            fonts.append(font);
-        }
-    }
-    return fonts;
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	if (embeddingMode != PDFOptions::EmbedFonts)
+		return QStringList();
+
+	QStringList fonts;
+	for (int i = 0; i < SubsetList->count(); ++i)
+		fonts.append(SubsetList->item(i)->text());
+	return fonts;
 }
 
 QStringList TabPDFOptions::fontsToOutline()
 {
-    QStringList fonts;
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int i = 0; i < table->rowCount(); ++i)
-        if (checkState(table, i, FontListModel::FontOutline))
-        {
-            fonts.append(table->data(table->index(i, FontListModel::FontName)).toString());
-        }
-    return fonts;
-}
-
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+	if (embeddingMode != PDFOptions::OutlineFonts)
+		return QStringList();
+
+	return m_docFonts;
+}
 
 void TabPDFOptions::restoreDefaults(PDFOptions & Optionen,
 									const SCFonts &AllFonts,
@@ -420,6 +389,22 @@
 	ValC->setValue(Opts.PicRes);
 	ValC->setEnabled(DSColor->isChecked() ? true : false);
 
+	m_docFonts = DocFonts.keys();
+	if (Opts.Version == PDFOptions::PDFVersion_X1a ||
+		Opts.Version == PDFOptions::PDFVersion_X3  ||
+		Opts.Version == PDFOptions::PDFVersion_X4 )
+	{
+		Opts.FontEmbedding = PDFOptions::EmbedFonts;
+	}
+	fontEmbeddingCombo->setCurrentIndex((int) Opts.FontEmbedding);
+
+	EmbedList->setEnabled(Opts.FontEmbedding == PDFOptions::EmbedFonts);
+	EmbedFonts->setEnabled(Opts.FontEmbedding == PDFOptions::EmbedFonts);
+	SubsetList->setEnabled(Opts.FontEmbedding == PDFOptions::EmbedFonts);
+	SubsetFonts->setEnabled(Opts.FontEmbedding == PDFOptions::EmbedFonts);
+	ToSubset->setEnabled(Opts.FontEmbedding == PDFOptions::EmbedFonts);
+	FromSubset->setEnabled(Opts.FontEmbedding == PDFOptions::EmbedFonts);
+
 //	Build a list of all Fonts used in Annotations;
 	PageItem *pgit;
 	QList<PageItem*> allItems;
@@ -438,7 +423,7 @@
 				int annotType  = pgit->annotation().Type();
 				bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
 				if (pgit->itemText.length() > 0 || mustEmbed)
-					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+					m_annotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
 			}
 		}
 		allItems.clear();
@@ -458,7 +443,7 @@
 				int annotType  = pgit->annotation().Type();
 				bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
 				if (pgit->itemText.length() > 0 || mustEmbed)
-					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+					m_annotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
 			}
 		}
 		allItems.clear();
@@ -478,67 +463,48 @@
 				int annotType  = pgit->annotation().Type();
 				bool mustEmbed = ((annotType >= Annotation::Button) && (annotType <= Annotation::Listbox) && (annotType != Annotation::Checkbox));
 				if (pgit->itemText.length() > 0 || mustEmbed)
-					AnnotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
+					m_annotationFonts.insert(pgit->itemText.defaultStyle().charStyle().font().replacementName(), "");
 			}
 		}
 		allItems.clear();
 	}
-    
-    
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    table->setFonts(DocFonts.keys());
-    if (!FontTable->isSortingEnabled())
-        FontTable->sortByColumn(FontListModel::SortIndex, Qt::AscendingOrder);
-    
-    
-//	QMap<QString,int>::const_iterator it;
-//	AvailFlist->clear();
-//	for (it = DocFonts.constBegin(); it != DocFonts.constEnd(); ++it)
-//	{
-//		if (AllFonts[it.key()].isReplacement())
-//			new QListWidgetItem( QIcon(loadIcon("font_subst16.png")), it.key(), AvailFlist );
-//		else if (AllFonts[it.key()].type() == ScFace::TYPE1)
-//			new QListWidgetItem( QIcon(loadIcon("font_type1_16.png")), it.key(), AvailFlist );
-//		else if (AllFonts[it.key()].type() == ScFace::TTF)
-//			new QListWidgetItem( QIcon(loadIcon("font_truetype16.png")), it.key(), AvailFlist );
-//		else if (AllFonts[it.key()].type() == ScFace::OTF)
-//			new QListWidgetItem( QIcon(loadIcon("font_otf16.png")), it.key(), AvailFlist );
-//	}
-//	ToEmbed->setEnabled(false);
-//	FromEmbed->setEnabled(false);
-//	ToOutline->setEnabled(false);
-//	FromOutline->setEnabled(false);
+	ToSubset->setEnabled(false);
+	FromSubset->setEnabled(false);
+
 	if ((Opts.EmbedList.count() == 0) && (Opts.SubsetList.count() == 0) && (Opts.firstUse))
 		EmbedAll();
 	else
 	{
-		for (int fe = 0; fe < Opts.EmbedList.count(); ++fe)
-            setState(table, Opts.EmbedList[fe], FontListModel::FontEmbed);
-		if (Opts.SubsetList.count() != 0)
-		{
-			for (int fe = 0; fe < Opts.SubsetList.count(); ++fe)
-				setState(table, Opts.SubsetList[fe], FontListModel::FontSubset);		}
-        if (Opts.SubsetList.count() != 0)
-        {
-            for (int fe = 0; fe < Opts.OutlineList.count(); ++fe)
-                setState(table, Opts.OutlineList[fe], FontListModel::FontOutline);
-        }
-//		QMap<QString, QString>::Iterator itAnn;
-//		for (itAnn = AnnotationFonts.begin(); itAnn != AnnotationFonts.end(); ++itAnn)
-//		{
-//			QList<QListWidgetItem *> itEmbed = EmbedList->findItems(itAnn.key(), Qt::MatchExactly);
-//			if (itEmbed.count() == 0)
-//			{
-//				EmbedList->addItem(itAnn.key());
-//				EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
-//			}
-//			QList<QListWidgetItem *> itOutline = OutlineList->findItems(itAnn.key(), Qt::MatchExactly);
-//			for (int itOut = 0; itOut < itOutline.count(); ++itOut)
-//			{
-//				QListWidgetItem* item = itOutline[itOut];
-//				delete OutlineList->takeItem(OutlineList->row(item));
-//			}
-//		}
+		EmbedList->clear();
+		SubsetList->clear();
+		for (int fe = 0; fe < m_docFonts.count(); ++ fe)
+		{
+			QString fontName = m_docFonts.at(fe);
+			if (Opts.EmbedList.contains(fontName))
+				addFontItem(fontName, EmbedList);
+			else
+			{
+				addFontItem(fontName, SubsetList);
+				if (!Opts.SubsetList.contains(fontName))
+					Opts.SubsetList.append(fontName);
+			}
+		}
+		QMap<QString, QString>::Iterator itAnn;
+		for (itAnn = m_annotationFonts.begin(); itAnn != m_annotationFonts.end(); ++itAnn)
+		{
+			QList<QListWidgetItem *> itEmbed = EmbedList->findItems(itAnn.key(), Qt::MatchExactly);
+			if (itEmbed.count() == 0)
+			{
+				QListWidgetItem* item = addFontItem(itAnn.key(), EmbedList);
+				item->setFlags(Qt::ItemIsEnabled);
+			}
+			QList<QListWidgetItem *> itSubset = SubsetList->findItems(itAnn.key(), Qt::MatchExactly);
+			for (int itOut = 0; itOut < itSubset.count(); ++itOut)
+			{
+				QListWidgetItem* item = itSubset[itOut];
+				delete SubsetList->takeItem(SubsetList->row(item));
+			}
+		}
 	}
 	CheckBox10->setChecked(Opts.PresentMode);
 	PagePrev->setChecked(false);
@@ -773,6 +739,7 @@
 	pdfOptions.pageRangeSelection = AllPages->isChecked() ? 0 : 1;
 	pdfOptions.pageRangeString = PageNr->text();
 	pdfOptions.Articles = Article->isChecked();
+	pdfOptions.FontEmbedding =  (PDFOptions::PDFFontEmbedding) fontEmbeddingCombo->currentIndex();
 	pdfOptions.Encrypt = Encry->isChecked();
 	pdfOptions.UseLPI = UseLPI->isChecked();
 	pdfOptions.UseSpotColors = !useSpot->isChecked();
@@ -965,6 +932,7 @@
 
 	if (a < 3)  // not PDF/X
 	{
+		fontEmbeddingCombo->setEnabled(true);
 		X3Group->setEnabled(false);
 		setTabEnabled(indexOf(tabSecurity), true);
 		OutCombo->setEnabled(true);
@@ -973,10 +941,7 @@
 		emit hasInfo();
 
 		CheckBox10->setEnabled(true);
-//		EmbedAllFontsButton->setEnabled(true);
-//		if (EmbedList->count() != 0)
-//			FromEmbed->setEnabled(true);
-//		ToEmbed->setEnabled(true);
+		EmbedFonts->setEnabled(true);
 		EnablePr(OutCombo->currentIndex());
 		return;
 	}
@@ -999,11 +964,19 @@
 		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);
+
 	EmbedAll();
 	CheckBox10->setChecked(false);
 	CheckBox10->setEnabled(false);
-//	FromEmbed->setEnabled(false);
-//	ToEmbed->setEnabled(false);
 	if (InfoString->text().isEmpty())
 		emit noInfo();
 	else
@@ -1340,251 +1313,150 @@
 		ValC->setEnabled(false);
 }
 
-
-#if 0
-void TabPDFOptions::RemoveEmbed()
-{
+void TabPDFOptions::EmbeddingModeChange()
+{
+	PDFOptions::PDFFontEmbedding embeddingMode = fontEmbeddingMode();
+
+	EmbedList->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	EmbedFonts->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	SubsetList->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	SubsetFonts->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	ToSubset->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+	FromSubset->setEnabled(embeddingMode == PDFOptions::EmbedFonts);
+}
+
+void TabPDFOptions::RemoveSubset()
+{
+	QString currentFont = SubsetList->currentItem()->text();
+	const ScFace fontFace = AllFonts[currentFont];
+	if ((fontFace.type() != ScFace::OTF) && (!fontFace.subset()))
+	{
+		addFontItem(currentFont, EmbedList);
+		delete SubsetList->takeItem(SubsetList->currentRow());
+	}
+	SubsetList->clearSelection();
+	if (SubsetList->count() == 0)
+		FromSubset->setEnabled(false);
+}
+
+void TabPDFOptions::PutToSubset()
+{
+	QString currentFont = EmbedList->currentItem()->text();
+	if (SubsetList->count() != 0)
+	{
+		if (SubsetList->findItems(currentFont, Qt::MatchExactly).count() == 0)
+			addFontItem(currentFont, SubsetList);
+	}
+	else
+	{
+		addFontItem(currentFont, SubsetList);
+	}
 	delete EmbedList->takeItem(EmbedList->currentRow());
 	EmbedList->clearSelection();
 	if (EmbedList->count() == 0)
 	{
-		FromEmbed->setEnabled(false);
-		ToOutline->setEnabled(false);
-	}
-	else
-	{
-		if (!EmbedList->item(EmbedList->currentRow())->flags() & Qt::ItemIsSelectable)
-		{
-			FromEmbed->setEnabled(false);
-			ToOutline->setEnabled(false);
-		}
-	}
-}
-
-void TabPDFOptions::PutToEmbed()
-{
-	QString currentFont = AvailFlist->currentItem()->text();
-	if (EmbedList->count() != 0)
-	{
-		if (!AllFonts[currentFont].subset())
-		{
-			if (EmbedList->findItems(currentFont, Qt::MatchExactly).count() == 0)
-			{
-				EmbedList->addItem(currentFont);
-				if (AnnotationFonts.contains(currentFont))
-					EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
-			}
+		ToSubset->setEnabled(false);
+	}
+	else if (!(EmbedList->currentItem()->flags() & Qt::ItemIsSelectable))
+	{
+		ToSubset->setEnabled(false);
+	}
+}
+
+void TabPDFOptions::SelEFont(QListWidgetItem *c)
+{
+	if (c != NULL)
+	{
+		if (c->flags() & Qt::ItemIsSelectable)
+			ToSubset->setEnabled(true);
+		FromSubset->setEnabled(false);
+		SubsetList->clearSelection();
+	}
+}
+
+void TabPDFOptions::SelSFont(QListWidgetItem *c)
+{
+	if (c != NULL)
+	{
+		if (PDFVersionCombo->currentIndex() == 4)
+		{
+			if ((AllFonts[c->text()].type() == ScFace::OTF) || (AllFonts[c->text()].subset()))
+				FromSubset->setEnabled(false);
+			else
+				FromSubset->setEnabled(true);
 		}
 		else
-		{
-			if (OutlineList->count() != 0)
-			{
-				if (OutlineList->findItems(currentFont, Qt::MatchExactly).count() == 0)
-					OutlineList->addItem(currentFont);
-			}
-			else
-			{
-				OutlineList->addItem(currentFont);
-			}
-		}
-	}
-	else
-	{
-		if ((AllFonts[currentFont].type() != ScFace::OTF) && (!AllFonts[currentFont].subset()))
-		{
-			EmbedList->addItem(currentFont);
-			if (AnnotationFonts.contains(currentFont))
-				EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
+			FromSubset->setEnabled(true);
+		ToSubset->setEnabled(false);
+		EmbedList->clearSelection();
+	}
+}
+
+void TabPDFOptions::EmbedAll()
+{
+	EmbedList->clear();
+	SubsetList->clear();
+	ToSubset->setEnabled(false);
+	FromSubset->setEnabled(false);
+	for (int a = 0; a < m_docFonts.count(); ++a)
+	{
+		QString fontName = m_docFonts.at(a);
+		if (!AllFonts[fontName].subset())
+		{
+			QListWidgetItem* item = addFontItem(fontName, EmbedList);
+			if (m_annotationFonts.contains(item->text()))
+				item->setFlags(Qt::ItemIsEnabled);
+		}
+		else if (m_annotationFonts.contains(fontName))
+		{
+			QListWidgetItem* item = addFontItem(fontName, EmbedList);
+			item->setFlags(Qt::ItemIsEnabled);
 		}
 		else
 		{
-			if (OutlineList->count() != 0)
-			{
-				if (OutlineList->findItems(currentFont, Qt::MatchExactly).count() == 0)
-					OutlineList->addItem(currentFont);
-			}
-			else
-			{
-				OutlineList->addItem(currentFont);
-			}
-		}
-	}
-}
-
-void TabPDFOptions::RemoveOutline()
-{
-	QString currentFont = OutlineList->currentItem()->text();
-	if ((AllFonts[currentFont].type() != ScFace::OTF) && (!AllFonts[currentFont].subset()))
-	{
-		EmbedList->addItem(currentFont);
-	}
-	delete OutlineList->takeItem(OutlineList->currentRow());
-	OutlineList->clearSelection();
-	if (OutlineList->count() == 0)
-		FromOutline->setEnabled(false);
-}
-
-void TabPDFOptions::PutToOutline()
-{
-	QString currentFont = EmbedList->currentItem()->text();
-	if (OutlineList->count() != 0)
-	{
-		if (OutlineList->findItems(currentFont, Qt::MatchExactly).count() == 0)
-			OutlineList->addItem(currentFont);
-	}
-	else
-	{
-		OutlineList->addItem(currentFont);
-	}
-	delete EmbedList->takeItem(EmbedList->currentRow());
-	EmbedList->clearSelection();
-	if (EmbedList->count() == 0)
-	{
-		FromEmbed->setEnabled(false);
-		ToOutline->setEnabled(false);
-	}
-	else
-	{
-		if (!(EmbedList->currentItem()->flags() & Qt::ItemIsSelectable))
-		{
-			FromEmbed->setEnabled(false);
-			ToOutline->setEnabled(false);
-		}
-	}
-}
-
-void TabPDFOptions::SelAFont(QListWidgetItem *c)
-{
-	if (c != NULL)
-	{
-		FromEmbed->setEnabled(false);
-		if (c->flags() & Qt::ItemIsSelectable)
-			ToEmbed->setEnabled(true);
-		ToOutline->setEnabled(false);
-		FromOutline->setEnabled(false);
-		EmbedList->clearSelection();
-		OutlineList->clearSelection();
-	}
-}
-
-void TabPDFOptions::SelEFont(QListWidgetItem *c)
-{
-	if (c != NULL)
-	{
-		if ((PDFVersionCombo->currentIndex() < 3) && (c->flags() & Qt::ItemIsSelectable))
-			FromEmbed->setEnabled(true);
+			addFontItem(fontName, SubsetList);
+		}
+	}
+}
+
+void TabPDFOptions::SubsetAll()
+{
+	EmbedList->clear();
+	SubsetList->clear();
+	ToSubset->setEnabled(false);
+	FromSubset->setEnabled(false);
+	for (int a = 0; a < m_docFonts.count(); ++a)
+	{
+		QString fontName = m_docFonts.at(a);
+		if (m_annotationFonts.contains(fontName))
+		{
+			QListWidgetItem* item = addFontItem(fontName, EmbedList);
+			item->setFlags(Qt::ItemIsEnabled);
+		}
 		else
-			FromEmbed->setEnabled(false);
-		ToEmbed->setEnabled(false);
-		if (c->flags() & Qt::ItemIsSelectable)
-			ToOutline->setEnabled(true);
-		FromOutline->setEnabled(false);
-		AvailFlist->clearSelection();
-		OutlineList->clearSelection();
-	}
-}
-
-void TabPDFOptions::SelSFont(QListWidgetItem *c)
-{
-	if (c != NULL)
-	{
-		if (PDFVersionCombo->currentIndex() == 4)
-		{
-			if ((AllFonts[c->text()].type() == ScFace::OTF) || (AllFonts[c->text()].subset()))
-				FromOutline->setEnabled(false);
-			else
-				FromOutline->setEnabled(true);
-		}
-		else
-			FromOutline->setEnabled(true);
-		ToOutline->setEnabled(false);
-		ToEmbed->setEnabled(false);
-		FromEmbed->setEnabled(false);
-		EmbedList->clearSelection();
-		AvailFlist->clearSelection();
-	}
-}
-
-#endif
-
-void TabPDFOptions::SubsetAll()
-{
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int row = 1; row < table->rowCount(); ++row)
-        if (!checkState(table, row, FontListModel::FontSubset))
-            setState(table, row, FontListModel::FontSubset);
-}
-
-void TabPDFOptions::EmbedAll()
-{
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int row = 1; row < table->rowCount(); ++row)
-        if (!checkState(table, row, FontListModel::FontEmbed))
-            setState(table, row, FontListModel::FontEmbed);
-#if 0
-	EmbedList->clear();
-	OutlineList->clear();
-	FromEmbed->setEnabled(false);
-	ToEmbed->setEnabled(false);
-	ToOutline->setEnabled(false);
-	FromOutline->setEnabled(false);
-	for (int a=0; a < AvailFlist->count(); ++a)
-	{
-		QListWidgetItem* item = AvailFlist->item(a);
-		if ((item->flags() & Qt::ItemIsSelectable) == 0)
-			continue;
-		if (!AllFonts[item->text()].subset())
-		{
-			EmbedList->addItem(item->text());
-			if (AnnotationFonts.contains(item->text()))
-				EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
-		}
-		else
-		{
-			if (AnnotationFonts.contains(item->text()))
-			{
-				EmbedList->addItem(item->text());
-				EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
-			}
-			else
-			{
-				OutlineList->addItem(item->text());
-			}
-		}
-	}
-#endif
-}
-
-void TabPDFOptions::OutlineAll()
-{
-    FontListModel* table = qobject_cast<FontListModel*>(FontTable->model());
-    for (int row = 1; row < table->rowCount(); ++row)
-        if (!checkState(table, row, FontListModel::FontOutline))
-            setState(table, row, FontListModel::FontOutline);
-
-#if 0
-	EmbedList->clear();
-	OutlineList->clear();
-	FromEmbed->setEnabled(false);
-	ToEmbed->setEnabled(false);
-	ToOutline->setEnabled(false);
-	FromOutline->setEnabled(false);
-	for (int a = 0; a < AvailFlist->count(); ++a)
-	{
-		QListWidgetItem* item = AvailFlist->item(a);
-		if ((item->flags() & Qt::ItemIsSelectable) == 0)
-			continue;
-		if (AnnotationFonts.contains(item->text()))
-		{
-			EmbedList->addItem(item->text());
-			EmbedList->item(EmbedList->count()-1)->setFlags(Qt::ItemIsEnabled);
-		}
-		else
-		{
-			OutlineList->addItem(item->text());
-		}
-	}
-#endif
+		{
+			addFontItem(fontName, SubsetList);
+		}
+	}
+}
+
+QListWidgetItem* TabPDFOptions::addFontItem(QString fontName, QListWidget* fontList)
+{
+	QListWidgetItem* item = 0;
+	if (!AllFonts.contains(fontName))
+		return 0;
+
+	const ScFace& face = AllFonts.value(fontName);
+	if (face.isReplacement())
+		item = new QListWidgetItem( QIcon(loadIcon("font_subst16.png")), fontName, fontList );
+	else if (face.type() == ScFace::TYPE1)
+		item = new QListWidgetItem( QIcon(loadIcon("font_type1_16.png")), fontName, fontList );
+	else if (face.type() == ScFace::TTF)
+		item = new QListWidgetItem( QIcon(loadIcon("font_truetype16.png")), fontName, fontList );
+	else if (face.type() == ScFace::OTF)
+		item = new QListWidgetItem( QIcon(loadIcon("font_otf16.png")), fontName, fontList );
+
+	return item;
 }
 
 void TabPDFOptions::unitChange(int docUnitIndex)

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/ui/tabpdfoptions.h
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.h (original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.h Sun May 24 01:58:38 2015
@@ -10,6 +10,8 @@
 #include <QTabWidget>
 #include <QMap>
 #include <QList>
+#include <QStringList>
+
 class QGridLayout;
 class QHBoxLayout;
 class QVBoxLayout;
@@ -56,8 +58,9 @@
 
 	void unitChange(int docUnitIndex);
 
+	PDFOptions::PDFFontEmbedding fontEmbeddingMode();
 	QStringList fontsToEmbed();
-    QStringList fontsToSubset();
+	QStringList fontsToSubset();
 	QStringList fontsToOutline();
 
 signals:
@@ -69,16 +72,13 @@
 	void ToggleEncr();
 	void EnablePDFX(int a);
 	void DoDownsample();
-//	void RemoveEmbed();
-//	void PutToEmbed();
-//	void RemoveOutline();
-//	void PutToOutline();
-//	void SelAFont(QListWidgetItem*);
-//	void SelEFont(QListWidgetItem*);
-//	void SelSFont(QListWidgetItem*);
+	void EmbeddingModeChange();
+	void RemoveSubset();
+	void PutToSubset();
+	void SelEFont(QListWidgetItem*);
+	void SelSFont(QListWidgetItem*);
 	void EmbedAll();
-    void SubsetAll();
-	void OutlineAll();
+	void SubsetAll();
 	void PagePr();
 	void SetPgEff(QListWidgetItem* current, QListWidgetItem* previous);
 	void SetEffOpts(int nr);
@@ -112,6 +112,8 @@
 	QList<PDFPresentationData> EffVal;
 	QString SelLPIcolor;
 
+	QListWidgetItem* addFontItem(QString fontName, QListWidget* fontList);
+
 private:
 	// Non-GUI protected members
 	double unitRatio;
@@ -119,7 +121,9 @@
 	const SCFonts & AllFonts;
 	PDFOptions & Opts;
 	bool cms;
-	QMap<QString, QString> AnnotationFonts;
+
+	QStringList m_docFonts;
+	QMap<QString, QString> m_annotationFonts;
 
 };
 #endif

Modified: trunk/Scribus/scribus/ui/tabpdfoptions.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20122&path=/trunk/Scribus/scribus/ui/tabpdfoptions.ui
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.ui (original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.ui Sun May 24 01:58:38 2015
@@ -24,7 +24,16 @@
     <property name="spacing">
      <number>5</number>
     </property>
-    <property name="margin">
+    <property name="leftMargin">
+     <number>10</number>
+    </property>
+    <property name="topMargin">
+     <number>10</number>
+    </property>
+    <property name="rightMargin">
+     <number>10</number>
+    </property>
+    <property name="bottomMargin">
      <number>10</number>
     </property>
     <item>
@@ -41,7 +50,16 @@
          <property name="spacing">
           <number>5</number>
          </property>
-         <property name="margin">
+         <property name="leftMargin">
+          <number>10</number>
+         </property>
+         <property name="topMargin">
+          <number>10</number>
+         </property>
+         <property name="rightMargin">
+          <number>10</number>
+         </property>
+         <property name="bottomMargin">
           <number>10</number>
          </property>
          <item>
@@ -172,7 +190,16 @@
          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
         </property>
         <layout class="QGridLayout" name="fileOptionsLayout">
-         <property name="margin">
+         <property name="leftMargin">
+          <number>10</number>
+         </property>
+         <property name="topMargin">
+          <number>10</number>
+         </property>
+         <property name="rightMargin">
+          <number>10</number>
+         </property>
+         <property name="bottomMargin">
           <number>10</number>
          </property>
          <property name="spacing">
@@ -307,7 +334,16 @@
        <string>Image Quality Settings</string>
       </property>
       <layout class="QGridLayout" name="imageQualityLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">
@@ -428,7 +464,16 @@
     <property name="spacing">
      <number>5</number>
     </property>
-    <property name="margin">
+    <property name="leftMargin">
+     <number>10</number>
+    </property>
+    <property name="topMargin">
+     <number>10</number>
+    </property>
+    <property name="rightMargin">
+     <number>10</number>
+    </property>
+    <property name="bottomMargin">
      <number>10</number>
     </property>
     <item>
@@ -436,181 +481,153 @@
       <property name="title">
        <string>Embedding</string>
       </property>
-      <layout class="QHBoxLayout" name="groupFontLayout">
-       <property name="spacing">
-        <number>5</number>
-       </property>
-       <property name="margin">
+      <layout class="QVBoxLayout" name="groupFontLayout">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <item>
-           <layout class="QVBoxLayout" name="verticalLayout_11">
-               <item>
-                   <widget class="QLabel" name="availableListLabel">
-                       <property name="text">
-                           <string>Used Fonts</string>
-                       </property>
-                   </widget>
-               </item>
-               <item>
-                   <widget class="QTableView" name="FontTable">
-                       <property name="sizePolicy">
-                           <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-                               <horstretch>0</horstretch>
-                               <verstretch>0</verstretch>
-                           </sizepolicy>
-                       </property>
-                   </widget>
-               </item>
-               <item>
-                   <widget class="QFrame" name="frame">
-                       <property name="sizePolicy">
-                           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
-                               <horstretch>0</horstretch>
-                               <verstretch>1</verstretch>
-                           </sizepolicy>
-                       </property>
-                       <property name="frameShape">
-                           <enum>QFrame::StyledPanel</enum>
-                       </property>
-                       <property name="frameShadow">
-                           <enum>QFrame::Raised</enum>
-                       </property>
-                       <widget class="QWidget" name="gridLayoutWidget">
-                           <property name="geometry">
-                               <rect>
-                                   <x>0</x>
-                                   <y>0</y>
-                                   <width>581</width>
-                                   <height>151</height>
-                               </rect>
-                           </property>
-                           <layout class="QGridLayout" name="gridLayout_2" columnstretch="1,0">
-                               <property name="sizeConstraint">
-                                   <enum>QLayout::SetDefaultConstraint</enum>
-                               </property>
-                               <property name="topMargin">
-                                   <number>0</number>
-                               </property>
-                               <property name="horizontalSpacing">
-                                   <number>0</number>
-                               </property>
-                               <property name="verticalSpacing">
-                                   <number>-1</number>
-                               </property>
-                               <item row="0" column="0">
-                                   <widget class="QLabel" name="label_45">
-                                       <property name="sizePolicy">
-                                           <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-                                               <horstretch>0</horstretch>
-                                               <verstretch>0</verstretch>
-                                           </sizepolicy>
-                                       </property>
-                                       <property name="locale">
-                                           <locale language="C" country="AnyCountry"/>
-                                       </property>
-                                       <property name="text">
-                                           <string>a) Embed fonts</string>
-                                       </property>
-                                       <property name="alignment">
-                                           <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-                                       </property>
-                                       <property name="indent">
-                                           <number>24</number>
-                                       </property>
-                                   </widget>
-                               </item>
-                               <item row="2" column="0">
-                                   <widget class="QLabel" name="label_46">
-                                       <property name="sizePolicy">
-                                           <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-                                               <horstretch>0</horstretch>
-                                               <verstretch>0</verstretch>
-                                           </sizepolicy>
-                                       </property>
-                                       <property name="locale">
-                                           <locale language="C" country="AnyCountry"/>
-                                       </property>
-                                       <property name="text">
-                                           <string>c) Outline fonts</string>
-                                       </property>
-                                       <property name="indent">
-                                           <number>24</number>
-                                       </property>
-                                   </widget>
-                               </item>
-                               <item row="1" column="1">
-                                   <widget class="QToolButton" name="SubsetAllFontsButton">
-                                       <property name="sizePolicy">
-                                           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-                                               <horstretch>0</horstretch>
-                                               <verstretch>0</verstretch>
-                                           </sizepolicy>
-                                       </property>
-                                       <property name="locale">
-                                           <locale language="C" country="AnyCountry"/>
-                                       </property>
-                                       <property name="text">
-                                           <string>Subset all fonts</string>
-                                       </property>
-                                   </widget>
-                               </item>
-                               <item row="1" column="0">
-                                   <widget class="QLabel" name="label_44">
-                                       <property name="sizePolicy">
-                                           <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
-                                               <horstretch>0</horstretch>
-                                               <verstretch>0</verstretch>
-                                           </sizepolicy>
-                                       </property>
-                                       <property name="locale">
-                                           <locale language="C" country="AnyCountry"/>
-                                       </property>
-                                       <property name="text">
-                                           <string>b) Subset fonts</string>
-                                       </property>
-                                       <property name="indent">
-                                           <number>24</number>
-                                       </property>
-                                   </widget>
-                               </item>
-                               <item row="2" column="1">
-                                   <widget class="QToolButton" name="OutlineAllFontsButton">
-                                       <property name="sizePolicy">
-                                           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-                                               <horstretch>0</horstretch>
-                                               <verstretch>0</verstretch>
-                                           </sizepolicy>
-                                       </property>
-                                       <property name="text">
-                                           <string>Outline all fonts</string>
-                                       </property>
-                                   </widget>
-                               </item>
-                               <item row="0" column="1">
-                                   <widget class="QToolButton" name="EmbedAllFontsButton">
-                                       <property name="sizePolicy">
-                                           <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
-                                               <horstretch>0</horstretch>
-                                               <verstretch>0</verstretch>
-                                           </sizepolicy>
-                                       </property>
-                                       <property name="locale">
-                                           <locale language="C" country="AnyCountry"/>
-                                       </property>
-                                       <property name="text">
-                                           <string>Embed all fonts</string>
-                                       </property>
-                                       <property name="autoExclusive">
-                                           <bool>false</bool>
-                                       </property>
-                                   </widget>
-                               </item>
-                           </layout>
-                       </widget>
-                   </widget>
-               </item>
-           </layout>
+        <layout class="QHBoxLayout" name="horizontalLayout_5">
+         <item>
+          <widget class="QLabel" name="label_6">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="text">
+            <string>Embedding Mode:</string>
+           </property>
+          </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 fonts</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Don't embed</string>
+            </property>
+           </item>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_9">
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <property name="spacing">
+            <number>5</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="label_8">
+             <property name="text">
+              <string>Fonts to embed:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="EmbedList"/>
+           </item>
+           <item>
+            <widget class="QPushButton" name="EmbedFonts">
+             <property name="text">
+              <string>&Embed all</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_8">
+           <property name="spacing">
+            <number>5</number>
+           </property>
+           <item>
+            <spacer name="verticalSpacer">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="ToSubset">
+             <property name="text">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QPushButton" name="FromSubset">
+             <property name="text">
+              <string/>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="verticalSpacer_2">
+             <property name="orientation">
+              <enum>Qt::Vertical</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>20</width>
+               <height>40</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <layout class="QVBoxLayout" name="verticalLayout_5">
+           <property name="spacing">
+            <number>5</number>
+           </property>
+           <item>
+            <widget class="QLabel" name="label_9">
+             <property name="text">
+              <string>Fonts to subset:</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QListWidget" name="SubsetList"/>
+           </item>
+           <item>
+            <widget class="QPushButton" name="SubsetFonts">
+             <property name="text">
+              <string>&Subset all</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
        </item>
       </layout>
      </widget>
@@ -622,7 +639,16 @@
     <string>E&xtras</string>
    </attribute>
    <layout class="QGridLayout" name="gridLayout_4">
-    <property name="margin">
+    <property name="leftMargin">
+     <number>10</number>
+    </property>
+    <property name="topMargin">
+     <number>10</number>
+    </property>
+    <property name="rightMargin">
+     <number>10</number>
+    </property>
+    <property name="bottomMargin">
      <number>10</number>
     </property>
     <property name="spacing">
@@ -865,7 +891,16 @@
     <property name="spacing">
      <number>5</number>
     </property>
-    <property name="margin">
+    <property name="leftMargin">
+     <number>10</number>
+    </property>
+    <property name="topMargin">
+     <number>10</number>
+    </property>
+    <property name="rightMargin">
+     <number>10</number>
+    </property>
+    <property name="bottomMargin">
      <number>10</number>
     </property>
     <item>
@@ -877,7 +912,16 @@
        <property name="spacing">
         <number>5</number>
        </property>
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <item>
@@ -885,7 +929,16 @@
          <property name="spacing">
           <number>5</number>
          </property>
-         <property name="margin">
+         <property name="leftMargin">
+          <number>0</number>
+         </property>
+         <property name="topMargin">
+          <number>0</number>
+         </property>
+         <property name="rightMargin">
+          <number>0</number>
+         </property>
+         <property name="bottomMargin">
           <number>0</number>
          </property>
          <item>
@@ -897,7 +950,16 @@
             <property name="spacing">
              <number>5</number>
             </property>
-            <property name="margin">
+            <property name="leftMargin">
+             <number>10</number>
+            </property>
+            <property name="topMargin">
+             <number>10</number>
+            </property>
+            <property name="rightMargin">
+             <number>10</number>
+            </property>
+            <property name="bottomMargin">
              <number>10</number>
             </property>
             <item>
@@ -940,7 +1002,16 @@
             <property name="spacing">
              <number>5</number>
             </property>
-            <property name="margin">
+            <property name="leftMargin">
+             <number>10</number>
+            </property>
+            <property name="topMargin">
+             <number>10</number>
+            </property>
+            <property name="rightMargin">
+             <number>10</number>
+            </property>
+            <property name="bottomMargin">
              <number>10</number>
             </property>
             <item>
@@ -1013,7 +1084,16 @@
           <property name="spacing">
            <number>5</number>
           </property>
-          <property name="margin">
+          <property name="leftMargin">
+           <number>10</number>
+          </property>
+          <property name="topMargin">
+           <number>10</number>
+          </property>
+          <property name="rightMargin">
+           <number>10</number>
+          </property>
+          <property name="bottomMargin">
            <number>10</number>
           </property>
           <item>
@@ -1052,7 +1132,16 @@
     <property name="spacing">
      <number>5</number>
     </property>
-    <property name="margin">
+    <property name="leftMargin">
+     <number>10</number>
+    </property>
+    <property name="topMargin">
+     <number>10</number>
+    </property>
+    <property name="rightMargin">
+     <number>10</number>
+    </property>
+    <property name="bottomMargin">
      <number>10</number>
     </property>
     <item>
@@ -1074,7 +1163,16 @@
        <string>Passwords</string>
       </property>
       <layout class="QGridLayout" name="groupPassLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">
@@ -1132,7 +1230,16 @@
        <property name="spacing">
         <number>5</number>
        </property>
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <item>
@@ -1176,7 +1283,16 @@
     <property name="spacing">
      <number>5</number>
     </property>
-    <property name="margin">
+    <property name="leftMargin">
+     <number>10</number>
+    </property>
+    <property name="topMargin">
+     <number>10</number>
+    </property>
+    <property name="rightMargin">
+     <number>10</number>
+    </property>
+    <property name="bottomMargin">
      <number>10</number>
     </property>
     <item>
@@ -1188,7 +1304,16 @@
        <property name="spacing">
         <number>5</number>
        </property>
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <item>
@@ -1243,7 +1368,16 @@
        <string>Rendering Settings</string>
       </property>
       <layout class="QGridLayout" name="lpiGroupLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">
@@ -1341,7 +1475,16 @@
        <string>Solid Colors:</string>
       </property>
       <layout class="QGridLayout" name="solidColorsGroupLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">
@@ -1407,7 +1550,16 @@
        <string>Images:</string>
       </property>
       <layout class="QGridLayout" name="imageProfileGroupLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">
@@ -1497,7 +1649,16 @@
     <property name="spacing">
      <number>5</number>
     </property>
-    <property name="margin">
+    <property name="leftMargin">
+     <number>10</number>
+    </property>
+    <property name="topMargin">
+     <number>10</number>
+    </property>
+    <property name="rightMargin">
+     <number>10</number>
+    </property>
+    <property name="bottomMargin">
      <number>10</number>
     </property>
     <item>
@@ -1506,7 +1667,16 @@
        <string>Printer Marks</string>
       </property>
       <layout class="QGridLayout" name="markGroupLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">
@@ -1576,7 +1746,16 @@
        <string>Bleed Settings</string>
       </property>
       <layout class="QGridLayout" name="bleedGroupLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">
@@ -1638,7 +1817,16 @@
        <string>PDF/X Output Intent</string>
       </property>
       <layout class="QGridLayout" name="X3GroupLayout">
-       <property name="margin">
+       <property name="leftMargin">
+        <number>10</number>
+       </property>
+       <property name="topMargin">
+        <number>10</number>
+       </property>
+       <property name="rightMargin">
+        <number>10</number>
+       </property>
+       <property name="bottomMargin">
         <number>10</number>
        </property>
        <property name="spacing">




More information about the scribus-commit mailing list