[pango/no-space-box: 6/7] cairo: Don't render hex box for space



commit e2e2e7f10ff352ccdc9d4ced4e71a5d73f4177a8
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 6 16:44:39 2019 -0400

    cairo: Don't render hex box for space
    
    Even if a font has no space glyph, we don't want
    to render a hex box for it, since just rendering
    nothing does a decent approximation of space.

 pango/pangocairo-render.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c
index d3b3d34d..99154e77 100644
--- a/pango/pangocairo-render.c
+++ b/pango/pangocairo-render.c
@@ -507,7 +507,12 @@ pango_cairo_renderer_show_text_glyphs (PangoRenderer        *renderer,
                      base_y + (double)(gi->geometry.y_offset) / PANGO_SCALE;
 
          if (gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG)
-           _pango_cairo_renderer_draw_unknown_glyph (crenderer, font, gi, cx, cy);
+            {
+              if (gi->glyph == (0x20 | PANGO_GLYPH_UNKNOWN_FLAG))
+                ; /* no hex boxes for space, please */
+              else
+               _pango_cairo_renderer_draw_unknown_glyph (crenderer, font, gi, cx, cy);
+            }
          else
            {
              cairo_glyphs[count].index = gi->glyph;


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