Fix qfont_loader::available for QT2.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5410 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Dekel Tsur 2002-10-15 12:59:08 +00:00
parent f26e81fc97
commit cc1f4a2dc4
2 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2002-10-15 Dekel Tsur <dekelts@tau.ac.il>
* qfont_loader.C (available): Add code for QT 2.x.
2002-10-14 Dekel Tsur <dekelts@tau.ac.il>
* lyx_gui.C (getDPI): Implemented.

View File

@ -20,6 +20,11 @@
#include "debug.h"
#include "lyxrc.h"
#include "BufferView.h"
#include <qglobal.h>
#if QT_VERSION < 0x030000
#include "support/lstrings.h"
#endif
using std::endl;
@ -149,5 +154,24 @@ bool qfont_loader::available(LyXFont const & f)
if (!lyxrc.use_gui)
return false;
#if QT_VERSION >= 0x030000
return getfontinfo(f)->font.exactMatch();
#else
string tmp;
switch (f.family()) {
case LyXFont::SYMBOL_FAMILY: tmp = "symbol"; break;
case LyXFont::CMR_FAMILY: tmp = "cmr10"; break;
case LyXFont::CMSY_FAMILY: tmp = "cmsy10"; break;
case LyXFont::CMM_FAMILY: tmp = "cmmi10"; break;
case LyXFont::CMEX_FAMILY: tmp = "cmex10"; break;
case LyXFont::MSA_FAMILY: tmp = "msam10"; break;
case LyXFont::MSB_FAMILY: tmp = "msbm10"; break;
default: break;
}
if (tmp.empty())
return false;
else
return token(getfontinfo(f)->font.rawName().latin1(), '-', 2)
== tmp;
#endif
}