summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-12-16 12:57:07 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-12-16 12:57:07 +0000
commit31a0ed6916294d61151f3f433deb139242439fd8 (patch)
tree024a475212f65a1e37d743fed52c53d709962f2e
parent8b63dd7081fb8241718317f9e32773494a3a7be5 (diff)
parentfb1b864f43966e1018e0aa5a17de001bc17b0a49 (diff)
downloadpango-31a0ed6916294d61151f3f433deb139242439fd8.tar.gz
Merge branch 'pango-1-48-backports' into 'pango-1-48'
Backport MR !399 into pango-1-48 See merge request GNOME/pango!549
-rw-r--r--pango/shape.c12
-rw-r--r--tests/testmisc.c7
2 files changed, 19 insertions, 0 deletions
diff --git a/pango/shape.c b/pango/shape.c
index 401c9ec1..0b757b1a 100644
--- a/pango/shape.c
+++ b/pango/shape.c
@@ -370,5 +370,17 @@ pango_shape_with_flags (const gchar *item_text,
}
}
}
+ else
+ {
+ for (i = 0; i < glyphs->num_glyphs; i++)
+ {
+ glyphs->glyphs[i].geometry.width =
+ PANGO_UNITS_ROUND (glyphs->glyphs[i].geometry.width);
+ glyphs->glyphs[i].geometry.x_offset =
+ PANGO_UNITS_ROUND (glyphs->glyphs[i].geometry.x_offset);
+ glyphs->glyphs[i].geometry.y_offset =
+ PANGO_UNITS_ROUND (glyphs->glyphs[i].geometry.y_offset);
+ }
+ }
}
}
diff --git a/tests/testmisc.c b/tests/testmisc.c
index fe2e9075..69fc3019 100644
--- a/tests/testmisc.c
+++ b/tests/testmisc.c
@@ -22,7 +22,10 @@
#include "config.h"
#include <glib.h>
#include <pango/pangocairo.h>
+
+#ifdef HAVE_CAIRO_FREETYPE
#include <pango/pango-ot.h>
+#endif
/* test that we don't crash in shape_tab when the layout
* is such that we don't have effective attributes
@@ -245,6 +248,7 @@ test_gravity_for_script (void)
}
}
+#ifdef HAVE_CAIRO_FREETYPE
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
@@ -264,6 +268,7 @@ test_language_to_tag (void)
}
G_GNUC_END_IGNORE_DEPRECATIONS
+#endif
static void
test_fallback_shape (void)
@@ -319,7 +324,9 @@ main (int argc, char *argv[])
g_test_add_func ("/gravity/from-matrix", test_gravity_from_matrix);
g_test_add_func ("/gravity/for-script", test_gravity_for_script);
g_test_add_func ("/layout/fallback-shape", test_fallback_shape);
+#ifdef HAVE_CAIRO_FREETYPE
g_test_add_func ("/language/to-tag", test_language_to_tag);
+#endif
return g_test_run ();
}