[pango/round-glyphs-option: 2/3] layout: Use the new glyph rounding option



commit e3e59be0e618ee34b9255e390e73a3ce27a5abb5
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 3 16:00:50 2019 -0400

    layout: Use the new glyph rounding option
    
    Take the glyph rounding option from PangoContext
    and translate it into a shape flag.

 pango/pango-layout.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 521f806a..0ddb6e14 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3354,14 +3354,20 @@ shape_run (PangoLayoutLine *line,
     shape_tab (line, item, glyphs);
   else
     {
+      PangoShapeFlags shape_flags = PANGO_SHAPE_NONE;
+
+      if (pango_context_get_round_glyph_positions (layout->context))
+        shape_flags |= PANGO_SHAPE_ROUND_POSITIONS;
+
       if (state->properties.shape_set)
        _pango_shape_shape (layout->text + item->offset, item->num_chars,
                            state->properties.shape_ink_rect, state->properties.shape_logical_rect,
                            glyphs);
       else
-        pango_shape_full (layout->text + item->offset, item->length,
-                          layout->text, layout->length,
-                          &item->analysis, glyphs);
+        pango_shape_with_flags (layout->text + item->offset, item->length,
+                                layout->text, layout->length,
+                                &item->analysis, glyphs,
+                                shape_flags);
 
       if (state->properties.letter_spacing)
        {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]