#include <ApplicationServices/ApplicationServices.h>
#endif
+#ifdef Q_WS_WIN
+#include "windows.h"
+#include "support/os.h"
+#include "support/package.h"
+#include "support/path.h"
+using lyx::support::addName;
+using lyx::support::addPath;
+using lyx::support::package;
+namespace os = lyx::support::os;
+string const win_fonts_truetype[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
+ "eufm10", "msam10", "msbm10", "wasy10"};
+const int num_fonts_truetype = sizeof(win_fonts_truetype) / sizeof(*win_fonts_truetype);
+#endif
void FontLoader::initFontPath()
{
if (err)
lyxerr << "FMActivateFonts err = " << err << endl;
#endif
+
+#ifdef Q_WS_WIN
+ // Windows only: Add BaKoMa TrueType font resources
+ 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());
+ }
+#endif
+}
+
+FontLoader::~FontLoader() {
+#ifdef Q_WS_WIN
+ // Windows only: Remove BaKoMa TrueType font resources
+ 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());
+ }
+#endif
}
namespace {
public:
///
FontLoader();
+
+ /// Destructor
+ ~FontLoader();
/// Update fonts after zoom, dpi, font names, or norm change
void update();
#include <ApplicationServices/ApplicationServices.h>
#endif
+#ifdef Q_WS_WIN
+#include "windows.h"
+#include "support/os.h"
+#include "support/package.h"
+#include "support/path.h"
+using lyx::support::addName;
+using lyx::support::addPath;
+using lyx::support::package;
+namespace os = lyx::support::os;
+string const win_fonts_truetype[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
+ "eufm10", "msam10", "msbm10", "wasy10"};
+const int num_fonts_truetype = sizeof(win_fonts_truetype) / sizeof(*win_fonts_truetype);
+#endif
void FontLoader::initFontPath()
{
if (err)
lyxerr << "FMActivateFonts err = " << err << endl;
#endif
+
+#ifdef Q_WS_WIN
+ // Windows only: Add BaKoMa TrueType font resources
+ 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());
+ }
+#endif
+}
+
+FontLoader::~FontLoader() {
+#ifdef Q_WS_WIN
+ // Windows only: Remove BaKoMa TrueType font resources
+ 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());
+ }
+#endif
}
namespace {
public:
///
FontLoader();
+
+ /// Destructor
+ ~FontLoader();
/// Update fonts after zoom, dpi, font names, or norm change
void update();