diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 48ae59d..37fc396 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -3164,10 +3164,50 @@ SUFFIX(go_format_execute) (PangoLayout *layout, GString *dst,
 
 		case OP_NUM_FRACTION_BLANK:
 			if (fraction.n == 0) {
-				/* Replace all added characters by spaces.  */
-				gsize chars = g_utf8_strlen (dst->str + fraction.nominator_start, -1);
-				memset (dst->str + fraction.nominator_start, ' ', chars);
-				g_string_truncate (dst, fraction.nominator_start + chars);
+				/* Replace all added characters by spaces of the right length.  */
+				char const *f = dst->str + fraction.nominator_start;
+				gsize chars = g_utf8_strlen (f, -1);
+				
+				if (chars > 0) {
+					/* We have layouts that have no fontmap set, we need to avoid them */
+					if (layout && pango_context_get_font_map (pango_layout_get_context (layout))) {
+						guint start = fraction.nominator_start;
+						GList *plist, *l;
+						gint length = dst->len - fraction.nominator_start;
+						plist = pango_itemize (pango_layout_get_context (layout),
+								       dst->str,
+								       f - dst->str,
+								       length,
+								       attrs,
+								       NULL);
+						chars = 0;
+						for (l = plist; l != NULL; l = l->next) {
+							PangoItem *pi = l->data;
+							PangoGlyphString *glyphs = pango_glyph_string_new ();
+							PangoAttribute *attr;
+							PangoRectangle ink_rect;
+							PangoRectangle logical_rect;
+
+							pango_shape (f, length, &pi->analysis, glyphs);
+							pango_glyph_string_extents (glyphs,
+										    pi->analysis.font,
+										    &ink_rect,
+										    &logical_rect);
+							pango_glyph_string_free (glyphs);
+
+							attr = pango_attr_shape_new (&ink_rect, &logical_rect);
+							attr->start_index = start;
+							attr->end_index = start + 1;
+							pango_attr_list_insert (attrs, attr);
+							start++;
+							chars++;
+						}
+						go_list_free_custom (plist, (GFreeFunc) pango_item_free);
+					} 
+					
+					memset (dst->str + fraction.nominator_start, ' ', chars);
+					g_string_truncate (dst, fraction.nominator_start + chars);
+				}
 			}
 			break;
 
