[pango/userfont: 5/15] adapt cairoshape example
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/userfont: 5/15] adapt cairoshape example
- Date: Fri, 28 Jan 2022 14:04:51 +0000 (UTC)
commit 1f5410564a3181cd9a18494f2f87a4a035803c94
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jan 27 21:09:43 2022 -0500
adapt cairoshape example
examples/cairoshape.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/examples/cairoshape.c b/examples/cairoshape.c
index 322eb5d9..92a73d11 100644
--- a/examples/cairoshape.c
+++ b/examples/cairoshape.c
@@ -218,6 +218,17 @@ extents_cb (PangoHbFace *face,
return TRUE;
}
+static void
+font_extents_cb (PangoHbFace *face,
+ int size,
+ hb_font_extents_t *extents,
+ gpointer user_data)
+{
+ extents->ascender = size;
+ extents->descender = 0;
+ extents->line_gap = 0;
+}
+
static void
render_cb (PangoHbFace *face,
int size,
@@ -250,7 +261,7 @@ setup_fontmap (PangoHbFontMap *fontmap)
face = pango_hb_face_new_from_file ("/usr/share/fonts/adobe-source-code-pro/SourceCodePro-Black.otf",
0, -1, "Black", desc);
#endif
- face = pango_hb_face_new_user (glyph_cb, advance_cb, extents_cb, render_cb, NULL, NULL, "Black", desc);
+ face = pango_hb_face_new_user (font_extents_cb, glyph_cb, advance_cb, extents_cb, render_cb, NULL, NULL,
"Black", desc);
pango_hb_font_map_add_face (fontmap, face);
pango_font_description_free (desc);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]