try to account for non-existing symbol fonts

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10292 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2005-07-17 15:32:28 +00:00
parent 1de2bc6d79
commit a4fc1ae96d
2 changed files with 17 additions and 12 deletions

View File

@ -117,10 +117,11 @@ void FontInfo::query()
if (queried)
return;
queried = true;
if (pattern.empty()) {
lyxerr << "Cannot use empty font name for font query."
<< endl;
queried = true;
return;
}
@ -155,7 +156,6 @@ void FontInfo::query()
};
XFreeFontNames(list);
}
queried = true;
}

View File

@ -300,6 +300,21 @@ XFontStruct * xfont_loader::doLoad(LyXFont::FONT_FAMILY family,
}
getFontinfo(family, series, shape);
LyXFont f;
f.setFamily(family);
f.setSeries(series);
f.setShape(shape);
f.setSize(size);
// The rest of the attributes are not interesting
f.setEmph(LyXFont::INHERIT);
f.setUnderbar(LyXFont::INHERIT);
f.setNoun(LyXFont::INHERIT);
f.setColor(LColor::inherit);
if (f.isSymbolFont() && !fontinfo[family][series][shape]->exist())
return 0;
// FIXME! CHECK! Should we use 72.0 or 72.27? (Lgb)
int fsize = int((convert<double>(lyxrc.font_sizes[size]) * lyxrc.dpi *
(lyxrc.zoom/100.0)) / 72.27 + 0.5);
@ -326,16 +341,6 @@ XFontStruct * xfont_loader::doLoad(LyXFont::FONT_FAMILY family,
}
} else if (lyxerr.debugging(Debug::FONT)) {
// Tell user the font matching
LyXFont f;
f.setFamily(family);
f.setSeries(series);
f.setShape(shape);
f.setSize(size);
// The rest of the attributes are not interesting
f.setEmph(LyXFont::INHERIT);
f.setUnderbar(LyXFont::INHERIT);
f.setNoun(LyXFont::INHERIT);
f.setColor(LColor::inherit);
lyxerr << "Font '" << f.stateText(0)
<< "' matched by\n" << font << endl;
}