>>>>> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

Bennett> The patch works for me in all of 1.4.0, 1.3.6cvs and 1.3.5.

Thanks. I will apply the modified versions below, then.

Bennett> I've posted a new version to:

Bennett> <http://edisk.fandm.edu/bennett.helm/lyx/lyx-1.3.5-3macos_aqua.tgz>

Bennett> This applies Andreas' patch and changes the
Bennett> CFBundleIdentifier to org.lyx.

And the mac.bind?

The file is now on ftp.lyx.org.

JMarc

Index: src/frontends/qt2/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.715
diff -u -p -r1.715 ChangeLog
--- src/frontends/qt2/ChangeLog	7 Oct 2004 08:03:18 -0000	1.715
+++ src/frontends/qt2/ChangeLog	13 Oct 2004 15:22:01 -0000
@@ -1,3 +1,11 @@
+2004-10-11  Andreas Vox  <[EMAIL PROTECTED]>
+
+	* qfont_loader.C (initFontPath, addToFontPath): two new static
+	member functions that replace addFontPath 
+	(available): remove special MacOSX code; use addToFontPath
+
+	* lyx_gui.C (parse_init): add call to qfont_loader::initFontPath()
+        
 2004-10-01  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* QLPopupMenu.C (populate): move the code below to here, so that
