[pango/wip/kill-shape-engine-win32: 13/25] shape: Stop rounding glyph positions
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/wip/kill-shape-engine-win32: 13/25] shape: Stop rounding glyph positions
- Date: Tue, 16 Jul 2019 10:44:16 +0000 (UTC)
commit cb47a662494b3a9d94f6576ead5f8cbea2f5578d
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 28 10:50:35 2018 -0400
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.
pango/pangofc-shape.c | 56 ---------------------------------------------------
1 file changed, 56 deletions(-)
---
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c
index 59b90c40..aeec21e2 100644
--- a/pango/pangofc-shape.c
+++ b/pango/pangofc-shape.c
@@ -202,61 +202,5 @@ _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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]