pango r2820 - in trunk: . pango pango-view
- From: behdad svn gnome org
- To: svn-commits-list gnome org
- Subject: pango r2820 - in trunk: . pango pango-view
- Date: Fri, 30 Jan 2009 05:04:36 +0000 (UTC)
Author: behdad
Date: Fri Jan 30 05:04:35 2009
New Revision: 2820
URL: http://svn.gnome.org/viewvc/pango?rev=2820&view=rev
Log:
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".
Modified:
trunk/ChangeLog
trunk/pango-view/viewer-render.c
trunk/pango/pangofc-fontmap.c
Modified: trunk/pango-view/viewer-render.c
==============================================================================
--- trunk/pango-view/viewer-render.c (original)
+++ trunk/pango-view/viewer-render.c Fri Jan 30 05:04:35 2009
@@ -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 @@
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 @@
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 @@
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;
Modified: trunk/pango/pangofc-fontmap.c
==============================================================================
--- trunk/pango/pangofc-fontmap.c (original)
+++ trunk/pango/pangofc-fontmap.c Fri Jan 30 05:04:35 2009
@@ -1353,6 +1353,7 @@
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++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]