r18410 by jghali - #11694: PDF checker : Bad "font non embedded" issue

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 3 22:56:25 UTC 2013


Author: jghali
Date: Sat Aug  3 22:56:25 2013
New Revision: 18410

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18410
Log:
#11694: PDF checker : Bad "font non embedded" issue

Modified:
    trunk/Scribus/scribus/documentchecker.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.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/prefsstructs.h
    trunk/Scribus/scribus/scribusstructs.h
    trunk/Scribus/scribus/ui/checkDocument.cpp

Modified: trunk/Scribus/scribus/documentchecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&path=/trunk/Scribus/scribus/documentchecker.cpp
==============================================================================
--- trunk/Scribus/scribus/documentchecker.cpp (original)
+++ trunk/Scribus/scribus/documentchecker.cpp Sat Aug  3 22:56:25 2013
@@ -68,7 +68,7 @@
 	checkerSettings.ignoreOffLayers = currDoc->checkerProfiles()[currDoc->curCheckProfile()].ignoreOffLayers;
 	checkerSettings.checkOffConflictLayers = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkOffConflictLayers;
 	checkerSettings.checkNotCMYKOrSpot = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkNotCMYKOrSpot;
-	checkerSettings.checkDeviceColorsAndOutputIntend = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkDeviceColorsAndOutputIntend;
+	checkerSettings.checkDeviceColorsAndOutputIntent = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkDeviceColorsAndOutputIntent;
 	checkerSettings.checkFontNotEmbedded = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkFontNotEmbedded;
 	checkerSettings.checkFontIsOpenType = currDoc->checkerProfiles()[currDoc->curCheckProfile()].checkFontIsOpenType;
 	currDoc->docItemErrors.clear();
@@ -238,7 +238,7 @@
 						bool succeeded = analyst.inspectPDF(pageNum, usedColorSpaces, hasTransparency, usedFonts, imgs);
 						if (succeeded)
 						{
-							if (checkerSettings.checkNotCMYKOrSpot || checkerSettings.checkDeviceColorsAndOutputIntend)
+							if (checkerSettings.checkNotCMYKOrSpot || checkerSettings.checkDeviceColorsAndOutputIntent)
 							{
 								eColorSpaceType currPrintProfCS = ColorSpace_Unknown;
 								if (currDoc->HasCMS)
@@ -258,18 +258,18 @@
 										}
 									}
 								}
-								if (checkerSettings.checkDeviceColorsAndOutputIntend && currDoc->HasCMS)
+								if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
 								{
 									for (int i=0; i<usedColorSpaces.size(); ++i)
 									{
 										if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
 										{
-											itemError.insert(DeviceColorAndOutputIntend, 0);
+											itemError.insert(DeviceColorsAndOutputIntent, 0);
 											break;
 										}
 										else if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
 										{
-											itemError.insert(DeviceColorAndOutputIntend, 0);
+											itemError.insert(DeviceColorsAndOutputIntent, 0);
 											break;
 										}
 									}
@@ -529,7 +529,7 @@
 						bool succeeded = analyst.inspectPDF(pageNum, usedColorSpaces, hasTransparency, usedFonts, imgs);
 						if (succeeded)
 						{
-							if (checkerSettings.checkNotCMYKOrSpot || checkerSettings.checkDeviceColorsAndOutputIntend)
+							if (checkerSettings.checkNotCMYKOrSpot || checkerSettings.checkDeviceColorsAndOutputIntent)
 							{
 								int currPrintProfCS = -1;
 								if (currDoc->HasCMS)
@@ -549,18 +549,18 @@
 										}
 									}
 								}
