From db0f8faa3ba62d0c60d5a6c5cc0dec479eb79021 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 21 May 2012 15:33:00 +0200 Subject: Change default font to a CSS valid default font (Sans -> sans-serif). (bzr r11393) --- src/libnrtype/FontFactory.cpp | 8 ++++---- src/libnrtype/Layout-TNG-Input.cpp | 2 +- src/preferences-skeleton.h | 2 +- src/style.cpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 63f9bd6b0..8de9d4795 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -929,9 +929,9 @@ font_instance *font_factory::Face(PangoFontDescription *descr, bool canFail) res = NULL; if ( canFail ) { char *tc = pango_font_description_to_string(descr); - PANGO_DEBUG("falling back from %s to Sans because InstallFace failed\n",tc); + PANGO_DEBUG("falling back from %s to 'sans-serif' because InstallFace failed\n",tc); g_free(tc); - pango_font_description_set_family(descr,"Sans"); + pango_font_description_set_family(descr,"sans-serif"); res = Face(descr,false); } } else { @@ -942,9 +942,9 @@ font_instance *font_factory::Face(PangoFontDescription *descr, bool canFail) } else { // no match if ( canFail ) { - PANGO_DEBUG("falling back to Sans\n"); + PANGO_DEBUG("falling back to 'sans-serif'\n"); descr = pango_font_description_new(); - pango_font_description_set_family(descr,"Sans"); + pango_font_description_set_family(descr,"sans-serif"); res = Face(descr,false); pango_font_description_free(descr); } diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp index c5ea3969d..07bf207c8 100644 --- a/src/libnrtype/Layout-TNG-Input.cpp +++ b/src/libnrtype/Layout-TNG-Input.cpp @@ -291,7 +291,7 @@ PangoFontDescription *Layout::InputStreamTextSource::styleGetFontDescription() c // pango, so it's not the limiting factor Glib::ustring family; if (style->text->font_family.value == NULL) { - family = "Sans"; + family = "sans-serif"; } else { gchar **families = g_strsplit(style->text->font_family.value, ",", -1); if (families) { diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 8935d7ace..85c895dcb 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -115,7 +115,7 @@ static char const preferences_skeleton[] = " \n" +" style=\"fill:black;fill-opacity:1;stroke:none;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;\" selcue=\"1\"/>\n" " \n" " \n" " \n" diff --git a/src/style.cpp b/src/style.cpp index 40cd1663e..a67852e11 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -3100,9 +3100,9 @@ sp_text_style_new() ts->refcount = 1; sp_text_style_clear(ts); - ts->font_specification.value = g_strdup("Sans"); - ts->font.value = g_strdup("Sans"); - ts->font_family.value = g_strdup("Sans"); + ts->font_specification.value = g_strdup("sans-serif"); + ts->font.value = g_strdup("sans-serif"); + ts->font_family.value = g_strdup("sans-serif"); return ts; } -- cgit v1.2.3