diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-04-04 00:36:30 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-04-04 00:36:30 +0000 |
commit | 2149bad49c6b0603daa2ee90d66a9f37d75f1eb9 (patch) | |
tree | 8611273faef107a30a29da4fdec6daa76a4d65cf | |
parent | f3542cd8e6a4f666b3c39cb8d562a88369d9e858 (diff) | |
download | pango-2149bad49c6b0603daa2ee90d66a9f37d75f1eb9.tar.gz |
Fix handling of positions at character limits.
Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com>
* pango/mapping.c (pango_glyph_string_x_to_index): Fix handling
of positions at character limits.
* modules/basic/basic.c (basic_engine_shape): Fix bug that
was causing mirrored characters not to mirror.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | ChangeLog.pre-1-0 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-1-2 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-1-4 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 8 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 8 | ||||
-rw-r--r-- | TODO | 8 | ||||
-rw-r--r-- | modules/basic/basic-x.c | 13 | ||||
-rw-r--r-- | modules/basic/basic.c | 13 | ||||
-rw-r--r-- | pango/mapping.c | 7 |
11 files changed, 88 insertions, 9 deletions
@@ -1,3 +1,11 @@ +Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com> + + * pango/mapping.c (pango_glyph_string_x_to_index): Fix handling + of positions at character limits. + + * modules/basic/basic.c (basic_engine_shape): Fix bug that + was causing mirrored characters not to mirror. + Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index 4b90b181..e495c272 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,11 @@ +Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com> + + * pango/mapping.c (pango_glyph_string_x_to_index): Fix handling + of positions at character limits. + + * modules/basic/basic.c (basic_engine_shape): Fix bug that + was causing mirrored characters not to mirror. + Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 4b90b181..e495c272 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,11 @@ +Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com> + + * pango/mapping.c (pango_glyph_string_x_to_index): Fix handling + of positions at character limits. + + * modules/basic/basic.c (basic_engine_shape): Fix bug that + was causing mirrored characters not to mirror. + Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 4b90b181..e495c272 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,11 @@ +Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com> + + * pango/mapping.c (pango_glyph_string_x_to_index): Fix handling + of positions at character limits. + + * modules/basic/basic.c (basic_engine_shape): Fix bug that + was causing mirrored characters not to mirror. + Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 4b90b181..e495c272 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,11 @@ +Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com> + + * pango/mapping.c (pango_glyph_string_x_to_index): Fix handling + of positions at character limits. + + * modules/basic/basic.c (basic_engine_shape): Fix bug that + was causing mirrored characters not to mirror. + Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 4b90b181..e495c272 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,11 @@ +Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com> + + * pango/mapping.c (pango_glyph_string_x_to_index): Fix handling + of positions at character limits. + + * modules/basic/basic.c (basic_engine_shape): Fix bug that + was causing mirrored characters not to mirror. + Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 4b90b181..e495c272 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,11 @@ +Mon Apr 3 20:30:20 2000 Owen Taylor <otaylor@redhat.com> + + * pango/mapping.c (pango_glyph_string_x_to_index): Fix handling + of positions at character limits. + + * modules/basic/basic.c (basic_engine_shape): Fix bug that + was causing mirrored characters not to mirror. + Mon Apr 3 15:16:06 2000 Owen Taylor <otaylor@redhat.com> * pango/glyphstring.c (pango_glyph_string_get_logical_widths): @@ -126,7 +126,9 @@ General * s/num_chars/n_chars/ etc. (Always use n_ as enumeration prefix) -* Underline attribute should be an enumeration (none/single/double/squiggle/low, - where low is below the ink rect - a style appropriate for underline - accelerators.) +* Fix handling of 'trailing' in x_to_index() to handle clusters + with more than one character where positioning is not allowed + inside the cluster. Uniscript sets trailing as 0 or number of j + characters in the glyph. (Trailing is currently a boolean + for us.) diff --git a/modules/basic/basic-x.c b/modules/basic/basic-x.c index 8f3c7f9e..838b5c42 100644 --- a/modules/basic/basic-x.c +++ b/modules/basic/basic-x.c @@ -434,14 +434,23 @@ basic_engine_shape (PangoFont *font, GUChar4 wc; FriBidiChar mirrored_ch; PangoGlyph index; + char buf[6]; + const char *input; _pango_utf8_iterate (p, &next, &wc); + input = p; if (analysis->level % 2) if (fribidi_get_mirror_char (wc, &mirrored_ch)) - wc = mirrored_ch; + { + wc = mirrored_ch; + + _pango_guchar4_to_utf8 (wc, buf); + input = buf; + } + - index = find_char (cache, font, wc, p); + index = find_char (cache, font, wc, input); if (index) { set_glyph (font, glyphs, i, p - text, index); diff --git a/modules/basic/basic.c b/modules/basic/basic.c index 8f3c7f9e..838b5c42 100644 --- a/modules/basic/basic.c +++ b/modules/basic/basic.c @@ -434,14 +434,23 @@ basic_engine_shape (PangoFont *font, GUChar4 wc; FriBidiChar mirrored_ch; PangoGlyph index; + char buf[6]; + const char *input; _pango_utf8_iterate (p, &next, &wc); + input = p; if (analysis->level % 2) if (fribidi_get_mirror_char (wc, &mirrored_ch)) - wc = mirrored_ch; + { + wc = mirrored_ch; + + _pango_guchar4_to_utf8 (wc, buf); + input = buf; + } + - index = find_char (cache, font, wc, p); + index = find_char (cache, font, wc, input); if (index) { set_glyph (font, glyphs, i, p - text, index); diff --git a/pango/mapping.c b/pango/mapping.c index c58a1187..3ed47c66 100644 --- a/pango/mapping.c +++ b/pango/mapping.c @@ -285,7 +285,7 @@ pango_glyph_string_x_to_index (PangoGlyphString *glyphs, char *p = text + start_index; int i = 0; - while (i + 1 < cp) + while (i + 1 <= cp) { p = unicode_next_utf8 (p); i++; @@ -293,8 +293,11 @@ pango_glyph_string_x_to_index (PangoGlyphString *glyphs, *index = (p - text); } + + /* FIXME: Handle multiple character clusters better + */ if (trailing) - *trailing = (cp - (int)cp) > 0.5 ? 1 : 0; + *trailing = (cp - (int)cp > 0.5) ? 1 : 0; } } |