r18336 by fschmid - Fixed detection of .PFM files

scribus-commit scribus-commit at lists.scribus.net
Sun Jun 23 10:05:46 UTC 2013


Author: fschmid
Date: Sun Jun 23 10:05:46 2013
New Revision: 18336

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18336
Log:
Fixed detection of .PFM files

Modified:
    trunk/Scribus/scribus/fonts/scface_ps.cpp

Modified: trunk/Scribus/scribus/fonts/scface_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18336&path=/trunk/Scribus/scribus/fonts/scface_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ps.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface_ps.cpp Sun Jun 23 10:05:46 2013
@@ -19,7 +19,7 @@
 	QFileInfo fi(fontPath);
 
 	QString fontDir  = fi.absolutePath();
-	QString fontFile = fi.fileName();
+	QString fontFile = fi.completeBaseName();
 
 	metricsFiles += findFontMetrics(fontDir, fontFile);
 
@@ -36,16 +36,13 @@
 		if (dir.exists(fontDir + "/pfm") && metricsFiles.size() <= 0)
 			metricsFiles += findFontMetrics(fontDir + "/pfm", fontFile);
 	}
-
 	return metricsFiles;
 }
 
 QStringList ScFace_postscript::findFontMetrics(const QString& baseDir, const QString& baseName) const
 {
 	QStringList metricsFiles;
-	QString     basePath = baseDir + "/" + baseName;
-	QString     afnm = basePath.left(basePath.length()-3);
-
+	QString     afnm = baseDir + "/" + baseName + ".";
 	// Look for afm files
 	QString afmName(afnm+"afm");
 	if(QFile::exists(afmName))
@@ -62,7 +59,6 @@
 				metricsFiles.append(afmName);
 		}
 	}
-
 	// Look for pfm files
 	QString pfmName(afnm+"pfm");
 	if(QFile::exists(pfmName))
@@ -74,12 +70,11 @@
 			metricsFiles.append(pfmName);
 		else
 		{
-			afmName = afnm+"PFM";
+			pfmName = afnm+"PFM";
 			if(QFile::exists(pfmName))
 				metricsFiles.append(pfmName);
 		}
 	}
-
 	return metricsFiles;
 }
 




More information about the scribus-commit mailing list