Index: font.c =================================================================== RCS file: /cvs/gnome/dia/lib/font.c,v retrieving revision 1.44 diff -r1.44 font.c 1183,1184c1183 < int iwidth, iheight; < double width_height; --- > double scaled_width; 1187a1187 > gint g_lbear, g_rbear, g_width, g_asc, g_desc, c_wide, c_tall; 1217,1218c1217,1220 < /* Note: This is an ugly hack. It tries to overestimate the width with < some magic stuff. No guarantees. */ --- > /* this gets the extents of the text written, and the ascent height of the > written font. it divides width by height to get a wide-to-high ratio, then > multiplies by the scaled height. > */ 1220,1221c1222,1232 < iwidth = gdk_text_width_wc (gdk_font, wcstr, length); < iheight = gdk_string_height(gdk_font, str); --- > gdk_text_extents_wc(gdk_font, > wcstr, > length, > &g_lbear, > &g_rbear, > &g_width, > &g_asc, > &g_desc); > c_wide = g_lbear + g_rbear; > if (c_wide == 0) return (real)0.0; > scaled_width = (double)c_wide / (double)g_asc * height; 1226,1231c1237 < if ((iwidth==0) || (iheight==0)) < return 0.0; < < width_height = ((real)iwidth)/((real)iheight); < width_height *= 1.01; < return width_height*height*(iheight/100.0) + 0.2; --- > return (real)scaled_width;