summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-07-24 19:04:54 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-07-24 19:04:54 +0000
commitbf9223a0e92ce4323f6e7840df4d9b08f35268a6 (patch)
treef7b1e5c41a24d52493612bbdf24db4a9bf79c987
parent56033f7c11ae51ef570be80c12ab72b75b68deb5 (diff)
downloadpango-bf9223a0e92ce4323f6e7840df4d9b08f35268a6.tar.gz
Fix up right-to-left case. (Based on patch from Damon Chaplin, #117325)
Thu Jul 24 15:02:56 2003 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): Fix up right-to-left case. (Based on patch from Damon Chaplin, #117325)
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-1-106
-rw-r--r--ChangeLog.pre-1-46
-rw-r--r--ChangeLog.pre-1-66
-rw-r--r--ChangeLog.pre-1-86
-rw-r--r--pango/glyphstring.c11
6 files changed, 37 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 750ff886..15b8cf24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jul 24 15:02:56 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/glyphstring.c (pango_glyph_string_get_logical_widths):
+ Fix up right-to-left case. (Based on patch from
+ Damon Chaplin, #117325)
+
Thu Jul 24 14:35:48 2003 Owen Taylor <otaylor@redhat.com>
* pango/pango-utils.c (pango_language_matches): Increment
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 750ff886..15b8cf24 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,9 @@
+Thu Jul 24 15:02:56 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/glyphstring.c (pango_glyph_string_get_logical_widths):
+ Fix up right-to-left case. (Based on patch from
+ Damon Chaplin, #117325)
+
Thu Jul 24 14:35:48 2003 Owen Taylor <otaylor@redhat.com>
* pango/pango-utils.c (pango_language_matches): Increment
diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4
index 750ff886..15b8cf24 100644
--- a/ChangeLog.pre-1-4
+++ b/ChangeLog.pre-1-4
@@ -1,3 +1,9 @@
+Thu Jul 24 15:02:56 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/glyphstring.c (pango_glyph_string_get_logical_widths):
+ Fix up right-to-left case. (Based on patch from
+ Damon Chaplin, #117325)
+
Thu Jul 24 14:35:48 2003 Owen Taylor <otaylor@redhat.com>
* pango/pango-utils.c (pango_language_matches): Increment
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index 750ff886..15b8cf24 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,9 @@
+Thu Jul 24 15:02:56 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/glyphstring.c (pango_glyph_string_get_logical_widths):
+ Fix up right-to-left case. (Based on patch from
+ Damon Chaplin, #117325)
+
Thu Jul 24 14:35:48 2003 Owen Taylor <otaylor@redhat.com>
* pango/pango-utils.c (pango_language_matches): Increment
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 750ff886..15b8cf24 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,9 @@
+Thu Jul 24 15:02:56 2003 Owen Taylor <otaylor@redhat.com>
+
+ * pango/glyphstring.c (pango_glyph_string_get_logical_widths):
+ Fix up right-to-left case. (Based on patch from
+ Damon Chaplin, #117325)
+
Thu Jul 24 14:35:48 2003 Owen Taylor <otaylor@redhat.com>
* pango/pango-utils.c (pango_language_matches): Increment
diff --git a/pango/glyphstring.c b/pango/glyphstring.c
index 6fad2a35..4c10f56e 100644
--- a/pango/glyphstring.c
+++ b/pango/glyphstring.c
@@ -281,17 +281,20 @@ pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
int last_cluster = 0;
int width = 0;
int last_cluster_width = 0;
- const char *p = text;
+ const char *p = text; /* Points to start of current cluster */
for (i=0; i<=glyphs->num_glyphs; i++)
{
int glyph_index = (embedding_level % 2 == 0) ? i : glyphs->num_glyphs - i - 1;
-
+
+ /* If this glyph belongs to a new cluster, or we're at the end, find
+ * the start of the next cluster, and assign the widths for this cluster.
+ */
if (i == glyphs->num_glyphs || p != text + glyphs->log_clusters[glyph_index])
{
int next_cluster = last_cluster;
- if (glyph_index > 0 && glyph_index < glyphs->num_glyphs)
+ if (i < glyphs->num_glyphs)
{
while (p < text + glyphs->log_clusters[glyph_index])
{
@@ -316,7 +319,7 @@ pango_glyph_string_get_logical_widths (PangoGlyphString *glyphs,
}
if (i < glyphs->num_glyphs)
- width += glyphs->glyphs[i].geometry.width;
+ width += glyphs->glyphs[glyph_index].geometry.width;
}
}