diff options
author | Jonathon Jongsma <jjongsma@gnome.org> | 2008-12-07 22:16:06 -0600 |
---|---|---|
committer | Jonathon Jongsma <jjongsma@gnome.org> | 2008-12-08 22:34:41 -0600 |
commit | 7924bd955ce2072539f83cea9b070a4897d0fb22 (patch) | |
tree | f2960103a127237feacec63095e32f4ecb533ffd | |
parent | ba26ea83e95563e8cc32223f2dbe4d8ea7089563 (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-- | ChangeLog | 5 | ||||
-rw-r--r-- | cairomm/fontface.cc | 10 |
2 files changed, 13 insertions, 2 deletions
@@ -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; } |