1 diff -ur fltk-1.1.x-r5917.o/config.h fltk-1.1.x-r5917/config.h
2 --- fltk-1.1.x-r5917.o/config.h 2007-06-29 21:08:29.000000000 +0300
3 +++ fltk-1.1.x-r5917/config.h 2007-06-29 21:08:57.000000000 +0300
11 * End of "$Id: configh.in 5678 2007-02-08 20:14:30Z mike $".
13 diff -ur fltk-1.1.x-r5917.o/fluid/fluid.cxx fltk-1.1.x-r5917/fluid/fluid.cxx
14 --- fltk-1.1.x-r5917.o/fluid/fluid.cxx 2007-02-20 20:43:10.000000000 +0200
15 +++ fltk-1.1.x-r5917/fluid/fluid.cxx 2007-06-29 21:09:27.000000000 +0300
16 @@ -2170,8 +2170,11 @@
22 int main(int argc,char **argv) {
24 + setlocale(LC_ALL, "");
25 if (!Fl::args(argc,argv,i,arg) || i < argc-1) {
26 fprintf(stderr,"usage: %s <switches> name.fl\n"
27 " -c : write .cxx and .h and exit\n"
28 diff -ur fltk-1.1.x-r5917.o/src/fl_font_xft.cxx fltk-1.1.x-r5917/src/fl_font_xft.cxx
29 --- fltk-1.1.x-r5917.o/src/fl_font_xft.cxx 2006-10-30 16:16:08.000000000 +0200
30 +++ fltk-1.1.x-r5917/src/fl_font_xft.cxx 2007-06-29 21:11:57.000000000 +0300
33 XFontStruct* fl_xfont = 0;
35 -const char* fl_encoding_ = "iso8859-1";
36 +const char* fl_encoding_ = "koi8-r";
37 Fl_FontSize* fl_fontsize = 0;
39 void fl_font(int fnum, int size) {
48 +#include <langinfo.h>
51 +extern iconv_t iconv_cd;
55 double fl_width(const char *str, int n) {
56 if (!current_font) return -1.0;
59 + size_t insize = n, avail = insize * 2 + 128, t = avail;
60 + char *inptr = (char *)str, *outptr = new char[avail], *out_orig = outptr;
62 + Fl::fatal("iconv: unsufficient memory !");
63 + //iconv (iconv_cd, NULL, NULL, &outptr, &t);
65 + size_t nconv = iconv (iconv_cd, &inptr, &insize, &outptr, &avail);
66 + if (nconv == (size_t) -1)
67 + Fl::fatal("iconv error: %s (%s)", strerror(errno), str);
68 + XftTextExtentsUtf8(fl_display, current_font, (XftChar8 *)out_orig,
72 XftTextExtents8(fl_display, current_font, (XftChar8 *)str, n, &i);
78 color.color.green = ((int)g)*0x101;
79 color.color.blue = ((int)b)*0x101;
80 color.color.alpha = 0xffff;
82 - XftDrawString8(draw, &color, current_font, x, y, (XftChar8 *)str, n);
84 + size_t insize = n, avail = insize * 2 + 128, t = avail;
85 + char *inptr = (char *)str, *outptr = new char[avail], *out_orig = outptr;
87 + Fl::fatal("iconv: unsufficient memory !");
88 + // iconv (iconv_cd, NULL, NULL, &outptr, &t);
90 + size_t nconv = iconv (iconv_cd, &inptr, &insize, &outptr, &avail);
91 + if (nconv == (size_t) -1)
92 + Fl::fatal("iconv error: %s (%s)", strerror(errno), str);
93 + XftDrawStringUtf8(draw, &color, current_font, x, y,
94 + (XftChar8 *)out_orig, t - avail);
97 + XftDrawString8(draw, &color, current_font, x, y, (XftChar8 *)str, n);
101 void fl_draw(const char* str, int n, float x, float y) {
102 diff -ur fltk-1.1.x-r5917.o/src/Fl_x.cxx fltk-1.1.x-r5917/src/Fl_x.cxx
103 --- fltk-1.1.x-r5917.o/src/Fl_x.cxx 2007-06-18 16:08:57.000000000 +0300
104 +++ fltk-1.1.x-r5917/src/Fl_x.cxx 2007-06-29 21:13:09.000000000 +0300
107 # include <sys/time.h>
112 +#include <langinfo.h>
118 ////////////////////////////////////////////////////////////////
119 // interface to poll/select call:
121 @@ -360,11 +369,25 @@
126 +// Fl::warning("Code page for iconv is set to \"%s\"", nl_langinfo(CODESET));
127 + iconv_cd = iconv_open ("UTF8", nl_langinfo(CODESET));
128 + if (iconv_cd == (iconv_t) -1) {
129 + if (errno == EINVAL)
130 + Fl::fatal("conversion from \'%s\' to UTF8 not available",
131 + nl_langinfo(CODESET));
133 + Fl::fatal("iconv_open: %s", strerror(errno));
138 void fl_close_display() {
139 Fl::remove_fd(ConnectionNumber(fl_display));
140 XCloseDisplay(fl_display);
142 + iconv_close (iconv_cd);
146 static int fl_workarea_xywh[4] = { -1, -1, -1, -1 };