-/* Return the width that an 'M' character would occupy when typeset at
- row, col */
-static guint
-M_width(const GtkSheet *sheet, gint row, gint col)
-{
- GtkSheetCellAttr attributes;
- PangoRectangle rect;
- /* FIXME: make this a member of the data store */
- static PangoLayout *layout = 0;
-
- gtk_sheet_get_attributes(sheet, row, col, &attributes);
-
- if (! layout )
- layout = gtk_widget_create_pango_layout (GTK_WIDGET(sheet), "M");
-
- g_assert(layout);
-
- pango_layout_set_font_description (layout,
- attributes.font_desc);
-
- pango_layout_get_extents (layout, NULL, &rect);
-
-#if 0
- g_object_unref(G_OBJECT(layout));
-#endif
-
- return PANGO_PIXELS(rect.width);
-}
-
-
-/* Return the number of pixels corresponding to a column of
- WIDTH characters */
-static inline guint
-columnWidthToPixels(GtkSheet *sheet, gint column, guint width)
-{
- return (M_width(sheet, 0, column) * width);
-}