summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJody Goldberg <jody@gnome.org>2004-05-28 04:30:54 +0000
committerJody Goldberg <jody@src.gnome.org>2004-05-28 04:30:54 +0000
commit55d6816eab0b796b412b45be3dbf768d5945c81a (patch)
treec06b24a92020f972852e764ada35df0364324318
parentdc949d2a601e870084572f231b0ecb57687557d3 (diff)
downloadpango-55d6816eab0b796b412b45be3dbf768d5945c81a.tar.gz
only invert if the layout and the context really disagree, not if they are
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.c23
7 files changed, 74 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index caea012a..8588f508 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,18 @@ Thu May 27 15:08:32 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 caea012a..8588f508 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -35,6 +35,18 @@ Thu May 27 15:08:32 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 caea012a..8588f508 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -35,6 +35,18 @@ Thu May 27 15:08:32 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 caea012a..8588f508 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -35,6 +35,18 @@ Thu May 27 15:08:32 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..55abd1a1 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -1833,14 +1833,33 @@ 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)
{
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;