use "fixed" as the fallback font always
This commit is contained in:
parent
59d5199828
commit
bc8d855b11
2 changed files with 4 additions and 17 deletions
|
@ -20,7 +20,6 @@ extern "C" {
|
||||||
|
|
||||||
namespace otk {
|
namespace otk {
|
||||||
|
|
||||||
std::string Font::_fallback_font = "fixed";
|
|
||||||
bool Font::_xft_init = false;
|
bool Font::_xft_init = false;
|
||||||
|
|
||||||
Font::Font(int screen_num, const std::string &fontstring,
|
Font::Font(int screen_num, const std::string &fontstring,
|
||||||
|
@ -52,13 +51,13 @@ Font::Font(int screen_num, const std::string &fontstring,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printf(_("Unable to load font: %s\n"), _fontstring.c_str());
|
printf(_("Unable to load font: %s\n"), _fontstring.c_str());
|
||||||
printf(_("Trying fallback font: %s\n"), _fallback_font.c_str());
|
printf(_("Trying fallback font: %s\n"), "fixed");
|
||||||
|
|
||||||
if ((_xftfont = XftFontOpenName(**display, _screen_num,
|
if ((_xftfont = XftFontOpenName(**display, _screen_num,
|
||||||
_fallback_font.c_str())))
|
"fixed")))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
printf(_("Unable to load font: %s\n"), _fallback_font.c_str());
|
printf(_("Unable to load font: %s\n"), "fixed");
|
||||||
printf(_("Aborting!.\n"));
|
printf(_("Aborting!.\n"));
|
||||||
|
|
||||||
::exit(3); // can't continue without a font
|
::exit(3); // can't continue without a font
|
||||||
|
|
12
otk/font.hh
12
otk/font.hh
|
@ -23,20 +23,8 @@ class Font {
|
||||||
* static members
|
* static members
|
||||||
*/
|
*/
|
||||||
private:
|
private:
|
||||||
static std::string _fallback_font;
|
|
||||||
static bool _xft_init;
|
static bool _xft_init;
|
||||||
|
|
||||||
public:
|
|
||||||
// the fallback is only used for X fonts, not for Xft fonts, since it is
|
|
||||||
// assumed that X fonts will be the fallback from Xft.
|
|
||||||
inline static std::string fallbackFont(void) { return _fallback_font; }
|
|
||||||
inline static void setFallbackFont(const std::string &f)
|
|
||||||
{ _fallback_font = f; }
|
|
||||||
|
|
||||||
/*
|
|
||||||
* instance members
|
|
||||||
*/
|
|
||||||
private:
|
|
||||||
int _screen_num;
|
int _screen_num;
|
||||||
|
|
||||||
std::string _fontstring;
|
std::string _fontstring;
|
||||||
|
|
Loading…
Reference in a new issue