summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJody Goldberg <jody@gnome.org>2004-05-28 04:32:04 +0000
committerJody Goldberg <jody@src.gnome.org>2004-05-28 04:32:04 +0000
commitc4ee717810300dde325af4fd818b787dcc25316a (patch)
tree4da8293dbbee3a2c7c489bdb1cb07f57e956ac05
parent2b0569285270c365f74d36fde991d193e7d82462 (diff)
downloadpango-c4ee717810300dde325af4fd818b787dcc25316a.tar.gz
Backport to 1.4.x
2004-04-29 Jody Goldberg <jody@gnome.org> * pango/pango-layout.c (get_alignment) : only invert if the layout and the context really disagree, not if they are WEAK_LTR vs LTR 2004-03-11 Jody Goldberg <jody@gnome.org> * pango/pango-attributes.h : Add a comment clarifying that PangoAttribute::end_index is _exclusive_. The range is [start..end) Additionally clarify that that the indicies are in _bytes_ not characters.
-rw-r--r--ChangeLog12
-rw-r--r--ChangeLog.pre-1-1012
-rw-r--r--ChangeLog.pre-1-612
-rw-r--r--ChangeLog.pre-1-812
-rw-r--r--docs/tmpl/text-attributes.sgml6
-rw-r--r--pango/pango-attributes.h4
-rw-r--r--pango/pango-layout.c21
7 files changed, 73 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b292b5eb..97e155d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,18 @@ Thu May 27 15:42:20 2004 Owen Taylor <otaylor@redhat.com>
* pango/break.c (pango_break):
Fix incorrect casts to get the class object of lang engine. (#141931)
+2004-04-29 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-layout.c (get_alignment) : only invert if the layout and
+ the context really disagree, not if they are WEAK_LTR vs LTR
+
+2004-03-11 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-attributes.h : Add a comment clarifying that
+ PangoAttribute::end_index is _exclusive_. The range is [start..end)
+ Additionally clarify that that the indicies are in _bytes_ not
+ characters.
+
2004-04-29 Tor Lillqvist <tml@iki.fi>
* pango/pangowin32-fontmap.c (pango_win32_font_map_for_display):
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index b292b5eb..97e155d1 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -19,6 +19,18 @@ Thu May 27 15:42:20 2004 Owen Taylor <otaylor@redhat.com>
* pango/break.c (pango_break):
Fix incorrect casts to get the class object of lang engine. (#141931)
+2004-04-29 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-layout.c (get_alignment) : only invert if the layout and
+ the context really disagree, not if they are WEAK_LTR vs LTR
+
+2004-03-11 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-attributes.h : Add a comment clarifying that
+ PangoAttribute::end_index is _exclusive_. The range is [start..end)
+ Additionally clarify that that the indicies are in _bytes_ not
+ characters.
+
2004-04-29 Tor Lillqvist <tml@iki.fi>
* pango/pangowin32-fontmap.c (pango_win32_font_map_for_display):
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index b292b5eb..97e155d1 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -19,6 +19,18 @@ Thu May 27 15:42:20 2004 Owen Taylor <otaylor@redhat.com>
* pango/break.c (pango_break):
Fix incorrect casts to get the class object of lang engine. (#141931)
+2004-04-29 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-layout.c (get_alignment) : only invert if the layout and
+ the context really disagree, not if they are WEAK_LTR vs LTR
+
+2004-03-11 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-attributes.h : Add a comment clarifying that
+ PangoAttribute::end_index is _exclusive_. The range is [start..end)
+ Additionally clarify that that the indicies are in _bytes_ not
+ characters.
+
2004-04-29 Tor Lillqvist <tml@iki.fi>
* pango/pangowin32-fontmap.c (pango_win32_font_map_for_display):
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index b292b5eb..97e155d1 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -19,6 +19,18 @@ Thu May 27 15:42:20 2004 Owen Taylor <otaylor@redhat.com>
* pango/break.c (pango_break):
Fix incorrect casts to get the class object of lang engine. (#141931)
+2004-04-29 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-layout.c (get_alignment) : only invert if the layout and
+ the context really disagree, not if they are WEAK_LTR vs LTR
+
+2004-03-11 Jody Goldberg <jody@gnome.org>
+
+ * pango/pango-attributes.h : Add a comment clarifying that
+ PangoAttribute::end_index is _exclusive_. The range is [start..end)
+ Additionally clarify that that the indicies are in _bytes_ not
+ characters.
+
2004-04-29 Tor Lillqvist <tml@iki.fi>
* pango/pangowin32-fontmap.c (pango_win32_font_map_for_display):
diff --git a/docs/tmpl/text-attributes.sgml b/docs/tmpl/text-attributes.sgml
index ae6add8f..2e1adb8c 100644
--- a/docs/tmpl/text-attributes.sgml
+++ b/docs/tmpl/text-attributes.sgml
@@ -75,9 +75,9 @@ applies.
</para>
@klass: the class structure holding information about the type of the attribute
-@start_index: the start index of the range.
-@end_index: end index of the range. The character at this index is not
- included in the range.
+@start_index: the start index of the range (in bytes).
+@end_index: end index of the range. The character containing this byte index is
+ not included in the range.
<!-- ##### STRUCT PangoAttrString ##### -->
<para>
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h
index b3dd3fa3..4488d3e9 100644
--- a/pango/pango-attributes.h
+++ b/pango/pango-attributes.h
@@ -95,8 +95,8 @@ typedef enum {
struct _PangoAttribute
{
const PangoAttrClass *klass;
- guint start_index;
- guint end_index;
+ guint start_index; /* in bytes */
+ guint end_index; /* the character containing this byte is not included */
};
typedef gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute,
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index ae5580b3..cf070263 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -1833,6 +1833,24 @@ pango_layout_get_cursor_pos (PangoLayout *layout,
}
}
+static inline int
+direction_simple (PangoDirection d)
+{
+ switch (d)
+ {
+ case PANGO_DIRECTION_LTR : return 1;
+ case PANGO_DIRECTION_RTL : return -1;
+ case PANGO_DIRECTION_TTB_LTR : return 1;
+ case PANGO_DIRECTION_TTB_RTL : return -1;
+ case PANGO_DIRECTION_WEAK_LTR : return 1;
+ case PANGO_DIRECTION_WEAK_RTL : return -1;
+ case PANGO_DIRECTION_NEUTRAL : return 0;
+ /* no default compiler should complain if a new values is added */
+ }
+ /* not reached */
+ return 0;
+}
+
static PangoAlignment
get_alignment (PangoLayout *layout,
PangoLayoutLine *line)
@@ -1840,7 +1858,8 @@ get_alignment (PangoLayout *layout,
PangoAlignment alignment = layout->alignment;
if (line->layout->auto_dir &&
- line->resolved_dir != pango_context_get_base_dir (layout->context))
+ direction_simple (line->resolved_dir) ==
+ -direction_simple (pango_context_get_base_dir (layout->context)))
{
if (alignment == PANGO_ALIGN_LEFT)
alignment = PANGO_ALIGN_RIGHT;