summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-07-28 10:50:35 -0400
committerMatthias Clasen <mclasen@redhat.com>2019-07-12 18:27:48 -0400
commit8048a76b713e00004afa4a4ca9ba969c638e0d23 (patch)
tree3031706b92055e75aa259ca8a60e8546a8963791 /pango
parentccdc4d81a6d4ee6d21c1471556b62900a856b8c1 (diff)
downloadpango-8048a76b713e00004afa4a4ca9ba969c638e0d23.tar.gz
shape: Stop rounding glyph positions
As we move towards subpixel positioning and unhinted rendering, rounding the glyph positions and widths between shaping and rendering is counterproductive. So stop doing that.
Diffstat (limited to 'pango')
-rw-r--r--pango/pangofc-shape.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c
index d914a3b7..6cdf6b27 100644
--- a/pango/pangofc-shape.c
+++ b/pango/pangofc-shape.c
@@ -415,62 +415,6 @@ _pango_fc_shape (PangoFont *font,
hb_position++;
}
- if (PANGO_IS_FC_FONT (font))
- {
- PangoFcFont *fc_font = PANGO_FC_FONT (font);
- if (fc_font->is_hinted)
- {
- double x_scale_inv, y_scale_inv;
- double x_scale, y_scale;
- PangoFcFontKey *key;
-
- x_scale_inv = y_scale_inv = 1.0;
- key = _pango_fc_font_get_font_key (fc_font);
- if (key)
- {
- const PangoMatrix *matrix = pango_fc_font_key_get_matrix (key);
- pango_matrix_get_font_scale_factors (matrix, &x_scale_inv, &y_scale_inv);
- }
- if (PANGO_GRAVITY_IS_IMPROPER (analysis->gravity))
- {
- x_scale_inv = -x_scale_inv;
- y_scale_inv = -y_scale_inv;
- }
- x_scale = 1. / x_scale_inv;
- y_scale = 1. / y_scale_inv;
-
- if (x_scale == 1.0 && y_scale == 1.0)
- {
- for (i = 0; i < num_glyphs; i++)
- infos[i].geometry.width = PANGO_UNITS_ROUND (infos[i].geometry.width);
- }
- else
- {
-#if 0
- if (PANGO_GRAVITY_IS_VERTICAL (analysis->gravity))
- {
- /* XXX */
- double tmp = x_scale;
- x_scale = y_scale;
- y_scale = -tmp;
- }
-#endif
-#define HINT(value, scale_inv, scale) (PANGO_UNITS_ROUND ((int) ((value) * scale)) * scale_inv)
-#define HINT_X(value) HINT ((value), x_scale, x_scale_inv)
-#define HINT_Y(value) HINT ((value), y_scale, y_scale_inv)
- for (i = 0; i < num_glyphs; i++)
- {
- infos[i].geometry.width = HINT_X (infos[i].geometry.width);
- infos[i].geometry.x_offset = HINT_X (infos[i].geometry.x_offset);
- infos[i].geometry.y_offset = HINT_Y (infos[i].geometry.y_offset);
- }
-#undef HINT_Y
-#undef HINT_X
-#undef HINT
- }
- }
- }
-
release_buffer (hb_buffer, free_buffer);
hb_font_destroy (hb_font);
}