summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-01-30 23:57:25 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-01-30 23:57:25 +0000
commit71f0113fe55447c026fb00115c552a8762bf9e91 (patch)
tree174c103289d099fed851247b0c470cd81ea3ebe1 /pango
parenta117cdd81062b15b0b1021cfaf19a291b4faa773 (diff)
downloadpango-71f0113fe55447c026fb00115c552a8762bf9e91.tar.gz
Oops, removed all my changes the other time :(
2006-01-30 Behdad Esfahbod <behdad@gnome.org> Bug 328314 – Examples should use GOption instead of argcontext.c Patch from Antoine Dopffer. * examples/renderdemo.c: Use GOption for parsing cmd-line options. * examples/argcontext.c, examples/argcontext.h: Removed.
Diffstat (limited to 'pango')
-rw-r--r--pango/shape.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/pango/shape.c b/pango/shape.c
index 03020153..3020007a 100644
--- a/pango/shape.c
+++ b/pango/shape.c
@@ -44,12 +44,12 @@ pango_shape (const gchar *text,
int i;
int last_cluster = -1;
- if (analysis->shape_engine)
+ if (G_LIKELY (analysis->shape_engine && analysis->font))
{
_pango_engine_shape_shape (analysis->shape_engine, analysis->font,
text, length, analysis, glyphs);
- if (G_UNLIKELY (glyphs->num_glyphs == 0 && analysis->font))
+ if (G_UNLIKELY (glyphs->num_glyphs == 0))
{
/* If a font has been correctly chosen, but no glyphs are output,
* there's probably something wrong with the shaper. Trying to be
@@ -81,7 +81,25 @@ pango_shape (const gchar *text,
}
}
else
- glyphs->num_glyphs = 0;
+ {
+ static struct {
+ guint font : 1;
+ guint shape_engine : 1;
+ } warned = { FALSE, FALSE };
+
+ if (!analysis->shape_engine && !warned.shape_engine)
+ {
+ g_critical ("pango_shape called with analysis->shape_engine == NULL");
+ warned.font = TRUE;
+ }
+ if (!analysis->font && !warned.font)
+ {
+ g_critical ("pango_shape called with analysis->font == NULL");
+ warned.font = TRUE;
+ }
+
+ glyphs->num_glyphs = 0;
+ }
if (!glyphs->num_glyphs)
{