summaryrefslogtreecommitdiff
path: root/pango/pangocairo-win32font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-01-16 20:07:35 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-01-16 20:07:35 +0000
commit80e647a8dbc97662b9d966c0f7a8e1aedea89eed (patch)
treed3a322c28112b7623765847aa32e8e319c576b45 /pango/pangocairo-win32font.c
parente6b83e4264b4ad2ab73a3239d902b4064c75634d (diff)
downloadpango-80e647a8dbc97662b9d966c0f7a8e1aedea89eed.tar.gz
*.c, *.h: Drop trailing whitespace.
2007-01-16 Behdad Esfahbod <behdad@gnome.org> *.c, *.h: Drop trailing whitespace. svn path=/trunk/; revision=2163
Diffstat (limited to 'pango/pangocairo-win32font.c')
-rw-r--r--pango/pangocairo-win32font.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c
index 6aa114d9..297012db 100644
--- a/pango/pangocairo-win32font.c
+++ b/pango/pangocairo-win32font.c
@@ -50,11 +50,11 @@ struct _PangoCairoWin32Font
cairo_font_face_t *font_face;
cairo_scaled_font_t *scaled_font;
-
+
cairo_matrix_t font_matrix;
cairo_matrix_t ctm;
cairo_font_options_t *options;
-
+
GSList *metrics_by_lang;
GHashTable *glyph_info;
};
@@ -91,12 +91,12 @@ pango_cairo_win32_font_get_font_face (PangoCairoFont *font)
* last field
*/
memcpy (&logfontw, &win32font->logfont, sizeof (LOGFONTA));
-
+
if (!MultiByteToWideChar (CP_ACP, MB_ERR_INVALID_CHARS,
win32font->logfont.lfFaceName, -1,
logfontw.lfFaceName, G_N_ELEMENTS (logfontw.lfFaceName)))
logfontw.lfFaceName[0] = 0; /* Hopefully this will select some font */
-
+
cwfont->font_face = cairo_win32_font_face_create_for_logfontw (&logfontw);
/* Failure of the above should only occur for out of memory,
@@ -105,7 +105,7 @@ pango_cairo_win32_font_get_font_face (PangoCairoFont *font)
if (!cwfont->font_face)
g_error ("Unable to create Win32 cairo font face.\nThis means out of memory or a cairo/fontconfig/FreeType bug");
}
-
+
return cwfont->font_face;
}
@@ -130,7 +130,7 @@ pango_cairo_win32_font_get_scaled_font (PangoCairoFont *font)
if (!cwfont->scaled_font)
g_error ("Unable to create Win32 cairo scaled font.\nThis means out of memory or a cairo/fontconfig/FreeType bug");
}
-
+
return cwfont->scaled_font;
}
@@ -178,7 +178,7 @@ pango_cairo_win32_font_finalize (GObject *object)
g_hash_table_destroy (cwfont->glyph_info);
g_slist_foreach (cwfont->metrics_by_lang, (GFunc)free_metrics_info, NULL);
- g_slist_free (cwfont->metrics_by_lang);
+ g_slist_free (cwfont->metrics_by_lang);
if (cwfont->scaled_font)
cairo_scaled_font_destroy (cwfont->scaled_font);
@@ -204,9 +204,9 @@ compute_glyph_extents (PangoFont *font,
cairo_font_extents_t font_extents;
cairo_text_extents_t extents;
cairo_glyph_t cairo_glyph;
-
+
cairo_scaled_font_extents (scaled_font, &font_extents);
-
+
logical_rect->x = 0;
logical_rect->y = - font_extents.ascent * PANGO_SCALE;
logical_rect->width = 0;
@@ -226,15 +226,15 @@ compute_glyph_extents (PangoFont *font,
cairo_glyph.index = glyph;
cairo_glyph.x = 0;
cairo_glyph.y = 0;
-
+
cairo_scaled_font_glyph_extents (scaled_font,
&cairo_glyph, 1, &extents);
-
+
ink_rect->x = extents.x_bearing * PANGO_SCALE;
ink_rect->y = extents.y_bearing * PANGO_SCALE;
ink_rect->width = extents.width * PANGO_SCALE;
ink_rect->height = extents.height * PANGO_SCALE;
-
+
logical_rect->width = extents.x_advance * PANGO_SCALE;
}
}
@@ -250,17 +250,17 @@ pango_cairo_win32_font_get_glyph_info (PangoFont *font,
if (!info)
{
info = g_new0 (PangoCairoWin32GlyphInfo, 1);
-
+
compute_glyph_extents (font, glyph,
&info->ink_rect,
&info->logical_rect);
-
+
g_hash_table_insert (cwfont->glyph_info, GUINT_TO_POINTER (glyph), info);
}
return info;
}
-
+
static void
pango_cairo_win32_font_get_glyph_extents (PangoFont *font,
PangoGlyph glyph,
@@ -270,7 +270,7 @@ pango_cairo_win32_font_get_glyph_extents (PangoFont *font,
PangoCairoWin32GlyphInfo *info;
info = pango_cairo_win32_font_get_glyph_info (font, glyph);
-
+
if (ink_rect)
*ink_rect = info->ink_rect;
if (logical_rect)
@@ -315,14 +315,14 @@ create_metrics_for_context (PangoFont *font,
cairo_scaled_font_t *scaled_font;
cairo_font_extents_t font_extents;
double height;
-
+
metrics = pango_font_metrics_new ();
-
+
scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (cwfont));
cairo_scaled_font_extents (scaled_font, &font_extents);
cairo_win32_scaled_font_done_font (scaled_font);
-
+
metrics->ascent = font_extents.ascent * PANGO_SCALE;
metrics->descent = font_extents.descent * PANGO_SCALE;
@@ -343,9 +343,9 @@ create_metrics_for_context (PangoFont *font,
layout = pango_layout_new (context);
font_desc = pango_font_describe_with_absolute_size (font);
pango_layout_set_font_description (layout, font_desc);
- pango_layout_set_text (layout, sample_str, -1);
+ pango_layout_set_text (layout, sample_str, -1);
pango_layout_get_extents (layout, NULL, &extents);
-
+
metrics->approximate_char_width = extents.width / g_utf8_strlen (sample_str, -1);
pango_layout_set_text (layout, "0123456789", -1);
@@ -364,14 +364,14 @@ pango_cairo_win32_font_get_metrics (PangoFont *font,
PangoWin32Font *win32font = PANGO_WIN32_FONT (font);
PangoCairoWin32Font *cwfont = PANGO_CAIRO_WIN32_FONT (font);
PangoWin32MetricsInfo *info = NULL; /* Quiet gcc */
- GSList *tmp_list;
+ GSList *tmp_list;
const char *sample_str = pango_language_get_sample_string (language);
-
+
tmp_list = cwfont->metrics_by_lang;
while (tmp_list)
{
info = tmp_list->data;
-
+
if (info->sample_str == sample_str) /* We _don't_ need strcmp */
break;
@@ -386,10 +386,10 @@ pango_cairo_win32_font_get_metrics (PangoFont *font,
return pango_font_metrics_new ();
info = g_slice_new0 (PangoWin32MetricsInfo);
-
- cwfont->metrics_by_lang = g_slist_prepend (cwfont->metrics_by_lang,
+
+ cwfont->metrics_by_lang = g_slist_prepend (cwfont->metrics_by_lang,
info);
-
+
info->sample_str = sample_str;
context = pango_context_new ();
@@ -410,7 +410,7 @@ pango_cairo_win32_font_select_font (PangoFont *font,
HDC hdc)
{
cairo_scaled_font_t *scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (font));
-
+
return cairo_win32_scaled_font_select_font (scaled_font, hdc) == CAIRO_STATUS_SUCCESS;
}
@@ -418,7 +418,7 @@ static void
pango_cairo_win32_font_done_font (PangoFont *font)
{
cairo_scaled_font_t *scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (font));
-
+
cairo_win32_scaled_font_done_font (scaled_font);
}
@@ -439,7 +439,7 @@ pango_cairo_win32_font_class_init (PangoCairoWin32FontClass *class)
PangoWin32FontClass *win32_font_class = PANGO_WIN32_FONT_CLASS (class);
object_class->finalize = pango_cairo_win32_font_finalize;
-
+
font_class->get_glyph_extents = pango_cairo_win32_font_get_glyph_extents;
font_class->get_metrics = pango_cairo_win32_font_get_metrics;
@@ -485,19 +485,19 @@ _pango_cairo_win32_font_new (PangoCairoWin32FontMap *cwfontmap,
if (context)
{
dpi = pango_cairo_context_get_resolution (context);
-
+
if (dpi <= 0)
dpi = cwfontmap->dpi;
}
else
dpi = cwfontmap->dpi;
-
+
if (!pango_font_description_get_size_is_absolute (desc))
size *= dpi / 72.;
#ifdef USE_FACE_CACHED_FONTS
win32fontmap = PANGO_WIN32_FONT_MAP (cwfontmap);
-
+
tmp_list = face->cached_fonts;
while (tmp_list)
{
@@ -507,7 +507,7 @@ _pango_cairo_win32_font_new (PangoCairoWin32FontMap *cwfontmap,
g_object_ref (win32font);
if (win32font->in_cache)
pango_win32_fontmap_cache_remove (PANGO_FONT_MAP (win32fontmap), win32font);
-
+
return PANGO_FONT (win32font);
}
tmp_list = tmp_list->next;
@@ -515,7 +515,7 @@ _pango_cairo_win32_font_new (PangoCairoWin32FontMap *cwfontmap,
#endif
cwfont = g_object_new (PANGO_TYPE_CAIRO_WIN32_FONT, NULL);
win32font = PANGO_WIN32_FONT (cwfont);
-
+
win32font->fontmap = PANGO_FONT_MAP (cwfontmap);
g_object_ref (cwfontmap);
@@ -550,6 +550,6 @@ _pango_cairo_win32_font_new (PangoCairoWin32FontMap *cwfontmap,
&win32font->logfont);
cwfont->options = cairo_font_options_copy (_pango_cairo_context_get_merged_font_options (context));
-
+
return PANGO_FONT (cwfont);
}