At 19:28 22.06.02 +0200, Hans Breuer wrote: >At 18:25 22.06.02 +0200, Cyrille Chepelov wrote: >>Le Sat, Jun 22, 2002, � 04:40:53PM +0200, Hans Breuer a �crit: >Fine with me. It'll probably take me an hour to compile and crash the >current version. Will go online than again. > It crashed at only one place : don't try to g_object_unref unitialized memory :-)
There is something wrong with bounding box calculation [1] and
we need to find a way to get on the right pango_context. It
doesn't matter that much on win32 yet (there currently is only
one), but uncontroled mixing of pangox_context, pango_xft_context,
or pango_ft2_context appears as asking for trouble to me.
Required patch for win32 attached. Ok to commit ?
2002-06-22 Hans Breuer <[EMAIL PROTECTED]>
* lib/widget.c : dont use backend specific functions
to get on the font_families. Including it would mean
including <windows.h> which breaks due to namespace
pollutions ...
* lib/libdia.def : updated externals
* app/makefile.msc : temporary disabled: -DHAVE_LIBART
Haven't look at the code yet, will now.
Nice work,
Hans
[1] see attachement
cc-pango.png
Description: Binary data
--- from-cvs/dia/app/render_gdk.c Sat Jun 22 19:27:06 2002
+++ my-gtk/dia/app/render_gdk.c Sat Jun 22 20:35:28 2002
@@ -191,6 +191,7 @@
renderer->saved_line_style = LINESTYLE_SOLID;
renderer->dash_length = 10;
renderer->dot_length = 2;
+ renderer->font = NULL;
return renderer;
}
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/dia/lib/widgets.c
my-gtk/dia/lib/widgets.c
--- from-cvs/dia/lib/widgets.c Sat Jun 22 19:27:12 2002
+++ my-gtk/dia/lib/widgets.c Sat Jun 22 19:56:44 2002
@@ -29,17 +29,6 @@
#include <gtk/gtklabel.h>
#include <gtk/gtksignal.h>
#include <pango/pango.h>
-#if G_OS_WIN32
-#include <pango/pangowin32.h>
-#define pango_platform_font_map_for_display() \
- pango_win32_font_map_for_display()
-#else
-#include <pango/pangoft2.h>
-#define pango_platform_font_map_for_display() \
- pango_ft2_font_map_for_display()
- /* Could have used X's font map ? */
-#endif
-
void dia_font_selector_set_styles (DiaFontSelector *fs, DiaFont *font);
guchar **dia_font_selector_get_sorted_names();
@@ -203,7 +192,6 @@
GtkWidget *menuitem;
GSList *group;
const char *familyname;
- PangoFontMap *fmap;
PangoFontFamily **families;
int n_families,i;
@@ -212,9 +200,8 @@
submenu = NULL;
group = NULL;
- fmap = pango_platform_font_map_for_display();
- pango_font_map_list_families(fmap,&families,&n_families);
-
+ pango_context_list_families (gtk_widget_get_pango_context (GTK_WIDGET (menu)),
+ &families, &n_families);
for (i = 0; i < n_families; ++i) {
familyname = pango_font_family_get_name(families[i]);
menuitem = gtk_radio_menu_item_new_with_label (group, familyname);
@@ -278,8 +265,8 @@
#else
/* Notice adding 1, to be able to discern from NULL return value */
- fmap = pango_platform_font_map_for_display();
- pango_font_map_list_families(fmap,&families,&n_families);
+ pango_context_list_families (gdk_pango_context_get(),
+ &families, &n_families);
for (i = 0; i < n_families; ++i) {
fontname = (char *) pango_font_family_get_name(families[i]);
-------- Hans "at" Breuer "dot" Org ----------- Tell me what you need, and I'll tell you how to=20 get along without it. -- Dilbert
