Lines 22-27
Link Here
|
22 |
//$Id: XftFontImp.cc,v 1.2 2002/12/01 13:42:15 rathnor Exp $ |
22 |
//$Id: XftFontImp.cc,v 1.2 2002/12/01 13:42:15 rathnor Exp $ |
23 |
|
23 |
|
24 |
#include "XftFontImp.hh" |
24 |
#include "XftFontImp.hh" |
|
|
25 |
#include "StringUtil.hh" |
25 |
#include "App.hh" |
26 |
#include "App.hh" |
26 |
|
27 |
|
27 |
#ifdef HAVE_CONFIG_H |
28 |
#ifdef HAVE_CONFIG_H |
Lines 98-112
Link Here
|
98 |
m_xftfont, |
99 |
m_xftfont, |
99 |
x, y, |
100 |
x, y, |
100 |
(XftChar8 *)(text), len); |
101 |
(XftChar8 *)(text), len); |
101 |
} else |
102 |
} else { |
|
|
103 |
char *utf8_text = StringUtil::locale_to_utf8(text); |
104 |
int utf8_len = strlen(utf8_text); |
105 |
XftDrawStringUtf8(draw, |
106 |
&xftcolor, |
107 |
m_xftfont, |
108 |
x, y, |
109 |
(XftChar8 *)(utf8_text), utf8_len); |
110 |
delete [] utf8_text; |
111 |
} |
112 |
#else |
113 |
XftDrawString8(draw, |
114 |
&xftcolor, |
115 |
m_xftfont, |
116 |
x, y, |
117 |
(XftChar8 *)(text), len); |
102 |
#endif // HAVE_XFT_UTF8_STRING |
118 |
#endif // HAVE_XFT_UTF8_STRING |
103 |
{ |
|
|
104 |
XftDrawString8(draw, |
105 |
&xftcolor, |
106 |
m_xftfont, |
107 |
x, y, |
108 |
(XftChar8 *)(text), len); |
109 |
} |
110 |
|
119 |
|
111 |
XftColorFree(disp, DefaultVisual(disp, screen), |
120 |
XftColorFree(disp, DefaultVisual(disp, screen), |
112 |
DefaultColormap(disp, screen), &xftcolor); |
121 |
DefaultColormap(disp, screen), &xftcolor); |
Lines 123-136
Link Here
|
123 |
m_xftfont, |
132 |
m_xftfont, |
124 |
(XftChar8 *)text, len, |
133 |
(XftChar8 *)text, len, |
125 |
&ginfo); |
134 |
&ginfo); |
126 |
} else |
135 |
} else { |
|
|
136 |
char *utf8_text = StringUtil::locale_to_utf8(text); |
137 |
len = strlen(utf8_text); |
138 |
XftTextExtentsUtf8(App::instance()->display(), |
139 |
m_xftfont, |
140 |
(XftChar8 *)utf8_text, len, |
141 |
&ginfo); |
142 |
delete [] utf8_text; |
143 |
} |
144 |
#else |
145 |
XftTextExtents8(App::instance()->display(), |
146 |
m_xftfont, |
147 |
(XftChar8 *)text, len, |
148 |
&ginfo); |
127 |
#endif //HAVE_XFT_UTF8_STRING |
149 |
#endif //HAVE_XFT_UTF8_STRING |
128 |
{ |
|
|
129 |
XftTextExtents8(App::instance()->display(), |
130 |
m_xftfont, |
131 |
(XftChar8 *)text, len, |
132 |
&ginfo); |
133 |
} |
134 |
return ginfo.xOff; |
150 |
return ginfo.xOff; |
135 |
} |
151 |
} |
136 |
|
152 |
|