summaryrefslogtreecommitdiff
path: root/pango/pango-context.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2013-06-06 19:57:55 -0400
committerBehdad Esfahbod <behdad@behdad.org>2013-06-06 19:59:54 -0400
commitd489ad061d70526fc5f5cdae2273e9deabea6a17 (patch)
treebb7ea1966d139fa56d701a522098500fe7c9e4b5 /pango/pango-context.c
parente17b595e3bacfb7333bab6fcd1c62d05e7228936 (diff)
downloadpango-d489ad061d70526fc5f5cdae2273e9deabea6a17.tar.gz
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
Diffstat (limited to 'pango/pango-context.c')
-rw-r--r--pango/pango-context.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 6c61d777..8e967134 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))
{