summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-02-05 03:53:22 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-02-05 03:53:22 +0000
commitca73084fad58044f6219fce2e5d0c497f4bbeac0 (patch)
tree2d11693734771c7211b33cb8e3da78e09adb4f23
parentd75a6af20ecaf1cfb76c723b2e626d850e0d6d1e (diff)
downloadpango-ca73084fad58044f6219fce2e5d0c497f4bbeac0.tar.gz
Bug 324408 – tab can result in 0 characters
2006-02-04 Behdad Esfahbod <behdad@gnome.org> Bug 324408 – tab can result in 0 characters * pango/pango-layout.c (shape_tab): Make sure there is at least an space-width of space between tab-aligned text and the text before it.
-rw-r--r--ChangeLog8
-rw-r--r--pango/pango-layout.c9
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b3e0f3c8..ab231f8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2006-02-04 Behdad Esfahbod <behdad@gnome.org>
+ Bug 324408 – tab can result in 0 characters
+
+ * pango/pango-layout.c (shape_tab): Make sure there is
+ at least an space-width of space between tab-aligned text
+ and the text before it.
+
+2006-02-04 Behdad Esfahbod <behdad@gnome.org>
+
Bug 329528 – implement --wrap in examples/renderdemo.c
Patch from Antoine Dopffer.
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 8e006284..ba555b8c 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2566,7 +2566,6 @@ get_tab_pos (PangoLayout *layout, int index)
}
else
{
- ensure_tab_width (layout);
tab_width = layout->tab_width;
}
@@ -2576,7 +2575,6 @@ get_tab_pos (PangoLayout *layout, int index)
{
/* No tab array set, so use default tab width
*/
- ensure_tab_width (layout);
return layout->tab_width * index;
}
}
@@ -2606,7 +2604,7 @@ static void
shape_tab (PangoLayoutLine *line,
PangoGlyphString *glyphs)
{
- int i;
+ int i, space_width;
int current_width = line_width (line);
@@ -2619,10 +2617,13 @@ shape_tab (PangoLayoutLine *line,
glyphs->log_clusters[0] = 0;
+ ensure_tab_width (line->layout);
+ space_width = line->layout->tab_width / 8;
+
for (i=0;;i++)
{
int tab_pos = get_tab_pos (line->layout, i);
- if (tab_pos > current_width)
+ if (tab_pos >= current_width + space_width)
{
glyphs->glyphs[0].geometry.width = tab_pos - current_width;
break;