summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-08-22 23:12:28 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-08-22 23:12:28 +0000
commit58359bf5d1fcfb54a160992df44dd897854f5bdd (patch)
tree2d93486d8f62d9623b64cc644f56d7c8fc961072
parentbbd80fd4dd8739a497dd01ca7ffa2e695dfd30bf (diff)
downloadpango-58359bf5d1fcfb54a160992df44dd897854f5bdd.tar.gz
Find shaper/font for Private Use and space characters too. Finding shaper
2006-08-22 Behdad Esfahbod <behdad@gnome.org> * pango/pango-context.c (itemize_state_process_run): Find shaper/font for Private Use and space characters too. Finding shaper for Private Use is needed for any practical use of those areas. Ideally, spaces should be synthesized if they are not available in the font, but falling back to other fonts is far easier, and should give pretty good results with the current set of common fonts. These fixes allow Firefox+Pango to render MathML like Firefox+Xft does.
-rw-r--r--ChangeLog10
-rw-r--r--pango/pango-context.c10
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index eb71b5f6..f905f2c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2006-08-22 Behdad Esfahbod <behdad@gnome.org>
+ * pango/pango-context.c (itemize_state_process_run): Find shaper/font
+ for Private Use and space characters too. Finding shaper for Private
+ Use is needed for any practical use of those areas. Ideally, spaces
+ should be synthesized if they are not available in the font, but
+ falling back to other fonts is far easier, and should give pretty good
+ results with the current set of common fonts. These fixes allow
+ Firefox+Pango to render MathML like Firefox+Xft does.
+
+2006-08-22 Behdad Esfahbod <behdad@gnome.org>
+
* pango/fonts.c (gravity_map): Rename "Upright" to "Not-Rotated".
Also, reorder the user-friendly names (Not-Rotated, Rotated-Left, ...)
before the enum names (South, East, ...) such that they are used to
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 6044dafc..0d8c3def 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -1257,17 +1257,19 @@ itemize_state_process_run (ItemizeState *state)
/* 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.
- * To make this really work well, we'd need to emulate missing
- * space characters, which we don't yet do, so we sometimes
- * will get hex boxes.
*
* The exception of U+3000 (IDEOGRAPHIC SPACE) here is because we
* want to choose an ideographic space that matches ideographic text
* in cell width. Even if we were emulating missing spaces, an
* emulated ideographic space for the primary font wouldn't be the
* right size.
+ *
+ * The exception of PrivateUse characters is indeed necessary to be
+ * able to render any of them.
*/
- if (!g_unichar_isgraph (wc) && wc != 0x3000)
+ if (G_UNLIKELY (!g_unichar_isgraph (wc) &&
+ !g_unichar_isspace (wc) /*wc != 0x3000*/ &&
+ g_unichar_type (wc) != G_UNICODE_PRIVATE_USE))
{
shape_engine = NULL;
font = NULL;