summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2021-08-09 16:22:22 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2021-08-09 16:27:59 +0800
commitdf0217a3f46c77b743fa1ae1ddfc2bb321ba91e8 (patch)
treeb5af1ef9ae3fc60f5f8eecf633850b0454cd89ca
parent67a02a8fd7f6a7e2a8d68a48b71535a654518de9 (diff)
downloadpango-df0217a3f46c77b743fa1ae1ddfc2bb321ba91e8.tar.gz
pango/shape.c: Use the former rounding code as needed
The careful rounding code that was brought back as a result of commit d4356779 only had effect if we are using a backend that supported font hinting, so on other backends, use the former rounding code that was dropped in favor of the careful rounding code that unfortunately did not apply for all backends. Should fix #578.
-rw-r--r--pango/shape.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pango/shape.c b/pango/shape.c
index f8ac3691..aed028b7 100644
--- a/pango/shape.c
+++ b/pango/shape.c
@@ -341,5 +341,17 @@ pango_shape_with_flags (const gchar *item_text,
#undef HINT
}
}
+ 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);
+ }
+ }
}
}