+2004-10-11 Andreas Vox <vox@isp.uni-luebeck.de>
+
+ * 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 <lasgouttes@lyx.org>
* QLPopupMenu.C (populate): move the code below to here, so that
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
#include <ApplicationServices/ApplicationServices.h>
#endif
-namespace {
-void addFontPath()
+
+void qfont_loader::addToFontPath()
{
#ifdef Q_WS_X11
string const dir = OnlyPath(LibFileSearch("xfonts", "fonts.dir"));
<< endl;
}
#endif
+}
+
+void qfont_loader::initFontPath()
+{
#ifdef Q_WS_MACX
CFBundleRef myAppBundle = CFBundleGetMainBundle();
CFURLRef myAppResourcesURL, FontsURL;
#endif
}
+namespace {
struct symbol_font {
LyXFont::FONT_FAMILY lyx_family;
{
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);
return false;
first_time = false;
- addFontPath();
+ addToFontPath();
tmp = getSymbolFont(pat);
if (tmp.second) {
cache[family] = true;
/// 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 {