-								if (checkerSettings.checkDeviceColorsAndOutputIntend && currDoc->HasCMS)
+								if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
 								{
 									for (int i=0; i<usedColorSpaces.size(); ++i)
 									{
 										if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
 										{
-											itemError.insert(DeviceColorAndOutputIntend, 0);
+											itemError.insert(DeviceColorsAndOutputIntent, 0);
 											break;
 										}
 										else if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
 										{
-											itemError.insert(DeviceColorAndOutputIntend, 0);
+											itemError.insert(DeviceColorsAndOutputIntent, 0);
 											break;
 										}
 									}

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&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 Sat Aug  3 22:56:25 2013
@@ -1116,6 +1116,10 @@
 	checkerSettings.checkForGIF       = attrs.valueAsBool("checkForGIF", true);
 	checkerSettings.ignoreOffLayers   = attrs.valueAsBool("ignoreOffLayers", false);
 	checkerSettings.checkOffConflictLayers = attrs.valueAsBool("checkOffConflictLayers", false);
+	checkerSettings.checkNotCMYKOrSpot     = attrs.valueAsBool("checkNotCMYKOrSpot", false);
+	checkerSettings.checkDeviceColorsAndOutputIntent = attrs.valueAsBool("checkDeviceColorsAndOutputIntent", false);
+	checkerSettings.checkFontNotEmbedded = attrs.valueAsBool("checkFontNotEmbedded", false);
+	checkerSettings.checkFontIsOpenType  = attrs.valueAsBool("checkFontIsOpenType", false);
 	doc->set1CheckerProfile(profileName, checkerSettings);
 	return true;
 }

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&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 Sat Aug  3 22:56:25 2013
@@ -2318,6 +2318,7 @@
 bool Scribus150Format::readCheckProfile(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
 {
 	struct CheckerPrefs checkerSettings;
+
 	QString profileName = attrs.valueAsString("Name");
 	if (profileName.isEmpty())
 		return true;
@@ -2336,6 +2337,10 @@
 	checkerSettings.checkRasterPDF    = attrs.valueAsBool("checkRasterPDF", true);
 	checkerSettings.checkForGIF       = attrs.valueAsBool("checkForGIF", true);
 	checkerSettings.ignoreOffLayers   = attrs.valueAsBool("ignoreOffLayers", false);
+	checkerSettings.checkNotCMYKOrSpot   = attrs.valueAsBool("checkNotCMYKOrSpot", false);
+	checkerSettings.checkDeviceColorsAndOutputIntent = attrs.valueAsBool("checkDeviceColorsAndOutputIntent", false);
+	checkerSettings.checkFontNotEmbedded = attrs.valueAsBool("checkFontNotEmbedded", false);
+	checkerSettings.checkFontIsOpenType  = attrs.valueAsBool("checkFontIsOpenType", false);
 	doc->set1CheckerProfile(profileName, checkerSettings);
 	return true;
 }
@@ -3613,8 +3618,8 @@
 	isNewFormat = attrs.hasAttribute("ItemID");
 	if (isNewFormat)
 	{
-		LinkID.insert(attrs.valueAsInt("ItemID", 0), newItem);
 		info.itemID = attrs.valueAsInt("ItemID", 0);
+		LinkID.insert(info.itemID, newItem);
 	}
 	info.nextItem = attrs.valueAsInt("NEXTITEM", -1);
 	info.ownLink  = newItem->isTableItem ? attrs.valueAsInt("OwnLINK", 0) : 0;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&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 Sat Aug  3 22:56:25 2013
@@ -450,7 +450,10 @@
 		docu.writeAttribute("checkRasterPDF", static_cast<int>(itcp.value().checkRasterPDF));
 		docu.writeAttribute("checkForGIF", static_cast<int>(itcp.value().checkForGIF));
 		docu.writeAttribute("ignoreOffLayers", static_cast<int>(itcp.value().ignoreOffLayers));
-		//docu.writeEndElement();
+		docu.writeAttribute("checkNotCMYKOrSpot", static_cast<int>(itcp.value().checkNotCMYKOrSpot));
+		docu.writeAttribute("checkDeviceColorsAndOutputIntent", static_cast<int>(itcp.value().checkDeviceColorsAndOutputIntent));
+		docu.writeAttribute("checkFontNotEmbedded", static_cast<int>(itcp.value().checkFontNotEmbedded));
+		docu.writeAttribute("checkFontIsOpenType", static_cast<int>(itcp.value().checkFontIsOpenType));
 	}
 }
 

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sat Aug  3 22:56:25 2013
@@ -1616,7 +1616,7 @@
 		dcVerifierProfile.setAttribute("MinimumResolution",ScCLocale::toQStringC(itcp.value().minResolution));
 		dcVerifierProfile.setAttribute("MaximumResolution",ScCLocale::toQStringC(itcp.value().maxResolution));
 		dcVerifierProfile.setAttribute("CheckNotCMYKOrSpot", static_cast<int>(itcp.value().checkNotCMYKOrSpot));
-		dcVerifierProfile.setAttribute("CheckDeviceColorsAndOutputIntend", static_cast<int>(itcp.value().checkDeviceColorsAndOutputIntend));
+		dcVerifierProfile.setAttribute("CheckDeviceColorsAndOutputIntent", static_cast<int>(itcp.value().checkDeviceColorsAndOutputIntent));
 		dcVerifierProfile.setAttribute("CheckFontNotEmbedded", static_cast<int>(itcp.value().checkFontNotEmbedded));
 		dcVerifierProfile.setAttribute("CheckFontIsOpenType", static_cast<int>(itcp.value().checkFontIsOpenType));
 		elem.appendChild(dcVerifierProfile);
@@ -2324,7 +2324,7 @@
 			checkerSettings.ignoreOffLayers = static_cast<bool>(dc.attribute("IgnoreOffLayers", "0").toInt());
 			checkerSettings.checkOffConflictLayers = static_cast<bool>(dc.attribute("CheckOffConflictLayers", "0").toInt());
 			checkerSettings.checkNotCMYKOrSpot = static_cast<bool>(dc.attribute("CheckNotCMYKOrSpot", "0").toInt());
