summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@gnome.org>2008-12-07 22:16:06 -0600
committerJonathon Jongsma <jjongsma@gnome.org>2008-12-08 22:34:41 -0600
commit7924bd955ce2072539f83cea9b070a4897d0fb22 (patch)
treef2960103a127237feacec63095e32f4ecb533ffd
parentba26ea83e95563e8cc32223f2dbe4d8ea7089563 (diff)
Fix UserFontFace::init()
* cairomm/fontface.cc: Fix the default implementation of UserFontFace::init() to set up the font extents parameter correctly according to the documentation
-rw-r--r--ChangeLog5
-rw-r--r--cairomm/fontface.cc10
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f384c15..69dc6a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-12-07 Jonathon Jongsma <jonathon@quotidian.org>
+ * cairomm/fontface.cc: Fix the default implementation of UserFontFace::init()
+ to set up the font extents parameter correctly according to the documentation
+
+2008-12-07 Jonathon Jongsma <jonathon@quotidian.org>
+
* cairomm/fontface.cc: 'fix' the text_to_glyphs implementation so that the
default virtual function will be bypassed and the unicode_to_glyph will be
called instead. This is done in the C implementation by passing a negative
diff --git a/cairomm/fontface.cc b/cairomm/fontface.cc
index 0a57320..2d305bf 100644
--- a/cairomm/fontface.cc
+++ b/cairomm/fontface.cc
@@ -158,9 +158,15 @@ UserFontFace::init_cb(cairo_scaled_font_t* scaled_font,
ErrorStatus
UserFontFace::init(const RefPtr<ScaledFont>& /*scaled_font*/,
const RefPtr<Context>& /*cr*/,
- FontExtents& /*extents*/)
+ FontExtents& extents)
{
- // fallback behavior is to not do anything, just claim success
+ // fallback behavior is to set up the default text extents as described in the
+ // cairo API documentation
+ extents.ascent = 1.0;
+ extents.descent = 0.0;
+ extents.height = 1.0;
+ extents.max_x_advance = 1.0;
+ extents.max_y_advance = 0.0;
return CAIRO_STATUS_SUCCESS;
}