Index: src/frontends/qt2/lyx_gui.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lyx_gui.C,v
retrieving revision 1.74
diff -u -p -r1.74 lyx_gui.C
--- src/frontends/qt2/lyx_gui.C	7 Oct 2004 08:03:18 -0000	1.74
+++ src/frontends/qt2/lyx_gui.C	13 Oct 2004 15:22:01 -0000
@@ -154,6 +154,9 @@ bool use_gui = true;
 
 void parse_init(int & argc, char * argv[])
 {
+	// Force adding of font path _before_ QApplication is initialized
+	qfont_loader::initFontPath();
+	
 	static LQApplication app(argc, argv);
 
 #if QT_VERSION >= 0x030200
Index: src/frontends/qt2/qfont_loader.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qfont_loader.C,v
retrieving revision 1.50
diff -u -p -r1.50 qfont_loader.C
--- src/frontends/qt2/qfont_loader.C	14 Sep 2004 10:20:38 -0000	1.50
+++ src/frontends/qt2/qfont_loader.C	13 Oct 2004 15:22:01 -0000
@@ -50,9 +50,9 @@ using std::string;
 #include <ApplicationServices/ApplicationServices.h>
 #endif
 
-namespace {
 
-void addFontPath()
+
+void qfont_loader::addToFontPath()
 {
 #ifdef Q_WS_X11
 	string const dir =  OnlyPath(LibFileSearch("xfonts", "fonts.dir"));
@@ -72,6 +72,10 @@ void addFontPath()
 		       << endl;
 	}
 #endif
+}
+
+void qfont_loader::initFontPath()
+{
 #ifdef Q_WS_MACX
 	CFBundleRef  myAppBundle = CFBundleGetMainBundle();
 	CFURLRef  myAppResourcesURL, FontsURL;
@@ -101,6 +105,7 @@ void addFontPath()
 #endif
 }
 
+namespace {
 
 struct symbol_font {
 	LyXFont::FONT_FAMILY lyx_family;
@@ -385,13 +390,6 @@ bool qfont_loader::available(LyXFont con
 {
 	if (!lyx_gui::use_gui)
 		return false;
-#ifdef Q_WS_MACX
-	static bool need_bundle_fonts = true;
-	if (need_bundle_fonts) {
-		addFontPath();
-		need_bundle_fonts = false;
-	}
-#endif
 
 	static vector<bool> cache_set(LyXFont::NUM_FAMILIES, false);
 	static vector<bool> cache(LyXFont::NUM_FAMILIES, false);
@@ -417,7 +415,7 @@ bool qfont_loader::available(LyXFont con
 			return false;
 
 		first_time = false;
-		addFontPath();
+		addToFontPath();
 		tmp = getSymbolFont(pat);
 		if (tmp.second) {
 			cache[family] = true;
Index: src/frontends/qt2/qfont_loader.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qfont_loader.h,v
retrieving revision 1.12
diff -u -p -r1.12 qfont_loader.h
--- src/frontends/qt2/qfont_loader.h	23 Aug 2003 00:16:39 -0000	1.12
+++ src/frontends/qt2/qfont_loader.h	13 Oct 2004 15:22:01 -0000
@@ -48,6 +48,12 @@ public:
 	/// return pixel width for the given unicode char
 	int charwidth(LyXFont const & f, Uchar val);
 
+	/// Called before QApplication is initialized
+	static void initFontPath();
+	
+	/// Called the first time when available() can't load a symbol font
+	static void addToFontPath();
+
 private:
 	/// hold info about a particular font
 	struct font_info {
Index: src/frontends/qt2/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.389.2.52
diff -u -p -r1.389.2.52 ChangeLog
--- src/frontends/qt2/ChangeLog	9 Sep 2004 09:35:16 -0000	1.389.2.52
+++ src/frontends/qt2/ChangeLog	13 Oct 2004 15:21:46 -0000
@@ -1,3 +1,11 @@
+2004-10-11  Andreas Vox  <[EMAIL PROTECTED]>
+
+	* qfont_loader.C (initFontPath, addToFontPath): two new static
+	member functions that replace addFontPath 
+	(available): remove special MacOSX code; use addToFontPath
+
+	* lyx_gui.C (parse_init): add call to qfont_loader::initFontPath()
+        
 2004-08-08  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* Makefile.am (AM_CXXFLAGS): do not disable QTranslator code
Index: src/frontends/qt2/lyx_gui.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/lyx_gui.C,v
retrieving revision 1.30.2.5
diff -u -p -r1.30.2.5 lyx_gui.C
--- src/frontends/qt2/lyx_gui.C	9 Sep 2004 09:35:17 -0000	1.30.2.5
+++ src/frontends/qt2/lyx_gui.C	13 Oct 2004 15:21:46 -0000
@@ -145,6 +145,9 @@ bool LQApplication::macEventFilter(Event
 
 void lyx_gui::parse_init(int & argc, char * argv[])
 {
+	// Force adding of font path _before_ QApplication is initialized
+	qfont_loader::initFontPath();
+	
 	static LQApplication app(argc, argv);
 
 #if QT_VERSION >= 0x030200
Index: src/frontends/qt2/qfont_loader.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qfont_loader.C,v
retrieving revision 1.27.2.6
diff -u -p -r1.27.2.6 qfont_loader.C
--- src/frontends/qt2/qfont_loader.C	15 Jan 2004 15:13:39 -0000	1.27.2.6
+++ src/frontends/qt2/qfont_loader.C	13 Oct 2004 15:21:46 -0000
@@ -47,9 +47,9 @@ using std::make_pair;
 #include <ApplicationServices/ApplicationServices.h>
 #endif
 
-namespace {
 
-void addFontPath()
+
+void qfont_loader::addToFontPath()
 {
 #ifdef Q_WS_X11
 	string const dir =  OnlyPath(LibFileSearch("xfonts", "fonts.dir"));
@@ -68,6 +68,10 @@ void addFontPath()
 		lyxerr << "Unable to add font path." << endl;
 	}
 #endif
+}
+
+void qfont_loader::initFontPath()
+{
 #ifdef Q_WS_MACX
 	CFBundleRef  myAppBundle = CFBundleGetMainBundle();
 	CFURLRef  myAppResourcesURL, FontsURL;
@@ -97,6 +101,7 @@ void addFontPath()
 #endif
 }
 
+namespace {
 
 struct symbol_font {
 	LyXFont::FONT_FAMILY lyx_family;
@@ -386,13 +391,6 @@ bool qfont_loader::available(LyXFont con
 {
 	if (!lyxrc.use_gui)
 		return false;
-#ifdef Q_WS_MACX
-	static bool need_bundle_fonts = true;
-	if (need_bundle_fonts) {
-		addFontPath();
-		need_bundle_fonts = false;
-	}
-#endif
 
 	static vector<bool> cache_set(LyXFont::NUM_FAMILIES, false);
 	static vector<bool> cache(LyXFont::NUM_FAMILIES, false);
@@ -418,7 +416,7 @@ bool qfont_loader::available(LyXFont con
 			return false;
 
 		first_time = false;
-		addFontPath();
+		addToFontPath();
 		tmp = getSymbolFont(pat);
 		if (tmp.second) {
 			cache[family] = true;
Index: src/frontends/qt2/qfont_loader.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/qfont_loader.h,v
retrieving revision 1.9
diff -u -p -r1.9 qfont_loader.h
--- src/frontends/qt2/qfont_loader.h	11 Dec 2002 00:22:37 -0000	1.9
+++ src/frontends/qt2/qfont_loader.h	13 Oct 2004 15:21:46 -0000
@@ -51,6 +51,12 @@ public:
 	/// return pixel width for the given unicode char
 	int charwidth(LyXFont const & f, Uchar val);
 
+	/// Called before QApplication is initialized
+	static void initFontPath();
+	
+	/// Called the first time when available() can't load a symbol font
+	static void addToFontPath();
+
 private:
 	/// hold info about a particular font
 	struct font_info {

Reply via email to