[dia/dia-0-97] Bug 637047 - SVG font name is sans-serif, not sanserif



commit d21e9be93ecb330ee826dd7f28961bbc6d94d60a
Author: Hans Breuer <hans breuer org>
Date:   Sat Dec 11 22:13:06 2010 +0100

    Bug 637047 - SVG font name is sans-serif, not sanserif
    
    Tested with render-test the font name change indeed makes the
    Dia "sans" fonts appear w/o serifs. There is still something
    wrong with the font size, but that seems independent.
    
    To make compatibility with old and new (shape-)files both
    "sanserif" and "sans-serif" are translated to the internal
    "sans".

 lib/dia_svg.c             |    2 +-
 plug-ins/svg/render_svg.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/dia_svg.c b/lib/dia_svg.c
index cef259b..4eaac1b 100644
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -172,7 +172,7 @@ dia_svg_parse_style(xmlNodePtr node, DiaSvgStyle *s, real user_scale)
 	temp[i] = '\0';
 
 	if (!over) {
-	  if (strcmp (temp, "sanserif") == 0)
+	  if (strcmp (temp, "sanserif") == 0 || strcmp (temp, "sans-serif") == 0)
 	    family = g_strdup ("sans"); /* special name adaption */
 	  else
 	    family = g_strdup(temp);
diff --git a/plug-ins/svg/render_svg.c b/plug-ins/svg/render_svg.c
index 58148b1..31602fa 100644
--- a/plug-ins/svg/render_svg.c
+++ b/plug-ins/svg/render_svg.c
@@ -409,7 +409,7 @@ node_set_text_style (xmlNodePtr      node,
   if (font) {
      tmp = g_strdup_printf("%s;font-family:%s;font-style:%s;"
                            "font-weight:%s",style,
-                           strcmp(family, "sans") == 0 ? "sanserif" : family,
+                           strcmp(family, "sans") == 0 ? "sans-serif" : family,
                            dia_font_get_slant_string(font),
                            dia_font_get_weight_string(font));
      g_free(style);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]