summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2008-05-26 20:55:39 +0000
committerTor Lillqvist <tml@src.gnome.org>2008-05-26 20:55:39 +0000
commitc72e69c91322e2b76521baabac154dcea6692160 (patch)
tree9e54030b9029c75d4a5330f92ea1eb2221af86d4
parenta945d58a92265cec0c5f8e92a5d7392a2a5887c7 (diff)
downloadpango-c72e69c91322e2b76521baabac154dcea6692160.tar.gz
pango/pangowin32-private.h Drop the PangoWin32FontMap::n_fonts field which
2008-05-26 Tor Lillqvist <tml@novell.com> * pango/pangowin32-private.h * pango/pangowin32-fontmap.c: Drop the PangoWin32FontMap::n_fonts field which wasn't really used for anything. Rename the field PangoWin32Family::font_entries to faces. Rename some local variables to be more consistently named. svn path=/trunk/; revision=2637
-rw-r--r--ChangeLog8
-rw-r--r--pango/pangowin32-fontmap.c45
-rw-r--r--pango/pangowin32-private.h2
3 files changed, 28 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 3429eec9..efdc331b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2008-05-26 Tor Lillqvist <tml@novell.com>
+ * pango/pangowin32-private.h
+ * pango/pangowin32-fontmap.c: Drop the PangoWin32FontMap::n_fonts
+ field which wasn't really used for anything. Rename the field
+ PangoWin32Family::font_entries to faces. Rename some local
+ variables to be more consistently named.
+
+2008-05-26 Tor Lillqvist <tml@novell.com>
+
* pango/pangowin32.c
* pango/pangowin32-fontmap.c: Some whitespace cleanup.
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index d514b742..cff43126 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -42,7 +42,7 @@ struct _PangoWin32Family
PangoFontFamily parent_instance;
char *family_name;
- GSList *font_entries;
+ GSList *faces;
gboolean is_monospace;
};
@@ -90,6 +90,8 @@ static void pango_win32_insert_font (PangoWin32FontMap
LOGFONTW *lfp,
gboolean is_synthetic);
+static const char *pango_win32_face_get_face_name (PangoFontFace *face);
+
static PangoWin32FontMap *default_fontmap = NULL;
G_DEFINE_TYPE (PangoWin32FontMap, _pango_win32_font_map, PANGO_TYPE_FONT_MAP)
@@ -248,7 +250,6 @@ _pango_win32_font_map_init (PangoWin32FontMap *win32fontmap)
(GEqualFunc) case_insensitive_str_equal);
win32fontmap->fonts =
g_hash_table_new ((GHashFunc) logfontw_nosize_hash, (GEqualFunc) logfontw_nosize_equal);
- win32fontmap->n_fonts = 0;
win32fontmap->font_cache = pango_win32_font_cache_new ();
win32fontmap->freed_fonts = g_queue_new ();
@@ -357,7 +358,7 @@ pango_win32_family_list_faces (PangoFontFamily *family,
{
PangoWin32Family *win32family = PANGO_WIN32_FAMILY (family);
- *n_faces = g_slist_length (win32family->font_entries);
+ *n_faces = g_slist_length (win32family->faces);
if (faces)
{
GSList *tmp_list;
@@ -365,7 +366,7 @@ pango_win32_family_list_faces (PangoFontFamily *family,
*faces = g_new (PangoFontFace *, *n_faces);
- tmp_list = win32family->font_entries;
+ tmp_list = win32family->faces;
while (tmp_list)
{
(*faces)[i++] = tmp_list->data;
@@ -479,7 +480,7 @@ pango_win32_get_font_family (PangoWin32FontMap *win32fontmap,
{
win32family = g_object_new (PANGO_WIN32_TYPE_FAMILY, NULL);
win32family->family_name = g_strdup (family_name);
- win32family->font_entries = NULL;
+ win32family->faces = NULL;
g_hash_table_insert (win32fontmap->families, win32family->family_name, win32family);
}
@@ -508,7 +509,7 @@ pango_win32_font_map_load_font (PangoFontMap *fontmap,
PangoWin32Face *best_match = NULL;
PING (("got win32family"));
- tmp_list = win32family->font_entries;
+ tmp_list = win32family->faces;
while (tmp_list)
{
PangoWin32Face *face = tmp_list->data;
@@ -1031,7 +1032,7 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap,
{
LOGFONTW *lfp2 = NULL;
PangoFontDescription *description;
- PangoWin32Family *font_family;
+ PangoWin32Family *win32family;
PangoWin32Face *win32face;
gint i;
gchar *p;
@@ -1087,13 +1088,11 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap,
win32face->cached_fonts = NULL;
- font_family =
+ win32family =
pango_win32_get_font_family (win32fontmap,
pango_font_description_get_family (win32face->description));
- font_family->font_entries = g_slist_append (font_family->font_entries, win32face);
- PING (("g_slist_length(font_family->font_entries)=%d", g_slist_length(font_family->font_entries)));
-
- win32fontmap->n_fonts++;
+ win32family->faces = g_slist_append (win32family->faces, win32face);
+ PING (("g_slist_length(win32family->faces)=%d", g_slist_length (win32family->faces)));
#if 1 /* Thought pango.aliases would make this code unnecessary, but no. */
/*
@@ -1108,22 +1107,19 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap,
{
case FF_MODERN : /* monospace */
PING (("monospace"));
- font_family->is_monospace = TRUE; /* modify before reuse */
- font_family = pango_win32_get_font_family (win32fontmap, "monospace");
- font_family->font_entries = g_slist_append (font_family->font_entries, win32face);
- win32fontmap->n_fonts++;
+ win32family->is_monospace = TRUE; /* modify before reuse */
+ win32family = pango_win32_get_font_family (win32fontmap, "monospace");
+ win32family->faces = g_slist_append (win32family->faces, win32face);
break;
case FF_ROMAN : /* serif */
PING (("serif"));
- font_family = pango_win32_get_font_family (win32fontmap, "serif");
- font_family->font_entries = g_slist_append (font_family->font_entries, win32face);
- win32fontmap->n_fonts++;
+ win32family = pango_win32_get_font_family (win32fontmap, "serif");
+ win32family->faces = g_slist_append (win32family->faces, win32face);
break;
case FF_SWISS : /* sans */
PING (("sans"));
- font_family = pango_win32_get_font_family (win32fontmap, "sans");
- font_family->font_entries = g_slist_append (font_family->font_entries, win32face);
- win32fontmap->n_fonts++;
+ win32family = pango_win32_get_font_family (win32fontmap, "sans");
+ win32family->faces = g_slist_append (win32family->faces, win32face);
break;
}
@@ -1133,9 +1129,8 @@ pango_win32_insert_font (PangoWin32FontMap *win32fontmap,
p = g_utf16_to_utf8 (win32face->logfontw.lfFaceName, -1, NULL, NULL, NULL);
if (p && g_ascii_strcasecmp (p, "courier new") == 0)
{
- font_family = pango_win32_get_font_family (win32fontmap, "courier");
- font_family->font_entries = g_slist_append (font_family->font_entries, win32face);
- win32fontmap->n_fonts++;
+ win32family = pango_win32_get_font_family (win32fontmap, "courier");
+ win32family->faces = g_slist_append (win32family->faces, win32face);
}
g_free (p);
#endif
diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h
index 8f8c7f97..9f358230 100644
--- a/pango/pangowin32-private.h
+++ b/pango/pangowin32-private.h
@@ -104,8 +104,6 @@ struct _PangoWin32FontMap
*/
GHashTable *fonts;
- int n_fonts;
-
double resolution; /* (points / pixel) * PANGO_SCALE */
};