summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-04-07 18:30:23 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-04-07 18:30:23 +0000
commit545c18d269ec738dce4f30affb265440bec27574 (patch)
tree0d615e9aeba4c600c0c4e983378d5f4c61074b01 /pango
parent05c7e63fc205797a8c2b9fd52aee466ef9e2d6be (diff)
downloadpango-545c18d269ec738dce4f30affb265440bec27574.tar.gz
Update to new Cairo font API.
2005-04-07 Owen Taylor <otaylor@redhat.com> * pango/pangocairo-fcfont.c pango/pangocairo-win32font.c pango/pangocairo-render.c: Update to new Cairo font API. * pangpopangowin32.h pango/pangowin32-private.h pango/pangowin32.c pango/pangocairo-win32font.c modules/basic/basic-win32.c: Rename get_scale_factor() to get_metrics_factor() to match Cairo
Diffstat (limited to 'pango')
-rw-r--r--pango/pangocairo-fcfont.c120
-rw-r--r--pango/pangocairo-font.c15
-rw-r--r--pango/pangocairo-private.h6
-rw-r--r--pango/pangocairo-render.c9
-rw-r--r--pango/pangocairo-win32font.c104
-rw-r--r--pango/pangowin32-private.h8
-rw-r--r--pango/pangowin32.c20
-rw-r--r--pango/pangowin32.h8
8 files changed, 182 insertions, 108 deletions
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index 52da3a4a..19076cf8 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -46,9 +46,10 @@ struct _PangoCairoFcFont
{
PangoFcFont font;
- cairo_font_t *cairo_font;
+ cairo_font_face_t *font_face;
+ cairo_scaled_font_t *scaled_font;
cairo_matrix_t *font_matrix;
- cairo_matrix_t *total_matrix;
+ cairo_matrix_t *ctm;
};
struct _PangoCairoFcFontClass
@@ -58,53 +59,92 @@ struct _PangoCairoFcFontClass
GType pango_cairo_fc_font_get_type (void);
+static cairo_font_face_t *pango_cairo_fc_font_get_font_face (PangoCairoFont *font);
+
/*******************************
* Utility functions *
*******************************/
-static cairo_font_t *
-pango_cairo_fc_font_get_cairo_font (PangoCairoFont *font)
+static cairo_font_face_t *
+pango_cairo_fc_font_get_font_face (PangoCairoFont *font)
{
PangoCairoFcFont *cffont = PANGO_CAIRO_FC_FONT (font);
PangoFcFont *fcfont = PANGO_FC_FONT (cffont);
- if (cffont->cairo_font == NULL)
+ if (!cffont->font_face)
+ {
+ cffont->font_face = cairo_ft_font_face_create_for_pattern (fcfont->font_pattern);
+
+ /* Failure of the above should only occur for out of memory,
+ * we can't proceed at that point
+ */
+ if (!cffont->font_face)
+ g_error ("Unable create Cairo font name");
+ }
+
+ return cffont->font_face;
+}
+
+static cairo_scaled_font_t *
+pango_cairo_fc_font_get_scaled_font (PangoCairoFont *font)
+{
+ PangoCairoFcFont *cffont = PANGO_CAIRO_FC_FONT (font);
+
+ if (!cffont->scaled_font)
{
- cffont->cairo_font = cairo_ft_font_create (fcfont->font_pattern, cffont->total_matrix);
+ cairo_font_face_t *font_face;
+
+ font_face = pango_cairo_fc_font_get_font_face (font);
+ cffont->scaled_font = cairo_scaled_font_create (font_face,
+ cffont->font_matrix,
+ cffont->ctm);
/* Failure of the above should only occur for out of memory,
* we can't proceed at that point
*/
- if (!cffont->cairo_font)
+ if (!cffont->scaled_font)
g_error ("Unable create Cairo font");
}
- return cffont->cairo_font;
+ return cffont->scaled_font;
+}
+
+/********************************
+ * Method implementations *
+ ********************************/
+
+static void
+pango_cairo_fc_font_install (PangoCairoFont *font,
+ cairo_t *cr)
+{
+ PangoCairoFcFont *cffont = PANGO_CAIRO_FC_FONT (font);
+
+ cairo_set_font_face (cr,
+ pango_cairo_fc_font_get_font_face (font));
+ cairo_transform_font (cr, cffont->font_matrix);
}
static void
cairo_font_iface_init (PangoCairoFontIface *iface)
{
- iface->get_cairo_font = pango_cairo_fc_font_get_cairo_font;
+ iface->install = pango_cairo_fc_font_install;
}
G_DEFINE_TYPE_WITH_CODE (PangoCairoFcFont, pango_cairo_fc_font, PANGO_TYPE_FC_FONT,
{ G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) });
-/********************************
- * Method implementations *
- ********************************/
-
static void
pango_cairo_fc_font_finalize (GObject *object)
{
PangoCairoFcFont *cffont = PANGO_CAIRO_FC_FONT (object);
- if (cffont->cairo_font)
- cairo_font_destroy (cffont->cairo_font);
+ if (cffont->font_face)
+ cairo_font_face_destroy (cffont->font_face);
+ if (cffont->scaled_font)
+ cairo_scaled_font_destroy (cffont->scaled_font);
- cairo_matrix_destroy (cffont->total_matrix);
cairo_matrix_destroy (cffont->font_matrix);
+ cairo_matrix_destroy (cffont->ctm);
G_OBJECT_CLASS (pango_cairo_fc_font_parent_class)->finalize (object);
}
@@ -136,19 +176,18 @@ pango_cairo_fc_font_get_glyph_extents (PangoFont *font,
PangoRectangle *logical_rect)
{
PangoCairoFcFont *cffont = PANGO_CAIRO_FC_FONT (font);
- cairo_font_t *cairo_font;
+ cairo_scaled_font_t *scaled_font;
cairo_text_extents_t extents;
cairo_glyph_t cairo_glyph;
- cairo_font = pango_cairo_fc_font_get_cairo_font (PANGO_CAIRO_FONT (font));
+ scaled_font = pango_cairo_fc_font_get_scaled_font (PANGO_CAIRO_FONT (font));
cairo_glyph.index = glyph;
cairo_glyph.x = 0;
cairo_glyph.y = 0;
- cairo_font_glyph_extents (cairo_font,
- cffont->font_matrix,
- &cairo_glyph, 1, &extents);
+ cairo_scaled_font_glyph_extents (scaled_font,
+ &cairo_glyph, 1, &extents);
if (ink_rect)
{
@@ -174,13 +213,13 @@ pango_cairo_fc_font_get_glyph_extents (PangoFont *font,
static FT_Face
pango_cairo_fc_font_lock_face (PangoFcFont *font)
{
- return cairo_ft_font_lock_face (pango_cairo_fc_font_get_cairo_font (PANGO_CAIRO_FONT (font)));
+ return cairo_ft_scaled_font_lock_face (pango_cairo_fc_font_get_scaled_font (PANGO_CAIRO_FONT (font)));
}
static void
pango_cairo_fc_font_unlock_face (PangoFcFont *font)
{
- cairo_ft_font_unlock_face (pango_cairo_fc_font_get_cairo_font (PANGO_CAIRO_FONT (font)));
+ cairo_ft_scaled_font_unlock_face (pango_cairo_fc_font_get_scaled_font (PANGO_CAIRO_FONT (font)));
}
static PangoGlyph
@@ -194,10 +233,15 @@ static void
pango_cairo_fc_font_shutdown (PangoFcFont *fcfont)
{
PangoCairoFcFont *cffont = PANGO_CAIRO_FC_FONT (fcfont);
- if (cffont->cairo_font)
+ if (cffont->scaled_font)
+ {
+ cairo_scaled_font_destroy (cffont->scaled_font);
+ cffont->scaled_font = NULL;
+ }
+ if (cffont->font_face)
{
- cairo_font_destroy (cffont->cairo_font);
- cffont->cairo_font = NULL;
+ cairo_font_face_destroy (cffont->font_face);
+ cffont->font_face = NULL;
}
}
@@ -366,26 +410,16 @@ _pango_cairo_fc_font_new (PangoCairoFcFontMap *cffontmap,
cairo_matrix_scale (cffont->font_matrix,
size / PANGO_SCALE, size / PANGO_SCALE);
- cffont->total_matrix = cairo_matrix_create ();
+ cffont->ctm = cairo_matrix_create ();
pango_ctm = pango_context_get_matrix (context);
if (pango_ctm)
- {
- cairo_matrix_t *ctm;
-
- ctm = cairo_matrix_create ();
- cairo_matrix_set_affine (ctm,
- pango_ctm->xx,
- pango_ctm->yx,
- pango_ctm->xy,
- pango_ctm->yy,
- 0., 0.);
-
- cairo_matrix_multiply (cffont->total_matrix, cffont->font_matrix, ctm);
- cairo_matrix_destroy (ctm);
- }
- else
- cairo_matrix_copy (cffont->total_matrix, cffont->font_matrix);
+ cairo_matrix_set_affine (cffont->ctm,
+ pango_ctm->xx,
+ pango_ctm->yx,
+ pango_ctm->xy,
+ pango_ctm->yy,
+ 0., 0.);
return PANGO_FC_FONT (cffont);
}
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 756e1044..15837155 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -53,15 +53,18 @@ pango_cairo_font_get_type (void)
}
/**
- * _pango_cairo_font_get_cairo_font:
+ * _pango_cairo_font_install:
* @font: a #PangoCairoFont
+ * @cr: a #cairo_t
*
- * Get the cairo_font_t for a PangoCairoFont.
+ * Makes @font the current font for rendering in the specified
+ * Cairo context.
**/
-cairo_font_t *
-_pango_cairo_font_get_cairo_font (PangoCairoFont *font)
+void
+_pango_cairo_font_install (PangoCairoFont *font,
+ cairo_t *cr)
{
- g_return_val_if_fail (PANGO_IS_CAIRO_FONT (font), NULL);
+ g_return_if_fail (PANGO_IS_CAIRO_FONT (font));
- return (* PANGO_CAIRO_FONT_GET_IFACE (font)->get_cairo_font) (font);
+ return (* PANGO_CAIRO_FONT_GET_IFACE (font)->install) (font, cr);
}
diff --git a/pango/pangocairo-private.h b/pango/pangocairo-private.h
index b964d7f4..0c544bd8 100644
--- a/pango/pangocairo-private.h
+++ b/pango/pangocairo-private.h
@@ -56,12 +56,14 @@ struct _PangoCairoFontIface
{
GTypeInterface g_iface;
- cairo_font_t *(*get_cairo_font) (PangoCairoFont *font);
+ void (*install) (PangoCairoFont *font,
+ cairo_t *cr);
};
GType pango_cairo_font_get_type (void);
-cairo_font_t *_pango_cairo_font_get_cairo_font (PangoCairoFont *font);
+void _pango_cairo_font_install (PangoCairoFont *font,
+ cairo_t *cr);
#define PANGO_TYPE_CAIRO_RENDERER (pango_cairo_renderer_get_type())
#define PANGO_CAIRO_RENDERER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CAIRO_RENDERER, PangoCairoRenderer))
diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c
index c1598c45..00c1bdc5 100644
--- a/pango/pangocairo-render.c
+++ b/pango/pangocairo-render.c
@@ -96,8 +96,7 @@ pango_cairo_renderer_draw_glyphs (PangoRenderer *renderer,
x_position += gi->geometry.width;
}
- cairo_set_font (crenderer->cr,
- _pango_cairo_font_get_cairo_font (PANGO_CAIRO_FONT (font)));
+ _pango_cairo_font_install (PANGO_CAIRO_FONT (font), crenderer->cr);
if (crenderer->do_path)
cairo_glyph_path (crenderer->cr, cairo_glyphs, glyphs->num_glyphs);
@@ -423,7 +422,7 @@ pango_cairo_glyph_string_path (cairo_t *cr,
crenderer->x_offset = 0.;
crenderer->y_offset = 0.;
- cairo_set_font (cr, NULL);
+ cairo_set_font_face (cr, NULL);
}
/**
@@ -465,7 +464,7 @@ pango_cairo_layout_line_path (cairo_t *cr,
crenderer->x_offset = 0.;
crenderer->y_offset = 0.;
- cairo_set_font (cr, NULL);
+ cairo_set_font_face (cr, NULL);
}
/**
@@ -507,6 +506,6 @@ pango_cairo_layout_path (cairo_t *cr,
crenderer->x_offset = 0.;
crenderer->y_offset = 0.;
- cairo_set_font (cr, NULL);
+ cairo_set_font_face (cr, NULL);
}
diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c
index 033c49f2..4cb42b1d 100644
--- a/pango/pangocairo-win32font.c
+++ b/pango/pangocairo-win32font.c
@@ -46,7 +46,9 @@ struct _PangoCairoWin32Font
int size;
- cairo_font_t *cairo_font;
+ cairo_font_face_t font_face;
+ cairo_scaled_font_t *scaled_font;
+
cairo_matrix_t *font_matrix;
cairo_matrix_t *total_matrix;
@@ -64,13 +66,13 @@ GType pango_cairo_win32_font_get_type (void);
* Utility functions *
*******************************/
-static cairo_font_t *
-pango_cairo_win32_font_get_cairo_font (PangoCairoFont *font)
+static cairo_font_face_t *
+pango_cairo_win32_font_get_font_face (PangoCairoFont *font)
{
PangoCairoWin32Font *cwfont = PANGO_CAIRO_WIN32_FONT (font);
PangoWin32Font *win32font = PANGO_WIN32_FONT (cwfont);
- if (cwfont->cairo_font == NULL)
+ if (cwfont->font_face == NULL)
{
LOGFONTW logfontw;
@@ -84,33 +86,67 @@ pango_cairo_win32_font_get_cairo_font (PangoCairoFont *font)
win32font->logfont.lfFaceName, strlen (win32font->logfont.lfFaceName),
logfontw.lfFaceName, sizeof(logfontw.lfFaceName)))
logfontw.lfFaceName[0] = 0; /* Hopefully this will select some font */
-
- cwfont->cairo_font = cairo_win32_font_create_for_logfontw (&logfontw,
- cwfont->total_matrix);
+
+ cwfont->font_face = cairo_win32_font_face_create_for_logfontw (&logfontw);
+
+ /* Failure of the above should only occur for out of memory,
+ * we can't proceed at that point
+ */
+ if (!cwfont->font_face)
+ g_error ("Unable create Cairo font");
+ }
+
+ return cwfont->font_face;
+}
+
+static cairo_scaled_font_t *
+pango_cairo_win32_font_get_scaled_font (PangoCairoFont *font)
+{
+ PangoCairoWin32Font *cffont = PANGO_CAIRO_WIN32_FONT (font);
+
+ if (!cffont->scaled_font)
+ {
+ cairo_font_face_t *font_face;
+
+ font_face = pango_cairo_win32_font_get_font_face (font);
+ cffont->scaled_font = cairo_scaled_font_create (font_face,
+ cffont->font_matrix,
+ cffont->ctm);
/* Failure of the above should only occur for out of memory,
* we can't proceed at that point
*/
- if (!cwfont->cairo_font)
+ if (!cffont->scaled_font)
g_error ("Unable create Cairo font");
}
- return cwfont->cairo_font;
+ return cffont->scaled_font;
+}
+
+/********************************
+ * Method implementations *
+ ********************************/
+
+static void
+pango_cairo_win32_font_install (PangoCairoFont *font,
+ cairo_t *cr)
+{
+ PangoCairoWin32Font *cffont = PANGO_CAIRO_WIN32_FONT (font);
+
+ cairo_set_font_face (cr,
+ pango_cairo_win32_font_get_font_face (font));
+ cairo_transform_font (cr, cffont->font_matrix);
}
static void
cairo_font_iface_init (PangoCairoFontIface *iface)
{
- iface->get_cairo_font = pango_cairo_win32_font_get_cairo_font;
+ iface->install = pango_cairo_win32_font_install;
}
G_DEFINE_TYPE_WITH_CODE (PangoCairoWin32Font, pango_cairo_win32_font, PANGO_TYPE_WIN32_FONT,
{ G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) });
-/********************************
- * Method implementations *
- ********************************/
-
static void
pango_cairo_win32_font_finalize (GObject *object)
{
@@ -119,8 +155,8 @@ pango_cairo_win32_font_finalize (GObject *object)
if (cwfont->metrics)
pango_font_metrics_unref (cwfont->metrics);
- if (cwfont->cairo_font)
- cairo_font_destroy (cwfont->cairo_font);
+ if (cwfont->scaled_font)
+ cairo_scaled_font_destroy (cwfont->scaled_font);
cairo_matrix_destroy (cwfont->total_matrix);
cairo_matrix_destroy (cwfont->font_matrix);
@@ -135,18 +171,18 @@ pango_cairo_win32_font_get_glyph_extents (PangoFont *font,
PangoRectangle *logical_rect)
{
PangoCairoWin32Font *cwfont = PANGO_CAIRO_WIN32_FONT (font);
- cairo_font_t *cairo_font;
+ cairo_scaled_font_t *scaled__font;
cairo_text_extents_t extents;
cairo_glyph_t cairo_glyph;
- cairo_font = pango_cairo_win32_font_get_cairo_font (PANGO_CAIRO_FONT (font));
+ scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (font));
cairo_glyph.index = glyph;
cairo_glyph.x = 0;
cairo_glyph.y = 0;
- cairo_font_glyph_extents (cairo_font, cwfont->font_matrix,
- &cairo_glyph, 1, &extents);
+ cairo_scaled_font_glyph_extents (scaled_font, cwfont->font_matrix,
+ &cairo_glyph, 1, &extents);
if (ink_rect)
{
@@ -160,8 +196,8 @@ pango_cairo_win32_font_get_glyph_extents (PangoFont *font,
{
cairo_font_extents_t font_extents;
- cairo_font_extents (cairo_font, cwfont->font_matrix,
- &font_extents);
+ cairo_scaled_font_extents (scaled_font, cwfont->font_matrix,
+ &font_extents);
logical_rect->x = 0;
logical_rect->y = - font_extents.ascent * PANGO_SCALE;
@@ -179,14 +215,14 @@ pango_cairo_win32_font_get_metrics (PangoFont *font,
if (!cwfont->metrics)
{
double height;
- cairo_font_t *cairo_font;
+ cairo_sacled_font_t *scaled_font;
cairo_font_extents_t font_extents;
cwfont->metrics = pango_font_metrics_new ();
- cairo_font = pango_cairo_win32_font_get_cairo_font (PANGO_CAIRO_FONT (font));
+ scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (font));
- cairo_font_extents (cairo_font, cwfont->font_matrix,
- &font_extents);
+ cairo_scaled_font_extents (scaled_font, cwfont->font_matrix,
+ &font_extents);
cwfont->metrics->ascent = font_extents.ascent * PANGO_SCALE;
cwfont->metrics->descent = font_extents.ascent * PANGO_SCALE;
@@ -208,26 +244,26 @@ static gboolean
pango_cairo_win32_font_select_font (PangoFont *font,
HDC hdc)
{
- cairo_font_t *cairo_font = pango_cairo_win32_font_get_cairo_font (PANGO_CAIRO_FONT (font));
+ cairo_scaled_font_t *scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (font));
- return cairo_win32_font_select_font (cairo_font, hdc) == CAIRO_STATUS_SUCCESS;
+ return cairo_win32_scaled_font_select_font (scaled_font, hdc) == CAIRO_STATUS_SUCCESS;
}
static void
pango_cairo_win32_font_done_font (PangoFont *font)
{
- cairo_font_t *cairo_font = pango_cairo_win32_font_get_cairo_font (PANGO_CAIRO_FONT (font));
+ cairo_font_t *scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (font));
- cairo_win32_font_done_font (cairo_font);
+ cairo_win32_scaled_font_done_font (scaled_font);
}
static double
-pango_cairo_win32_font_get_scale_factor (PangoFont *font)
+pango_cairo_win32_font_get_metrics_factor (PangoFont *font)
{
PangoWin32Font *win32font = PANGO_WIN32_FONT (font);
- cairo_font_t *cairo_font = pango_cairo_win32_font_get_cairo_font (PANGO_CAIRO_FONT (font));
+ cairo_scaled_font_t *scaled_font = pango_cairo_win32_font_get_scaled_font (PANGO_CAIRO_FONT (font));
- return cairo_win32_font_get_scale_factor (cairo_font) * win32font->size;
+ return cairo_win32_scaled_font_get_metrics_factor (scaled_font) * win32font->size;
}
static void
@@ -244,7 +280,7 @@ pango_cairo_win32_font_class_init (PangoCairoWin32FontClass *class)
win32_font_class->select_font = pango_cairo_win32_font_select_font;
win32_font_class->done_font = pango_cairo_win32_font_done_font;
- win32_font_class->get_scale_factor = pango_cairo_win32_font_get_scale_factor;
+ win32_font_class->get_metrics_factor = pango_cairo_win32_font_get_metrics_factor;
}
static void
diff --git a/pango/pangowin32-private.h b/pango/pangowin32-private.h
index d8449385..6bb1389e 100644
--- a/pango/pangowin32-private.h
+++ b/pango/pangowin32-private.h
@@ -146,10 +146,10 @@ struct _PangoWin32FontClass
{
PangoFontClass parent_class;
- gboolean (*select_font) (PangoFont *font,
- HDC hdc);
- void (*done_font) (PangoFont *font);
- double (*get_scale_factor) (PangoFont *font);
+ gboolean (*select_font) (PangoFont *font,
+ HDC hdc);
+ void (*done_font) (PangoFont *font);
+ double (*get_metrics_factor) (PangoFont *font);
};
struct _PangoWin32Face
diff --git a/pango/pangowin32.c b/pango/pangowin32.c
index 3a140daf..a295941e 100644
--- a/pango/pangowin32.c
+++ b/pango/pangowin32.c
@@ -49,10 +49,10 @@ struct _PangoWin32MetricsInfo
static void pango_win32_font_dispose (GObject *object);
static void pango_win32_font_finalize (GObject *object);
-static gboolean pango_win32_font_real_select_font (PangoFont *font,
- HDC hdc);
-static void pango_win32_font_real_done_font (PangoFont *font);
-static double pango_win32_font_real_get_scale_factor (PangoFont *font);
+static gboolean pango_win32_font_real_select_font (PangoFont *font,
+ HDC hdc);
+static void pango_win32_font_real_done_font (PangoFont *font);
+static double pango_win32_font_real_get_metrics_factor (PangoFont *font);
static PangoFontDescription *pango_win32_font_describe (PangoFont *font);
static PangoCoverage *pango_win32_font_get_coverage (PangoFont *font,
@@ -74,7 +74,7 @@ static PangoFontMap * pango_win32_font_get_font_map (PangoFont
static gboolean pango_win32_font_real_select_font (PangoFont *font,
HDC hdc);
static void pango_win32_font_real_done_font (PangoFont *font);
-static double pango_win32_font_real_get_scale_factor (PangoFont *font);
+static double pango_win32_font_real_get_metrics_factor (PangoFont *font);
static HFONT pango_win32_get_hfont (PangoFont *font);
static void pango_win32_get_item_properties (PangoItem *item,
@@ -221,7 +221,7 @@ pango_win32_font_class_init (PangoWin32FontClass *class)
class->select_font = pango_win32_font_real_select_font;
class->done_font = pango_win32_font_real_done_font;
- class->get_scale_factor = pango_win32_font_real_get_scale_factor;
+ class->get_metrics_factor = pango_win32_font_real_get_metrics_factor;
pango_win32_get_dc ();
}
@@ -660,7 +660,7 @@ pango_win32_font_real_done_font (PangoFont *font)
}
static double
-pango_win32_font_real_get_scale_factor (PangoFont *font)
+pango_win32_font_real_get_metrics_factor (PangoFont *font)
{
return PANGO_SCALE;
}
@@ -729,7 +729,7 @@ pango_win32_font_done_font (PangoFont *font)
}
/**
- * pango_win32_font_get_scale_factor:
+ * pango_win32_font_get_metrics_factor:
* @font: a #PangoFont from the win32 backend
*
* Returns the scale factor from logical units in the coordinate
@@ -740,11 +740,11 @@ pango_win32_font_done_font (PangoFont *font)
* units.
**/
double
-pango_win32_font_get_scale_factor (PangoFont *font)
+pango_win32_font_get_metrics_factor (PangoFont *font)
{
g_return_val_if_fail (PANGO_WIN32_IS_FONT (font), 1.);
- return PANGO_WIN32_FONT_GET_CLASS (font)->get_scale_factor (font);
+ return PANGO_WIN32_FONT_GET_CLASS (font)->get_metrics_factor (font);
}
static void
diff --git a/pango/pangowin32.h b/pango/pangowin32.h
index 29903567..5a08f002 100644
--- a/pango/pangowin32.h
+++ b/pango/pangowin32.h
@@ -78,10 +78,10 @@ HDC pango_win32_get_dc (void);
gboolean pango_win32_get_debug_flag (void);
-gboolean pango_win32_font_select_font (PangoFont *font,
- HDC hdc);
-void pango_win32_font_done_font (PangoFont *font);
-double pango_win32_font_get_scale_factor (PangoFont *font);
+gboolean pango_win32_font_select_font (PangoFont *font,
+ HDC hdc);
+void pango_win32_font_done_font (PangoFont *font);
+double pango_win32_font_get_metrics_factor (PangoFont *font);
#endif