#include <config.h>
#include <cmath> // fabs()
-#include FORMS_H_LOCATION
-
#ifdef __GNUG__
#pragma implementation "FontInfo.h"
#endif
#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;
}
}
- 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"
// Did any fonts get close?
if (closestind == -1) {
- // No, and we are not allowed to use scalables, so...
+ // No, so...
return string();
}
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;
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
// 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) {