X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFontInfo.C;h=c61d6662bb8ff680209ea98e5ecfb94ac6104245;hb=9e5bd1d609877e602cb697bc695d410e2ab48e0d;hp=c4ec36d9dc1a29d32bf54c15cfb6a662a82fabcf;hpb=1c9a8d27a26b5f76562914f0e81aa98334f8c06a;p=lyx.git diff --git a/src/FontInfo.C b/src/FontInfo.C index c4ec36d9dc..c61d6662bb 100644 --- a/src/FontInfo.C +++ b/src/FontInfo.C @@ -13,6 +13,8 @@ #include // fabs() #include // atoi() +#include FORMS_H_LOCATION + #ifdef __GNUG__ #pragma implementation "FontInfo.h" #endif @@ -22,6 +24,7 @@ #include "lyxrc.h" // lyxrc.use_scalable_fonts #include "support/lstrings.h" +using std::endl; /// Load font close to this size string FontInfo::getFontname(int size) @@ -112,7 +115,9 @@ void FontInfo::query() return; } - char ** list = XListFonts(fl_display, pattern.c_str(), 100, &matches); + char ** list = 0; + if (lyxrc.use_gui) + list = XListFonts(fl_display, pattern.c_str(), 100, &matches); if (list == 0) { // No fonts matched @@ -141,6 +146,17 @@ void FontInfo::query() } +void FontInfo::init() +{ + sizes = 0; + strings = 0; + matches = 0; + queried = false; + scalable = false; + scaleindex = -1; +} + + /// Release allocated stuff void FontInfo::release() {