[gtk+/wip/matthiasc/font-variations: 219/219] add some debug spew
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/font-variations: 219/219] add some debug spew
- Date: Fri, 8 Sep 2017 18:25:37 +0000 (UTC)
commit 4eec395cff3c06fa3d1693965b7b2e0d61a07cf5
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 8 14:23:48 2017 -0400
add some debug spew
gsk/gskrendernodeimpl.c | 34 ++++++++++++++++++++++++++++++++++
gsk/meson.build | 1 +
meson.build | 2 ++
3 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 6ddbb2b..3a77b98 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -27,6 +27,11 @@
#include "gsktextureprivate.h"
#include <cairo-ft.h>
+#if 0
+#include <hb-ot.h>
+#include <hb-ft.h>
+#include <pango/pangoft2.h>
+#endif
static gboolean
check_variant_type (GVariant *variant,
@@ -4040,10 +4045,39 @@ gsk_text_node_new (PangoFont *font,
{
GskTextNode *self;
PangoRectangle ink_rect;
+#if 0
+ FT_Face ft_face;
+ hb_font_t *hb_font;
+ hb_face_t *hb_face;
+ guint n_axes;
+ hb_ot_var_axis_t *axes;
+ int *values;
+ guint n_values;
+ int i;
+#endif
pango_glyph_string_extents (glyphs, font, &ink_rect, NULL);
pango_extents_to_pixels (&ink_rect, NULL);
+#if 0
+ ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (font)),
+ hb_font = hb_ft_font_create (ft_face, NULL);
+ hb_face = hb_font_get_face (hb_font);
+ n_axes = hb_ot_var_get_axis_count (hb_face);
+ axes = g_new (hb_ot_var_axis_t, n_axes);
+ hb_ot_var_get_axes (hb_face, 0, &n_axes, axes);
+ values = hb_font_get_var_coords_normalized (hb_font, &n_values);
+ for (i = 0; i < n_values; i++)
+ {
+ hb_ot_var_axis_t *axis = &axes[i];
+ char tag[5];
+ hb_tag_to_string (axis->tag, tag);
+ tag[4] = 0;
+ g_print ("axis %s: %g - %g - %g: value %g\n",
+ tag, axis->min_value, axis->default_value, axis->max_value, ((double)values[i])/16384.);
+ }
+#endif
+
/* Don't create nodes with empty bounds */
if (ink_rect.width == 0 || ink_rect.height == 0)
return NULL;
diff --git a/gsk/meson.build b/gsk/meson.build
index 3c1278f..8a4da26 100644
--- a/gsk/meson.build
+++ b/gsk/meson.build
@@ -111,6 +111,7 @@ gsk_gen_headers = [ gskenum_h, ]
gsk_deps = [
graphene_dep,
pango_dep,
+ harfbuzz_dep,
cairo_dep,
pixbuf_dep,
libgdk_dep,
diff --git a/meson.build b/meson.build
index 0b1df53..ce32afc 100644
--- a/meson.build
+++ b/meson.build
@@ -26,6 +26,7 @@ endif
glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req)
pango_req = '>= 1.37.3'
+harfbuzz_req = '>= 1.4.2'
atk_req = '>= 2.15.1'
cairo_req = '>= 1.14.0'
gdk_pixbuf_req = '>= 2.30.0'
@@ -319,6 +320,7 @@ pango_dep = dependency('pango', version: pango_req)
pangoft_dep = dependency('pangoft2', required: wayland_enabled or x11_enabled)
cairo_dep = dependency('cairo', version: cairo_req)
pangocairo_dep = dependency('pangocairo', version: cairo_req)
+harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req)
cairogobj_dep = dependency('cairo-gobject', version: cairo_req)
pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req)
epoxy_dep = dependency('epoxy', version: epoxy_req,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]