summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2009-01-30 05:04:35 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2009-01-30 05:04:35 +0000
commit52d8ad64f1dabf981b9d25749099b80ce819bceb (patch)
treedbe839a288ea4f50b84f3180e3d1b9aa5e82e204
parent451945950e12aff37cba8ad42f1ae63880dc0a1f (diff)
downloadpango-52d8ad64f1dabf981b9d25749099b80ce819bceb.tar.gz
Remove default font family and size. This means default is "serif 12" now,
2009-01-29 Behdad Esfahbod <behdad@gnome.org> * pango-view/viewer-render.c (make_layout), (get_options_string): Remove default font family and size. This means default is "serif 12" now, instead of previous "sans 18". svn path=/trunk/; revision=2820
-rw-r--r--ChangeLog6
-rw-r--r--pango-view/viewer-render.c26
-rw-r--r--pango/pangofc-fontmap.c1
3 files changed, 10 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 159967b8..6aaec213 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-01-29 Behdad Esfahbod <behdad@gnome.org>
+ * pango-view/viewer-render.c (make_layout), (get_options_string):
+ Remove default font family and size. This means default size is not
+ 12 IIRC, not 18 as it was.
+
+2009-01-29 Behdad Esfahbod <behdad@gnome.org>
+
* pango/opentype/harfbuzz-open.h:
* pango/opentype/harfbuzz-gdef.c (Make_ClassRange),
(HB_GDEF_Build_ClassDefinition):
diff --git a/pango-view/viewer-render.c b/pango-view/viewer-render.c
index 4d709bd6..41bac332 100644
--- a/pango-view/viewer-render.c
+++ b/pango-view/viewer-render.c
@@ -32,17 +32,11 @@
#include "viewer-render.h"
-#define DEFAULT_FONT_FAMILY "Sans"
-#define DEFAULT_FONT_SIZE 18
-
-#define _MAKE_FONT_NAME(family, size) family " " #size
-#define MAKE_FONT_NAME(family, size) _MAKE_FONT_NAME(family, size)
-
const char *prog_name;
gboolean opt_display = TRUE;
int opt_dpi = 96;
-const char *opt_font = MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE);
+const char *opt_font = "";
gboolean opt_header = FALSE;
const char *opt_output = NULL;
int opt_margin = 10;
@@ -85,20 +79,6 @@ fail (const char *format, ...)
exit (1);
}
-static PangoFontDescription *
-get_font_description (void)
-{
- PangoFontDescription *font_description = pango_font_description_from_string (opt_font);
-
- if ((pango_font_description_get_set_fields (font_description) & PANGO_FONT_MASK_FAMILY) == 0)
- pango_font_description_set_family (font_description, DEFAULT_FONT_FAMILY);
-
- if ((pango_font_description_get_set_fields (font_description) & PANGO_FONT_MASK_SIZE) == 0)
- pango_font_description_set_size (font_description, DEFAULT_FONT_SIZE * PANGO_SCALE);
-
- return font_description;
-}
-
static PangoLayout *
make_layout(PangoContext *context,
const char *text,
@@ -120,7 +100,7 @@ make_layout(PangoContext *context,
pango_layout_set_single_paragraph_mode (layout, opt_single_par);
pango_layout_set_wrap (layout, opt_wrap);
- font_description = get_font_description ();
+ font_description = pango_font_description_from_string (opt_font);
if (size > 0)
pango_font_description_set_size (font_description, size * PANGO_SCALE);
@@ -156,7 +136,7 @@ make_layout(PangoContext *context,
gchar *
get_options_string (void)
{
- PangoFontDescription *font_description = get_font_description ();
+ PangoFontDescription *font_description = pango_font_description_from_string (opt_font);
gchar *font_name;
gchar *result;
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 4bcae1fd..a302d4dd 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1353,6 +1353,7 @@ pango_fc_make_pattern (const PangoFontDescription *description,
FC_PIXEL_SIZE, FcTypeDouble, pixel_size / 1024.,
NULL);
+ g_message ("'%s'", pango_font_description_get_family (description));
families = g_strsplit (pango_font_description_get_family (description), ",", -1);
for (i = 0; families[i]; i++)