|
Lines 284-290
Link Here
|
| 284 |
XGlyphInfo extents; |
284 |
XGlyphInfo extents; |
| 285 |
char str1[100]; |
285 |
char str1[100]; |
| 286 |
char *ps, *ps1; |
286 |
char *ps, *ps1; |
| 287 |
int l1, l2; |
287 |
size_t l1, l2; |
| 288 |
|
288 |
|
| 289 |
if (!xftFont) |
289 |
if (!xftFont) |
| 290 |
return 0; |
290 |
return 0; |
|
Lines 294-300
Link Here
|
| 294 |
ps = str1; |
294 |
ps = str1; |
| 295 |
ps1 = str; |
295 |
ps1 = str; |
| 296 |
|
296 |
|
| 297 |
l1 = iconv (convUTF8, (char **) &str, &l1, &ps, &l2); |
297 |
l1 = iconv (convUTF8, (const char **) &str, &l1, &ps, &l2); |
| 298 |
*ps = '\0'; |
298 |
*ps = '\0'; |
| 299 |
XftTextExtentsUtf8 (dpy, xftFont, str1, strlen (str1), &extents); |
299 |
XftTextExtentsUtf8 (dpy, xftFont, str1, strlen (str1), &extents); |
| 300 |
return extents.width; |
300 |
return extents.width; |
|
Lines 323-329
Link Here
|
| 323 |
void OutputString (Window window, char *str, int x, int y, XColor color) |
323 |
void OutputString (Window window, char *str, int x, int y, XColor color) |
| 324 |
{ |
324 |
{ |
| 325 |
char strOutput[100] = ""; //该长度应该够用了 |
325 |
char strOutput[100] = ""; //该长度应该够用了 |
| 326 |
int l1, l2; |
326 |
size_t l1, l2; |
| 327 |
char *ps; |
327 |
char *ps; |
| 328 |
XftColor xftColor; |
328 |
XftColor xftColor; |
| 329 |
XRenderColor renderColor; |
329 |
XRenderColor renderColor; |
|
Lines 339-345
Link Here
|
| 339 |
l2 = 99; |
339 |
l2 = 99; |
| 340 |
ps = strOutput; |
340 |
ps = strOutput; |
| 341 |
|
341 |
|
| 342 |
l1 = iconv (convUTF8, (char **) (&str), &l1, &ps, &l2); |
342 |
l1 = iconv (convUTF8, (const char **) (&str), &l1, &ps, &l2); |
| 343 |
|
343 |
|
| 344 |
renderColor.red = color.red; |
344 |
renderColor.red = color.red; |
| 345 |
renderColor.green = color.green; |
345 |
renderColor.green = color.green; |