Index: scfonts.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/scfonts.cpp,v
retrieving revision 1.15.2.23
diff -u -r1.15.2.23 scfonts.cpp
--- scfonts.cpp	8 Jul 2005 17:31:36 -0000	1.15.2.23
+++ scfonts.cpp	11 Jul 2005 15:47:59 -0000
@@ -40,6 +40,7 @@
 #include <fontconfig/fontconfig.h>
 #endif
 
+#include "scpaths.h"
 #include "util.h"
 
 #include FT_INTERNAL_STREAM_H
@@ -486,12 +487,15 @@
 	FT_Library library = NULL;
 	QString pathfile;
 	bool error;
-	error = FT_Init_FreeType( &library );        
+	error = FT_Init_FreeType( &library ); 
 	QDir d(path, "*", QDir::Name, QDir::Dirs | QDir::Files | QDir::Readable);
 	if ((d.exists()) && (d.count() != 0))
 	{
 		for (uint dc = 0; dc < d.count(); ++dc)
 		{
+			if( d[dc] == "." || d[dc] == ".." ) // Necessary on Windows
+				continue;
+			
 			QFileInfo fi(path+d[dc]);
 			if (!fi.exists())      // Sanity check for broken Symlinks
 				continue;
@@ -910,13 +914,18 @@
 	for(QStrListIterator fpi(FontPath) ; fpi.current() ; ++fpi)
 		AddScalableFonts(fpi.current());
 	AddFontconfigFonts();
+	if( FontPath.count() == 0 ) // Search the default paths
+	{
+		QStringList ftDirs = ScPaths::getSystemFontDirs();
+		for(unsigned int i = 0; i < ftDirs.count(); i++)
+			AddScalableFonts( ftDirs[i] );
+	}
 #else
-// if FreeType thinks we are on Mac, let it search the default paths
-#if FT_MACINTOSH
-	AddScalableFonts(QDir::homeDirPath() + "/Library/Fonts/");
-	AddScalableFonts("/Library/Fonts/");
-	AddScalableFonts("/Network/Library/Fonts/");
-	AddScalableFonts("/System/Library/Fonts/");
+// if FreeType thinks we are on Mac or Win32, let it search the default paths
+#if FT_MACINTOSH || defined(_WIN32)
+	QStringList ftDirs = ScPaths::getSystemFontDirs();
+	for(int i = 0; i < ftDirs.count(); i++)
+		AddScalableFonts( ftDirs[i] );
 #endif
 // on X11 look there:
 #ifdef Q_WS_X11
Index: scpaths.cpp
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/scpaths.cpp,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 scpaths.cpp
--- scpaths.cpp	6 Jul 2005 20:07:15 -0000	1.1.2.5
+++ scpaths.cpp	11 Jul 2005 15:18:59 -0000
@@ -1,15 +1,22 @@
 #include "scpaths.h"
 #include <qapplication.h>
+#include <qdir.h>
 
 #include "scconfig.h"
 
-
 // On Qt/Mac we need CoreFoundation to discover the location
 // of the app bundle.
 #ifdef BUILD_MAC_BUNDLE
 #include <CoreFoundation/CoreFoundation.h>
 #endif
 
+#ifdef _WIN32
+#include <windows.h>
+#include <shlobj.h>
+#else
+#include <assert.h>
+#endif
+
 // Init the singleton's "self" address to NULL
 ScPaths* ScPaths::m_instance = NULL;
 
@@ -77,6 +84,8 @@
 	m_templateDir = strdup(QString("%1/Contents/share/scribus/templates/").arg(pathPtr));
 	m_libDir = strdup(QString("%1/Contents/lib/scribus/").arg(pathPtr));
 	m_pluginDir = strdup(QString("%1/Contents/lib/scribus/plugins/").arg(pathPtr));
+	m_userDocDir = QDir::homeDirPath() + "/Desktop/";
+	m_prefDir = QDir::homeDirPath() + "/.scribus/";
 	QApplication::setLibraryPaths(QString("%1/Contents/lib/qtplugins/").arg(pathPtr));
 	CFRelease(pluginRef);
 	CFRelease(macPath);
@@ -90,7 +99,22 @@
 	qDebug(QString("scpaths: plugin dir=%1").arg(m_pluginDir));
 	qDebug(QString("scpaths: qtplugins=%1").arg(QApplication::libraryPaths().join(":")));
 */
-#endif // defined(BUILD_MAC_BUNDLE)
+#elif defined(_WIN32)
+	QString appPath = qApp->applicationDirPath();
+	m_shareDir = strdup(QString("%1/share/").arg(appPath));
+	m_docDir = strdup(QString("%1/share/doc/").arg(appPath));
+	m_iconDir = strdup(QString("%1/share/icons/").arg(appPath));
+	m_sampleScriptDir = strdup(QString("%1/share/samples/").arg(appPath));
+	m_scriptDir = strdup(QString("%1/share/scripts/").arg(appPath));
+	m_templateDir = strdup(QString("%1/share/templates/").arg(appPath));
+	m_libDir = strdup(QString("%1/libs/").arg(appPath));
+	m_pluginDir = strdup(QString("%1/plugins/").arg(appPath));
+	m_userDocDir = getSpecialDir(CSIDL_PERSONAL); 
+	m_prefDir = getSpecialDir(CSIDL_APPDATA) + "Scribus/";
+#else
+	m_userDocDir = QDir::homeDirPath();
+	m_prefDir = QDir::homeDirPath() + "/.scribus/";
+#endif
 }
 
 ScPaths::~ScPaths() {};
@@ -134,3 +158,43 @@
 {
 	return m_shareDir;
 }
+
+const QString&  ScPaths::userDocumentDir() const
+{
+	return m_userDocDir;
+}
+
+const QString&  ScPaths::preferenceDir() const
+{
+	return m_prefDir;
+}
+
+QStringList ScPaths::getSystemFontDirs(void)
+{
+	QStringList fontDirs;
+#ifdef BUILD_MAC_BUNDLE
+	fontDirs.append(QDir::homeDirPath() + "/Library/Fonts/");
+	fontDirs.append("/Library/Fonts/");
+	fontDirs.append("/Network/Library/Fonts/");
+	fontDirs.append("/System/Library/Fonts/");
+#else if defined(_WIN32)
+	fontDirs.append( getSpecialDir(CSIDL_FONTS) );
+#endif
+	return fontDirs;
+}
+
+QString ScPaths::getSpecialDir(int folder)
+{
+	QString qstr;
+#if defined( _WIN32 )
+	char dir[256];
+	SHGetSpecialFolderPath(NULL, dir, folder , false);
+	qstr = dir;
+	if( !qstr.endsWith("\\") )
+		qstr += "\\";
+	qstr.replace( '\\', '/' );
+#else
+	assert(false);
+#endif
+	return qstr;
+}
Index: scpaths.h
===================================================================
RCS file: /cvs/Scribus/scribus/Attic/scpaths.h,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 scpaths.h
--- scpaths.h	6 Jul 2005 20:07:16 -0000	1.1.2.2
+++ scpaths.h	11 Jul 2005 13:47:41 -0000
@@ -2,6 +2,7 @@
 #define SCPATHS_H
 
 #include "qstring.h"
+#include "qstringlist.h"
 
 class ScPaths
 {
@@ -35,6 +36,13 @@
 	const QString& templateDir() const;
 	/** @brief Return path to the Scribus share directory */
 	const QString& shareDir() const;
+	/** @brief Return path to the user documents directory */
+	const QString& userDocumentDir() const;
+	/** @brief Return path to the preference directory */
+	const QString& preferenceDir() const;
+
+	/** @brief Return paths to system font directories*/
+	static QStringList getSystemFontDirs(void);
 
 protected:
 	/** @brief Constructor. Use ScPaths::instance() instead. */
@@ -42,6 +50,9 @@
 	/** @brief Destructor. Use ScPaths::destroy() instead. */
 	~ScPaths();
 
+	/** @brief Return path to a special directory, should be used only on Windows*/
+	static QString getSpecialDir(int folder);
+
 	/** @brief Pointer to existing instance of ScPaths, if any. */
 	static ScPaths* m_instance;
 
@@ -54,5 +65,7 @@
 	QString m_scriptDir;
 	QString m_templateDir;
 	QString m_shareDir;
+	QString m_userDocDir;
+	QString m_prefDir;
 };
 #endif
