summaryrefslogtreecommitdiff
path: root/src/FbTk/XftFontImp.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2007-01-05 13:01:19 (GMT)
committersimonb <simonb>2007-01-05 13:01:19 (GMT)
commit3a79de034f87df155f540af2186c5d87dc187b3b (patch)
tree9352aebc02ecc46ec475e1a2764c8f39cd732453 /src/FbTk/XftFontImp.cc
parent87b8626793e25a8ab4b1e077fcf29cb06ff7f71c (diff)
downloadfluxbox_lack-3a79de034f87df155f540af2186c5d87dc187b3b.zip
fluxbox_lack-3a79de034f87df155f540af2186c5d87dc187b3b.tar.bz2
change default Xft font so that it works properly with rotation (see
notes in ChangeLog or FbTk/Font.cc)
Diffstat (limited to 'src/FbTk/XftFontImp.cc')
-rw-r--r--src/FbTk/XftFontImp.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/FbTk/XftFontImp.cc b/src/FbTk/XftFontImp.cc
index 40b9b9e..5acf0af 100644
--- a/src/FbTk/XftFontImp.cc
+++ b/src/FbTk/XftFontImp.cc
@@ -63,8 +63,10 @@ bool XftFontImp::load(const std::string &name) {
63 63
64 // destroy all old fonts and set new 64 // destroy all old fonts and set new
65 for (int r = ROT0; r <= ROT270; r++) 65 for (int r = ROT0; r <= ROT270; r++)
66 if (m_xftfonts[r] != 0) 66 if (m_xftfonts[r] != 0) {
67 XftFontClose(App::instance()->display(), m_xftfonts[r]); 67 XftFontClose(App::instance()->display(), m_xftfonts[r]);
68 m_xftfonts[r] = 0;
69 }
68 70
69 m_xftfonts[ROT0] = newxftfont; 71 m_xftfonts[ROT0] = newxftfont;
70 m_name = name; 72 m_name = name;
@@ -73,6 +75,7 @@ bool XftFontImp::load(const std::string &name) {
73} 75}
74 76
75void XftFontImp::drawText(const FbDrawable &w, int screen, GC gc, const FbString &text, size_t len, int x, int y, FbTk::Orientation orient) const { 77void XftFontImp::drawText(const FbDrawable &w, int screen, GC gc, const FbString &text, size_t len, int x, int y, FbTk::Orientation orient) const {
78
76 if (m_xftfonts[orient] == 0) 79 if (m_xftfonts[orient] == 0)
77 return; 80 return;
78 81
@@ -223,11 +226,10 @@ bool XftFontImp::validOrientation(FbTk::Orientation orient) {
223 Display *disp = App::instance()->display(); 226 Display *disp = App::instance()->display();
224 227
225 XftPattern * pattern = XftNameParse(m_name.c_str()); 228 XftPattern * pattern = XftNameParse(m_name.c_str());
226 XftPatternAddMatrix(pattern, XFT_MATRIX, &matrix);
227 XftResult result; 229 XftResult result;
228 XftPattern * foundpat = XftFontMatch(disp, 0, pattern, &result); 230 pattern = XftFontMatch(disp, 0, pattern, &result);
229 XftPatternDestroy(pattern); 231 XftPatternAddMatrix(pattern, XFT_MATRIX, &matrix);
230 XftFont * new_font = XftFontOpenPattern(disp, foundpat); 232 XftFont * new_font = XftFontOpenPattern(disp, pattern);
231 233
232 if (new_font == 0) 234 if (new_font == 0)
233 return false; 235 return false;