[pango] Don't change fonts just for space characters



commit d489ad061d70526fc5f5cdae2273e9deabea6a17
Author: Behdad Esfahbod <behdad behdad org>
Date:   Thu Jun 6 19:57:55 2013 -0400

    Don't change fonts just for space characters
    
    Back in the days we used to always use the font from surrounding runs
    for any space characters.  I changed that when I found that rendering
    MathML results in hexboxes when a font doesn't have the space characters
    needed...
    
    Forward to these days: HarfBuzz will silently compatibility-decompose
    any space character to the ASCII space.  And looks like it's important
    for Mongolian to not break runs around NNBSP.  As such, go back to never
    choosing a font just for space characters.
    
    Seems to work, though more testing is needed.
    
    Bug 701652 - wrong shaped classic Mongolian word suffixes

 pango/pango-context.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 6c61d77..8e96713 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -1447,17 +1447,17 @@ itemize_state_process_run (ItemizeState *state)
       PangoFont *font;
 
       /* We don't want space characters to affect font selection; in general,
-       * it's always wrong to select a font just to render a space.  But until
-       * we have a better solution, choosing a font for spaces seems to work
-       * better.  However, all fonts are assumed to cover ASCII space, so that
-       * one is an exception.  See bug #355987.
+       * it's always wrong to select a font just to render a space.
+       * We assume that all fonts have the ASCII space, and for other space
+       * characters if they don't, HarfBuzz will compatibility-decompose them
+       * to ASCII space...
+       * See bugs #355987 and #701652.
        *
        * The exception of PrivateUse and Unassigned characters is necessary
        * to be able to render any of them. (for private or being encoded
        * scripts, etc.) (Recent glib returns true in isprint for PrivateUse.)
        */
-      if (wc == 0x0020 ||
-         G_UNLIKELY (!g_unichar_isprint (wc) &&
+      if (G_UNLIKELY (!g_unichar_isgraph (wc) &&
                      g_unichar_type (wc) != G_UNICODE_PRIVATE_USE &&
                      g_unichar_type (wc) != G_UNICODE_UNASSIGNED))
        {


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