aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/XftFontImp.cc
diff options
context:
space:
mode:
authormathias <mathias>2005-06-03 07:25:48 (GMT)
committermathias <mathias>2005-06-03 07:25:48 (GMT)
commitef76b45ab1857af1b12f0c336bfb8c0f19140aeb (patch)
treee380d87f9e4c5e1b27f7aeb8d3aa8acbe0e09d2c /src/FbTk/XftFontImp.cc
parent9c27e2e7993c9ccd604f77219a1f07c1be22e75a (diff)
downloadfluxbox-ef76b45ab1857af1b12f0c336bfb8c0f19140aeb.zip
fluxbox-ef76b45ab1857af1b12f0c336bfb8c0f19140aeb.tar.bz2
- Usage of xft-fonts is prefered, except a font-description starts with '-'
- Removed "antialias"-option completly, to enable/disable "antialias" use either <fontname>:antialias=<bool> in the style or use Xft.antialias: <bool> in your .Xdefaults - Added new styleresources: *.font.effect: <halo|shadow> *.font.shadow.x : <int> - shadow x offset *.font.shadow.y : <int> - shadow y offset *.font.shadow.color : <color> - color of shadow *.font.halo.color : <color> - color of halo - Removed 'shadow' and 'halo' options from fontdefinitions: !! Style authors have to update their styles !! - Simplified XmbFontImp to not try all possible fonts to match locale - Style authors may specify multiple fonts: <font1>|<font2>|<font3> if loading of font1 fails, fluxbox probes <font2>, etc. The last font is "fixed". Hints for style authors: - if xft tries to load a font it will _ALWAYS_ return a valid font, it doesnt have to look like the one you want to have, read more about it: http://fontconfig.org/fontconfig-user.html - export XFT_DEBUG=1 before running fluxbox helps to see which fonts are picked. eg: *.font: Verdana,Arial-12:antialias=true|-artwiz-snap-*- if fluxbox is compiled with xft this will NEVER try to load "-artwiz-snap-*-" since xft gives for sure a font, most likely Verdana or Arial but noone knows. So, if fluxbox has no xft support the first fontpattern fails and fluxbox tries the next one, which might be successful. if everything fails, it will use "fixed" - Added caching of fonts, fonts are only loaded once. - Fixed #1090902 (slow utf8 start)
Diffstat (limited to 'src/FbTk/XftFontImp.cc')
-rw-r--r--src/FbTk/XftFontImp.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc
index 1d13900..715b130 100644
--- a/src/FbTk/XftFontImp.cc
+++ b/src/FbTk/XftFontImp.cc
@@ -33,7 +33,6 @@ namespace FbTk {
33 33
34XftFontImp::XftFontImp(const char *name, bool utf8):m_xftfont(0), 34XftFontImp::XftFontImp(const char *name, bool utf8):m_xftfont(0),
35 m_utf8mode(utf8) { 35 m_utf8mode(utf8) {
36
37 if (name != 0) 36 if (name != 0)
38 load(name); 37 load(name);
39} 38}
@@ -47,13 +46,14 @@ bool XftFontImp::load(const std::string &name) {
47 //Note: assumes screen 0 for now, changes on draw if needed 46 //Note: assumes screen 0 for now, changes on draw if needed
48 47
49 Display *disp = App::instance()->display(); 48 Display *disp = App::instance()->display();
50 XftFont *newxftfont = XftFontOpenName(disp, 0, name.c_str());
51 49
52 if (newxftfont == 0) { // failed to open font, lets test with XLFD 50 XftFont *newxftfont = XftFontOpenXlfd(disp, 0, name.c_str());
53 newxftfont = XftFontOpenXlfd(disp, 0, name.c_str()); 51 if (newxftfont == 0) {
52 newxftfont = XftFontOpenName(disp, 0, name.c_str());
54 if (newxftfont == 0) 53 if (newxftfont == 0)
55 return false; 54 return false;
56 } 55 }
56
57 // destroy old font and set new 57 // destroy old font and set new
58 if (m_xftfont != 0) 58 if (m_xftfont != 0)
59 XftFontClose(disp, m_xftfont); 59 XftFontClose(disp, m_xftfont);