X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFontInfo.C;h=e7eb8117c0b70570e380daa8d303e9912a7b7e53;hb=dff2911bda426ad439e6475f62183cedd7044801;hp=d87c199475d658855e6cae8fed3e25f29dc802aa;hpb=31b56dac8042735f75229ad480b3e98531c181ff;p=lyx.git diff --git a/src/FontInfo.C b/src/FontInfo.C index d87c199475..e7eb8117c0 100644 --- a/src/FontInfo.C +++ b/src/FontInfo.C @@ -11,8 +11,6 @@ #include #include // fabs() -#include FORMS_H_LOCATION - #ifdef __GNUG__ #pragma implementation "FontInfo.h" #endif @@ -21,6 +19,8 @@ #include "debug.h" #include "lyxrc.h" // lyxrc.use_scalable_fonts #include "support/lstrings.h" +#include "support/lyxlib.h" +#include "frontends/GUIRunTime.h" using std::endl; @@ -50,7 +50,7 @@ string const FontInfo::getFontname(int size) } } - if (scalable && lyxrc.use_scalable_fonts) { + if (scalable && (lyxrc.use_scalable_fonts || closestind == -1)) { // We can use scalable string const font = resize(strings[scaleindex], size); lyxerr[Debug::FONT] << "Using scalable font to get\n" @@ -60,7 +60,7 @@ string const FontInfo::getFontname(int size) // Did any fonts get close? if (closestind == -1) { - // No, and we are not allowed to use scalables, so... + // No, so... return string(); } @@ -111,7 +111,7 @@ void FontInfo::query() return; if (pattern.empty()) { - lyxerr << "Can not use empty font name for font query." + lyxerr << "Cannot use empty font name for font query." << endl; queried = true; return; @@ -119,7 +119,8 @@ void FontInfo::query() char ** list = 0; if (lyxrc.use_gui) - list = XListFonts(fl_get_display(), pattern.c_str(), 100, &matches); + list = XListFonts(GUIRunTime::x11Display(), pattern.c_str(), + 100, &matches); if (list == 0) { // No fonts matched @@ -133,6 +134,8 @@ void FontInfo::query() // We have matches. Run them through for (int i = 0; i < matches; ++i) { string name(list[i]); + lyxerr[Debug::FONT] << "match #" << i << " " + << name << endl; sizes[i] = lyx::atoi(token(name, '-', 7)); strings[i] = name; if (sizes[i] == 0) {