Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 22362 Details for
Bug 36004
updated xft patch for fluxbox-0.9.6.ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fluxbox-0.9.6-xft.patch
fluxbox-0.9.6-xft.patch (text/plain), 3.17 KB, created by
Mamoru KOMACHI (RETIRED)
on 2003-12-17 09:13:22 UTC
(
hide
)
Description:
fluxbox-0.9.6-xft.patch
Filename:
MIME Type:
Creator:
Mamoru KOMACHI (RETIRED)
Created:
2003-12-17 09:13:22 UTC
Size:
3.17 KB
patch
obsolete
>diff -Naru fluxbox-0.9.6.org/src/FbTk/XftFontImp.cc fluxbox-0.9.6/src/FbTk/XftFontImp.cc >--- fluxbox-0.9.6.org/src/FbTk/XftFontImp.cc 2002-12-01 13:42:15.000000000 +0000 >+++ fluxbox-0.9.6/src/FbTk/XftFontImp.cc 2003-11-20 19:50:43.000000000 +0000 >@@ -24,11 +24,45 @@ > #include "XftFontImp.hh" > #include "App.hh" > >+#include <langinfo.h> >+#include <iconv.h> >+#include <errno.h> >+ > #ifdef HAVE_CONFIG_H > #include "config.h" > #endif //HAVE_CONFIG_H > namespace FbTk { > >+ extern "C" { >+ >+ static char * locale_to_utf8 (const char *text) >+ { >+ char *loc; >+ char *utf_str, *from, *to; >+ static iconv_t conv = (iconv_t)-1; >+ size_t from_len, to_len; >+ size_t r; >+ if (conv == (iconv_t)-1) { >+ loc = (char *)strdup (nl_langinfo (CODESET)); >+ conv = iconv_open ("UTF-8", loc); >+ free (loc); >+ } >+ from = (char *)text; >+ from_len = strlen (text); >+ to_len = from_len * 6 + 1; >+ utf_str = to = (char *)malloc ((sizeof (char)) * from_len * 6 + 1); >+ r = iconv (conv, &from, &from_len, &to, &to_len); >+ // success or incomplete sequence >+ if (r != (size_t)-1 || errno == EINVAL) { >+ *to = '\0'; >+ utf_str = (char *)realloc (utf_str, strlen (utf_str) + 1); >+ return utf_str; >+ } >+ free (utf_str); >+ return strdup (text); >+ } >+ } >+ > XftFontImp::XftFontImp(const char *name, bool utf8):m_xftfont(0), > m_utf8mode(utf8) { > if (name != 0) >@@ -98,15 +132,25 @@ > m_xftfont, > x, y, > (XftChar8 *)(text), len); >- } else >-#endif // HAVE_XFT_UTF8_STRING >- { >+ } else { >+ char *utf_str = locale_to_utf8 (text); >+ size_t utf_len = strlen (utf_str); >+ XftDrawStringUtf8(draw, >+ &xftcolor, >+ m_xftfont, >+ x, y, >+ (XftChar8 *)(utf_str), utf_len); >+ free (utf_str); >+ } >+#else >+ { > XftDrawString8(draw, > &xftcolor, > m_xftfont, > x, y, > (XftChar8 *)(text), len); > } >+#endif // HAVE_XFT_UTF8_STRING > > XftColorFree(disp, DefaultVisual(disp, screen), > DefaultColormap(disp, screen), &xftcolor); >@@ -123,14 +167,26 @@ > m_xftfont, > (XftChar8 *)text, len, > &ginfo); >- } else >-#endif //HAVE_XFT_UTF8_STRING >+ } else { >+ char *tmp = strdup(text); >+ tmp[len] = '\0'; >+ char *utf_str = locale_to_utf8 (tmp); >+ size_t utf_len = strlen (utf_str); >+ XftTextExtentsUtf8(App::instance()->display(), >+ m_xftfont, >+ (XftChar8 *)utf_str, utf_len, >+ &ginfo); >+ free (utf_str); >+ free (tmp); >+ } >+#else > { > XftTextExtents8(App::instance()->display(), > m_xftfont, > (XftChar8 *)text, len, > &ginfo); > } >+#endif //HAVE_XFT_UTF8_STRING > return ginfo.xOff; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 36004
:
22360
| 22362 |
23640