Re: font problems
Dan McMahill wrote: > The unicode character there is a lower case greek epsilon. When I print > to PDF, that character is clearly bitmapped and looks ugly compared to > the rest of the text. When I send to my postscript printer, it (the > epsilon) doesn't even come out. > > When I do the same from a win32 build, the printed character looks > pretty good as do upper and lower case delta and rho. > > Is there a better way to use greek letters for variables or mathematical > symbols? Is there a more standard (portable across all expected > platforms) way I should get a font? Hi Dan, What you do is correct. It's just that your Linux system doesn't seem to have good fonts covering the Greek letters. If the bitmap doesn't come out, well, that's a bug. Anyway, try installing the DejaVu fonts. Cheers, behdad > Thanks > -Dan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk treeview windows
On Thu, Feb 5, 2009 at 4:38 AM, Tor Lillqvist wrote: > > > I would appreciate any suggestions as to how to debug this further. > > Write a minimal sample program that exhibits the problem, file a bug, > and attach the sample program (as a single source file in C; no > binaries, not zip archives, no makefiles) to the bug. > > -tml Not trying to be offensive, but if I could reproduce this every time, I wouldn't be asking for debugging suggestions. Anyone have any idea of things I could look at, test, etc? Matthew ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
font problems
Hello, I have just converted a program of mine to use gtk_print and cairo+pango for printing instead of my 10 year old hand coded postscript output. I'm mostly happy with the results, very happy to get printing working under win32 as well, but am having a font problem. I am selecting a font with desc = pango_font_description_from_string("serif"); pango_font_description_set_size(desc, font_size*PANGO_SCALE); pango_layout_set_font_description(layout, desc); My english text coming out to a pdf file or to my postscript printer looks great. But I have a few greek characters here and there. For example pango_layout_set_markup(layout, "Relative dielectric constant, \316\264r = 3.8", -1); The unicode character there is a lower case greek epsilon. When I print to PDF, that character is clearly bitmapped and looks ugly compared to the rest of the text. When I send to my postscript printer, it (the epsilon) doesn't even come out. When I do the same from a win32 build, the printed character looks pretty good as do upper and lower case delta and rho. Is there a better way to use greek letters for variables or mathematical symbols? Is there a more standard (portable across all expected platforms) way I should get a font? Thanks -Dan ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: i18n, intltool problems
On Thu, 5 Feb 2009 14:05:04 -0200 John Coppens wrote: > During several tests, I came across the famous "your intltool is too > old. You need intltool 0.35.0 or newer". I have 0.40.5 installed, as > shown by: > > $ intltool-update --version > intltool-update (intltool) 0.40.5 Solved this one partially... There was another intltool.m4 laying around which contained the wrong macro. Now the test succeeds, but I get: Syntax error near unexpected token '0.35.0'. The corresponding line in the configure script is: IT_PROG_INTLTOOL([0.35.0]) Suggestions? John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
- Original Message - From: "Tor Lillqvist" As far as I know, distributing .la files is not a good idea. You don't see any .la files being distributed in devel packages on Linux either. That's odd. my Linux tree is full of them (64studio). Well over 500 and many are quite recent (only a few months old) so I guess they've come via Synaptic. That's mostly how I install new libraries in 64studio. John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
> On the subject of libtool, I've noticed that none of the gtk-win32 libraries > and dependencies that I've loaded (so far) have included the ".la" files > that I'm used to seeing with package installations from other sources. As far as I know, distributing .la files is not a good idea. You don't see any .la files being distributed in devel packages on Linux either. --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
It looks like libgnomecanvas was indeed the problem here. After upgrading it and adding intl.dll, the program now works as expected. - Original Message - From: "Tor Lillqvist" The intl.dll is what would otherwise have been called libintl-8.dll when built by libtool, but I build it as intl.dll to keep backward compatibility with older versions of gettext where the official way to build for Windows was with MSVC, and that process produced a DLL called intl.dll. On the subject of libtool, I've noticed that none of the gtk-win32 libraries and dependencies that I've loaded (so far) have included the ".la" files that I'm used to seeing with package installations from other sources. I just wondered if there's a reason for them not being included. John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
> When I try to run that same program, Windows tells me > that it cannot proceed because "intl.dll" isn't installed (note: > "intl.dll" - not "libintl.dll"). intl.dll is in the gettext package on the download page. > Is it expecting libintl, The intl.dll is what would otherwise have been called libintl-8.dll when built by libtool, but I build it as intl.dll to keep backward compatibility with older versions of gettext where the official way to build for Windows was with MSVC, and that process produced a DLL called intl.dll. > or maybe proxy-libintl proxy-libintl doesn't have any DLL at all, just a static library. (Stuff that is linked with that static library don't depend on intl.dll, they just check if it is available at run-time, but if it isn't they fail gracefully back to no localisations.) > or is it expecting intltool intltool is something completely different. It is used only when building some software packages. --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GdkBitmap from black & white .png file
On Thu, 2009-02-05 at 16:20 +, gtk-app-devel-list-requ...@gnome.org wrote: > There are functions to convert a PNG with transparency (alpha component) > to a GdkBitmap according to a threshold. See > gdk_pixbuf_render_threshold_alpha() > http://library.gnome.org/devel/gdk/stable/gdk-Pixbufs.html#gdk-pixbuf-render-threshold-alpha > Thank you for this - I have now taken the this approach - adding an alpha channel to a pixbuf created from the .png and then going to xbm format and finally to the GdkBitmap. Richard Shann ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
Thanks again, Tor. I seem to be making progress but after installing libgnomecanvas I've hit another brick wall. When I try to run that same program, Windows tells me that it cannot proceed because "intl.dll" isn't installed (note: "intl.dll" - not "libintl.dll"). Sorry to be a pest but I'm not sure what to install next. Is it expecting libintl, or maybe proxy-libintl from the original download page (http://www.gtk.org/download-windows.html) or is it expecting intltool (from this page - http://ftp.acc.umu.se/pub/GNOME/binaries/win32/intltool/) or something completely different??? John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GdkBitmap from black & white .png file
Le samedi 31 janvier 2009 à 20:11 +, Richard Shann a écrit : > The Gdk functions to create bitmaps from data require xbm or xpm data. > (For example gdk_bitmap_create_from_data ()). Why do I not see anything > to create a bitmap from a (b&w) .png image? There are functions to convert a PNG with transparency (alpha component) to a GdkBitmap according to a threshold. See gdk_pixbuf_render_threshold_alpha() http://library.gnome.org/devel/gdk/stable/gdk-Pixbufs.html#gdk-pixbuf-render-threshold-alpha BTW, here is a function (not tested) adapted from some code I wrote, which should create a GdkBitmap from a GdkPixbuf according to your black and white PNG. Feel free to test and fix it. /* * Author: Yann Droneaud * */ GdkBitmap * my_gdk_bitmap_new_from_pixbuf_non_alpha(GdkDrawable *drawable, GdkPixbuf *pixbuf) { int width; int height; int rowstride; guchar *pixels; guint32 pixel; gchar *bitmap_data; int bitmap_rowstride; GdkBitmap *bitmap; g_assert(pixbuf != NULL); g_assert(gdk_pixbuf_get_colorspace(pixbuf) == GDK_COLORSPACE_RGB); g_assert(gdk_pixbuf_get_bits_per_sample(pixbuf) == 8); g_assert(gdk_pixbuf_get_has_alpha(pixbuf)); g_assert(gdk_pixbuf_get_n_channels(pixbuf) == 4); width = gdk_pixbuf_get_width(pixbuf); height = gdk_pixbuf_get_height(pixbuf); rowstride = gdk_pixbuf_get_rowstride(pixbuf); pixels = gdk_pixbuf_get_pixels(pixbuf); /* round to byte boundary */ bitmap_rowbytes = (width + 7) / 8; /* allocate a *cleared* buffer for the bitmap data */ bitmap_data = (gchar *) g_malloc0(bitmap_rowbytes * height); g_assert(bitmap_data != NULL); for(y = 0; y < height; y++) { for(x = 0; x < width; x++) { /* WARNING: use 4 components, 8 bits per component */ pixel = * (guint32 *) &pixels[(y * rowbytes) + (x * 4)]; /* remove alpha component * WARNING: beware of endianess */ pixel &= (guint32) 0xff00UL; /* if not black, it should be white */ if (pixel != (guint32)0UL) { bitmap_data[(y * bitmap_rowbytes) + (x / 8)] |= 1 << (x % 8); } } } bitmap = gdk_bitmap_create_from_data(drawable, bitmap_data, width, height); g_free(bitmap_data); return bitmap; } ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
i18n, intltool problems
Hello people. Previously developping mainly with glade1 and glade2, glade3 now requires to write the code separately. This made me look into Anjuta and other alternatives. During several tests, I came across the famous "your intltool is too old. You need intltool 0.35.0 or newer". I have 0.40.5 installed, as shown by: $ intltool-update --version intltool-update (intltool) 0.40.5 I traced the problem to the configure test, where it tests for the version of intltool, by reading the contents of intltool-update.in where $VERSION appears. But in those cases where the test fails, that file was either non-existent or empty (in the case of auto-generated files, eg. when making a new project in Anjuta). I tried to follow the i19n-howto in the intltool package, but I have the impression that it is hopelessly outdated. I tried to find out where the problems lie, solved some, but finally got stuck. Questions: 1) Anyone know how to get the 0.35.0 version problem solved? Is there a new m4 macro to test for that version? 2) Is there an up-to-date Howto for the entire aclocal/automake/intltool etc workflow? Maybe publish the original on the list and everyone add modifications to get it working again? Thanks in advance... John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
> I am, because I get a runtime error if I don;t use > that flag - even though I'm not linking to any Microsoft libraries. Is that > normal? The run-time error is intentional, to make sure that you did use the switch. Whether you link to Microsoft libraries or not is not relevant here. What's relevant is that as the switch has been used when compiling GTK+ itself, it must also be used when compiling GTK+-using code so that it uses the same alignment rules for struct bitfields. The reason why the switch is used when compiling GTK+ itself is so that the produced binaries are usable from code compiled with Microsoft's compiler. (Which always uses the alignment rules that gcc needs the switch for. Why that switch isn't the default for mingw I don't know, but of course this can't be changed any more now.) > libgnomecanvas-2 isn't listed and > I think I might have an old (incompatible) one still present. Should > libgnomecanvas-2 have been installed by one of the other packages or do I > need to obtain it from somewhere else? The latest one is 2.20.1-1 available at http://ftp.gnome.org/pub/GNOME/binaries/win32/libgnomecanvas/2.20/ . It's always a good idea to check the GNOME ftp site for Win32 binaries. The download page might not always be completely up-to-date. When I run your test program with a PATH that makes it use the latest Win32 DLLs for the GNOME stack, their full paths are as in the following gdb printout. The pathnames contain the package versions. (This is just a convention I use to keep unpacked copies of the zip files, not some convention I would recommend others to follow) (gdb) i dll >FromTo Syms Read Shared Object Library ... 0x63a41000 0x63a7b550 Yes c:\devel\dist\win32\glib-2.18.4-1\bin\libgobject-2.0-0.dll 0x685c1000 0x6869ad84 Yes c:\devel\dist\win32\glib-2.18.4-1\bin\libglib-2.0-0.dll ... 0x61781000 0x61b3779c Yes c:\devel\dist\win32\gtk+-2.14.7-1\bin\libgtk-win32-2.0-0.dll 0x65341000 0x6535ba7c Yes c:\devel\dist\win32\gtk+-2.14.7-1\bin\libgdk_pixbuf-2.0-0.dll 0x6d581000 0x6d5cd974 Yes c:\devel\dist\win32\glib-2.18.4-1\bin\libgio-2.0-0.dll 0x6dd01000 0x6dd0921c Yes c:\devel\dist\win32\glib-2.18.4-1\bin\libgmodule-2.0-0.dll 0x6c341000 0x6c3e2924 Yes c:\devel\dist\win32\gtk+-2.14.7-1\bin\libgdk-win32-2.0-0.dll 0x68dc1000 0x68e6347c Yes c:\devel\dist\win32\cairo-1.8.6-1\bin\libcairo-2.dll 0x69c81000 0x69cad9d4 Yes c:\devel\dist\win32\libpng-1.2.34-1\bin\libpng12-0.dll 0x10001000 0x1001134c Yes c:\devel\dist\win32\zlib-1.2.3\bin\zlib1.dll ... 0x65581000 0x655bf850 Yes c:\devel\dist\win32\pango-1.22.4-1\bin\libpango-1.0-0.dll 0x6d4c1000 0x6d4cd410 Yes c:\devel\dist\win32\pango-1.22.4-1\bin\libpangocairo-1.0-0.dll 0x6b281000 0x6b2927c0 Yes c:\devel\dist\win32\pango-1.22.4-1\bin\libpangowin32-1.0-0.dll ... 0x62941000 0x6295cea8 Yes c:\devel\dist\win32\atk-1.24.0-1\bin\libatk-1.0-0.dll ... 0x63f41000 0x63f6e750 Yes c:\devel\dist\win32\libgnomecanvas-2.20.1\bin\libgnomecanvas-2-0.dll 0x6a181000 0x6a18b254 Yes c:\devel\dist\win32\gtk+-2.14.7-1\bin\libgailutil-18.dll 0x655c1000 0x655d7358 Yes c:\devel\dist\win32\libart-lgpl-2.3.20\bin\libart_lgpl_2-2.dll 0x6d701000 0x6d734b80 Yes c:\devel\dist\win32\pango-1.22.4-1\bin\libpangoft2-1.0-0.dll 0x64f81000 0x64faffa4 Yes c:\devel\dist\win32\fontconfig-2.6.0-2\bin\libfontconfig-1.dll 0x68f41000 0x68f62064 Yes c:\devel\dist\win32\expat-2.0.1-1\bin\libexpat-1.dll 0x67cc1000 0x67d33590 Yes c:\devel\dist\win32\freetype-2.3.8-1\bin\freetype6.dll 0x69001000 0x69016d8c Yes c:\devel\dist\win32\gettext-runtime-0.17-1\bin\intl.dll ... --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
I think I might have figured this out (it's just a theory at the moment though). Here's the page that I used for installing gtk-win32:- http://www.gtk.org/download-windows.html I installed most of the libraries shown except for a few that I don't have installed anyway, like libexpat. However, libgnomecanvas-2 isn't listed and I think I might have an old (incompatible) one still present. Should libgnomecanvas-2 have been installed by one of the other packages or do I need to obtain it from somewhere else? John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
Oops, sorry Tor - I guess I should have copied and pasted instead of typing this out manually. In fact I had carried out the initialisation but slightly differently. This is how the real code looked (copied and pasted, this time) #include int main (int argc, char *argv[]) { gtk_init (&argc, &argv); GTypeQuery base_query = { 0, 0, 0, 0, }; g_type_query(gnome_canvas_get_type(), &base_query); return(0); } Note that I carried out my initialisation slightly differently. I just added 'g_type_init();' immediately after gtk_init() but it didn't make any difference (presumably, gtk_init() was already doing this). Having said all that, I still can't get the code to work, even with the extra initialisation. Just out of interest Tor, are you using the compiler option -mms-bitfields? I am, because I get a runtime error if I don;t use that flag - even though I'm not linking to any Microsoft libraries. Is that normal? John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: g_type_query in gtk-win32
> Here's a very simple program that illustrates the problem:- When I add the missing semicolon, compile, and run the program, I get a lot of error messages, the first (and most relevant) being: (johne53-1.exe:2264): GLib-GObject-CRITICAL **: gtype.c:2458: initialization assertion failed, use g_type_init() prior to this function When I do what the error message says and add a call to g_type_init(), it works fine as far as I can see. base_query contains: (gdb) p base_query $1 = {type = 37258472, type_name = 0x2388590 "GnomeCanvas", class_size = 464, instance_size = 312} --tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
g_type_query in gtk-win32
I'm trying to port a program which previously used gtk-x11 so that it will work with gtk-win32. For the past day or two I've had a very strange problem with the program crashing unexpectedly. Finally I tracked it down to a problem with the function call g_type_query() Here's a very simple program that illustrates the problem:- #include int main (int argc, char *argv[]) { GTypeQuery base_query = { 0, 0, 0, 0, }; g_type_query(gnome_canvas_get_type(), &base_query); return 0 } 'base_query' is initialised to NULL. When I call 'g_type_query(...)' (linked to gtk-x11) the various fields of 'base_query' get filled with approriate data. However, if I build the same program when linked to gtk-win32, the call to 'g_type_query()' simply fails to do anything, leaving 'base_query' uninitiaised. Please could someone try the above code and let me know if this is a general problem - or whether there's something peculiar with my installation? Many thanks, John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: gtk treeview windows
> I would appreciate any suggestions as to how to debug this further. Write a minimal sample program that exhibits the problem, file a bug, and attach the sample program (as a single source file in C; no binaries, not zip archives, no makefiles) to the bug. -tml ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
gtk treeview windows
Hi all, I am a developer for Xiphos (previously GnomeSword) and I'm heavily involved in our Windows port effort. Most things have gone smoothly, but one issue really has me stumped. Occasionally all of the treeviews in the application will "freeze". By this I mean that they will not expand or collapse with mouse clicks. They will, however, expand and collapse with the keyboard (arrows, enter, etc). Additionally, the items themselves respond to mouse clicks. Very rarely, they will be frozen on startup, but typically it happens after clicking around on other buttons for a little bit. We are using the Windows theme for this. I have never been able to replicate it with the default gtk theme. I would appreciate any suggestions as to how to debug this further. Thanks, Matthew ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list