-			checkerSettings.checkDeviceColorsAndOutputIntend = static_cast<bool>(dc.attribute("CheckDeviceColorsAndOutputIntend", "0").toInt());
+			checkerSettings.checkDeviceColorsAndOutputIntent = static_cast<bool>(dc.attribute("CheckDeviceColorsAndOutputIntent", "0").toInt());
 			checkerSettings.checkFontNotEmbedded = static_cast<bool>(dc.attribute("CheckFontNotEmbedded", "0").toInt());
 			checkerSettings.checkFontIsOpenType = static_cast<bool>(dc.attribute("CheckFontIsOpenType", "0").toInt());
 			appPrefs.verifierPrefs.checkerPrefsList[name] = checkerSettings;
@@ -2639,7 +2639,7 @@
 		checkerSettings.minResolution = 144.0;
 		checkerSettings.maxResolution = 2400.0;
 		checkerSettings.checkNotCMYKOrSpot = false;
-		checkerSettings.checkDeviceColorsAndOutputIntend = false;
+		checkerSettings.checkDeviceColorsAndOutputIntent = false;
 		checkerSettings.checkFontNotEmbedded = false;
 		checkerSettings.checkFontIsOpenType = false;
 		//TODO Stop translating these into settings!!!!!!!!!
@@ -2653,13 +2653,13 @@
 		checkerSettings.checkTransparency = true;
 		checkerSettings.checkAnnotations = true;
 		checkerSettings.minResolution = 144.0;
-		checkerSettings.checkDeviceColorsAndOutputIntend = true;
+		checkerSettings.checkDeviceColorsAndOutputIntent = true;
 		cp->insert( CommonStrings::PDF_X3	, checkerSettings);
 		checkerSettings.checkNotCMYKOrSpot = true;
-		checkerSettings.checkDeviceColorsAndOutputIntend = false;
+		checkerSettings.checkDeviceColorsAndOutputIntent = false;
 		cp->insert( CommonStrings::PDF_X1a	, checkerSettings);
 		checkerSettings.checkNotCMYKOrSpot = false;
-		checkerSettings.checkDeviceColorsAndOutputIntend = true;
+		checkerSettings.checkDeviceColorsAndOutputIntent = true;
 		checkerSettings.checkTransparency = false;
 		checkerSettings.checkFontIsOpenType = false;
 		cp->insert( CommonStrings::PDF_X4	, checkerSettings);

Modified: trunk/Scribus/scribus/prefsstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&path=/trunk/Scribus/scribus/prefsstructs.h
==============================================================================
--- trunk/Scribus/scribus/prefsstructs.h (original)
+++ trunk/Scribus/scribus/prefsstructs.h Sat Aug  3 22:56:25 2013
@@ -28,6 +28,10 @@
 
 struct CheckerPrefs
 {
+	CheckerPrefs() { 
+		memset(this, 0, sizeof(CheckerPrefs));
+	}
+
 	bool ignoreErrors;
 	bool autoCheck;
 	bool checkGlyphs;
@@ -44,7 +48,7 @@
 	bool ignoreOffLayers;
 	bool checkOffConflictLayers; //Check whether layers are marked as visible but not to be printed or vice versa
 	bool checkNotCMYKOrSpot; // colors must be either CMYK or spot (PDF/X-1a)
-	bool checkDeviceColorsAndOutputIntend; // unmanaged colors (device colors) must agree with output intend
+	bool checkDeviceColorsAndOutputIntent; // unmanaged colors (device colors) must agree with output intend
 	bool checkFontNotEmbedded; // embedded PDF might use fonts without embedding
 	bool checkFontIsOpenType; // embedded PDF might use OpenType font program (only allowed in PDF/X-4 and PDF 1.6)
 	bool checkPartFilledImageFrames;

Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Sat Aug  3 22:56:25 2013
@@ -267,7 +267,7 @@
 	BlendMode=11,
 	WrongFontInAnnotation=12,
 	NotCMYKOrSpot=13,
-	DeviceColorAndOutputIntend=14,
+	DeviceColorsAndOutputIntent=14,
 	FontNotEmbedded=15,
 	EmbeddedFontIsOpenType=16,
 	OffConflictLayers=17,

Modified: trunk/Scribus/scribus/ui/checkDocument.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18410&path=/trunk/Scribus/scribus/ui/checkDocument.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.cpp (original)
+++ trunk/Scribus/scribus/ui/checkDocument.cpp Sat Aug  3 22:56:25 2013
@@ -284,10 +284,12 @@
 			item->setText(COLUMN_PROBLEM, notCMYKOrSpot);
 			item->setIcon(COLUMN_ITEM, onlyWarning);
 			itemError = true;
+			break;
 		case FontNotEmbedded:
 			item->setText(COLUMN_PROBLEM, fontNotEmbedded);
 			item->setIcon(COLUMN_ITEM, graveError);
 			itemError = true;
+			break;
 		default:
 			break;
 	};




More information about the scribus-commit mailing list