On Mon, Oct 02, 2006 at 11:34:43AM +0200, Abdelrazak Younes wrote: > With Georg's and Edwin's corrections.
Sorry for not catching this earlier, but if you substitute Q_WS_WIN with something else, please also take into account that it is also defined in a cygwin build without X11. So, the correct substitution for "#ifdef Q_WS_WIN" is #if defined(_WIN32) || (defined(__CYGWIN__) && defined(X_DISPLAY_MISSING)) I can do the corrections later (currently building). > Index: src/support/fontutils.C > =================================================================== [...] > +#ifdef _WIN32 > +#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; > + > +using std::string; > + > +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 [...] > +#ifdef _WIN32 > + // 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 > +} > + > + > +void restoreFontResources() > +{ > +#ifdef _WIN32 > + // 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 support > +} // namespace lyx -- Enrico