On Fri, Jul 06, 2007 at 04:31:24PM +0200, Enrico Forestieri wrote:

> On Fri, Jul 06, 2007 at 01:23:48PM +0200, Jean-Marc Lasgouttes wrote:
> 
> > 
> > Hello,
> > 
> > Since Jose' plans to release 1.5.0 next week, we'd better be ready
> > with 1.4.5 too. I append the ANNOUNCE file that I just updated.
> > 
> > Jose', I would appreciate if you could upgrade lyx2lyx in branch to
> > handle the 1.5 final format.
> > 
> > Other things?
> 
> I think that the patch by Peter dealing with duplicate font names
> in the system font dir should also be applied to 1.4.5.

Here it is. I verified that with the patch applied one can have fonts
with the same name as the Bakoma ones installed in the system font dir
and yet the latter are used in LyX.

-- 
Enrico
Index: src/frontends/qt2/qfont_loader.C
===================================================================
--- src/frontends/qt2/qfont_loader.C    (revision 19013)
+++ src/frontends/qt2/qfont_loader.C    (working copy)
@@ -52,7 +52,9 @@ using std::string;
 #endif
 
 #ifdef Q_WS_WIN
-#include "windows.h"
+// Require Windows API > Win98 (only needed for AddFontResourceEx)
+#define _WIN32_WINNT 0x0500
+#include <windows.h>
 #include "support/os.h"
 #include "support/package.h"
 #include "support/path.h"
@@ -100,9 +102,9 @@ void FontLoader::initFontPath()
        string const fonts_dir = AddPath(package().system_support(), "fonts");
        
        for (int i = 0 ; i < num_fonts_truetype ; ++i) {
-               string const font_current = 
-                       AddName(fonts_dir, win_fonts_truetype[i] + ".ttf");
-               AddFontResource(os::external_path(font_current).c_str());
+               string const font_current = os::external_path(
+                       AddName(fonts_dir, win_fonts_truetype[i] + ".ttf"));
+               AddFontResourceEx(font_current.c_str(), FR_PRIVATE, 0);
        }
 #endif
 }
@@ -113,9 +115,9 @@ FontLoader::~FontLoader() {
        string const fonts_dir = AddPath(package().system_support(), "fonts");
        
        for(int i = 0 ; i < num_fonts_truetype ; ++i) {
-               string const font_current = 
-                       AddName(fonts_dir, win_fonts_truetype[i] + ".ttf");
-               RemoveFontResource(os::external_path(font_current).c_str());
+               string const font_current = os::external_path(
+                       AddName(fonts_dir, win_fonts_truetype[i] + ".ttf"));
+               RemoveFontResourceEx(font_current.c_str(), FR_PRIVATE, 0);
        }
 #endif
 }

Reply via email to