r23514 by jghali - #16068: PDF analyzer fails on dash pattern and type0 fonts <Pontobart>

scribus-commit scribus-commit at lists.scribus.net
Thu Mar 19 09:37:33 UTC 2020


Author: jghali
Date: Thu Mar 19 09:37:33 2020
New Revision: 23514

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23514
Log:
#16068: PDF analyzer fails on dash pattern and type0 fonts <Pontobart>

Modified:
    trunk/Scribus/scribus/pdf_analyzer.cpp

Modified: trunk/Scribus/scribus/pdf_analyzer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23514&path=/trunk/Scribus/scribus/pdf_analyzer.cpp
==============================================================================
--- trunk/Scribus/scribus/pdf_analyzer.cpp	(original)
+++ trunk/Scribus/scribus/pdf_analyzer.cpp	Thu Mar 19 09:37:33 2020
@@ -158,6 +158,7 @@
 	}
 	return CS_Unknown;
 }
+
 bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
 {
 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
@@ -278,7 +279,7 @@
 					PdfArray dashArr = args[0].GetArray();
 					for (uint i=0; i<dashArr.size(); ++i)
 						currGS.dashPattern.first.append(dashArr[i].GetNumber());
-					currGS.dashPattern.second = args[0].GetNumber();
+					currGS.dashPattern.second = args[1].GetNumber();
 					}
 					break;
 				case KW_g:
@@ -780,10 +781,10 @@
 			PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
 			if (descendantFonts && descendantFonts->IsArray())
 			{
-				PdfObject descendantFont = descendantFonts->GetArray()[0];
-				descendantFont.SetOwner(descendantFonts->GetOwner());
-				PdfObject* subtypeDescFont = descendantFont.GetIndirectKey("Subtype");
-				fontDesc = descendantFont.MustGetIndirectKey("FontDescriptor");
+				PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
+				PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+				PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
+				fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
 				if (subtypeDescFont && subtypeDescFont->IsName())
 				{
 					if (subtypeDescFont->GetName() == "CIDFontType0")




More information about the scribus-commit mailing list