summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-07-29 18:41:25 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-07-30 15:38:44 -0400
commit7444dad9ea3dde39b5276fef4f844237d1e661b1 (patch)
tree4ca879561d0cb0131e9995cb92919fabd0be6531
parent7f734d99a5f9cef1362a6f9f0257a683e01ceb48 (diff)
downloadpango-7444dad9ea3dde39b5276fef4f844237d1e661b1.tar.gz
[HB] Move direction to buffer
-rw-r--r--pango/opentype/hb-buffer.c9
-rw-r--r--pango/opentype/hb-buffer.h14
-rw-r--r--pango/opentype/hb-ot-layout-gpos-private.h2
-rw-r--r--pango/opentype/hb-ot-layout-private.h1
-rw-r--r--pango/opentype/hb-ot-layout.cc7
-rw-r--r--pango/opentype/hb-ot-layout.h5
-rw-r--r--pango/pango-ot-buffer.c2
-rw-r--r--pango/pango-ot-info.c2
8 files changed, 26 insertions, 16 deletions
diff --git a/pango/opentype/hb-buffer.c b/pango/opentype/hb-buffer.c
index d2ec33dc..3c6fd7ce 100644
--- a/pango/opentype/hb-buffer.c
+++ b/pango/opentype/hb-buffer.c
@@ -166,6 +166,15 @@ hb_buffer_add_glyph (hb_buffer_t *buffer,
buffer->in_length++;
}
+void
+hb_buffer_set_direction (hb_buffer_t *buffer,
+ hb_direction_t direction)
+
+{
+ buffer->direction = direction;
+}
+
+
/* HarfBuzz-Internal API */
HB_INTERNAL void
diff --git a/pango/opentype/hb-buffer.h b/pango/opentype/hb-buffer.h
index 197c921e..1376ad4c 100644
--- a/pango/opentype/hb-buffer.h
+++ b/pango/opentype/hb-buffer.h
@@ -32,6 +32,13 @@
HB_BEGIN_DECLS
+typedef enum _hb_direction_t {
+ HB_DIRECTION_LTR,
+ HB_DIRECTION_RTL,
+ HB_DIRECTION_TTB,
+ HB_DIRECTION_BTT
+} hb_direction_t;
+
/* XXX Hide structs? */
typedef struct _hb_glyph_info_t {
@@ -72,6 +79,8 @@ typedef struct _hb_buffer_t {
hb_glyph_info_t *out_string;
hb_glyph_info_t *alt_string;
hb_glyph_position_t *positions;
+
+ hb_direction_t direction;
unsigned int max_lig_id;
} hb_buffer_t;
@@ -94,6 +103,11 @@ hb_buffer_add_glyph (hb_buffer_t *buffer,
unsigned int properties,
unsigned int cluster);
+void
+hb_buffer_set_direction (hb_buffer_t *buffer,
+ hb_direction_t direction);
+
+
HB_END_DECLS
#endif /* HB_BUFFER_H */
diff --git a/pango/opentype/hb-ot-layout-gpos-private.h b/pango/opentype/hb-ot-layout-gpos-private.h
index 5ad28a61..619b4c47 100644
--- a/pango/opentype/hb-ot-layout-gpos-private.h
+++ b/pango/opentype/hb-ot-layout-gpos-private.h
@@ -687,7 +687,7 @@ struct CursivePosFormat1
/* TODO vertical */
- if (gpi->r2l)
+ if (buffer->direction == HB_DIRECTION_RTL)
{
POSITION (buffer->in_pos)->x_advance = entry_x - gpi->anchor_x;
POSITION (buffer->in_pos)->new_advance = TRUE;
diff --git a/pango/opentype/hb-ot-layout-private.h b/pango/opentype/hb-ot-layout-private.h
index 326440b1..12b1ee1c 100644
--- a/pango/opentype/hb-ot-layout-private.h
+++ b/pango/opentype/hb-ot-layout-private.h
@@ -52,7 +52,6 @@ struct _hb_ot_layout_t
hb_16dot16_t x_scale, y_scale;
hb_bool_t dvi;
- hb_bool_t r2l;
unsigned int last; /* the last valid glyph--used with cursive positioning */
hb_position_t anchor_x; /* the coordinates of the anchor point */
diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc
index 143e1f3d..c99e8eaa 100644
--- a/pango/opentype/hb-ot-layout.cc
+++ b/pango/opentype/hb-ot-layout.cc
@@ -115,13 +115,6 @@ hb_ot_layout_destroy (hb_ot_layout_t *layout)
}
void
-hb_ot_layout_set_direction (hb_ot_layout_t *layout,
- hb_bool_t r2l)
-{
- layout->gpos_info.r2l = !!r2l;
-}
-
-void
hb_ot_layout_set_hinting (hb_ot_layout_t *layout,
hb_bool_t hinted)
{
diff --git a/pango/opentype/hb-ot-layout.h b/pango/opentype/hb-ot-layout.h
index 20bd1e45..f1b4b45e 100644
--- a/pango/opentype/hb-ot-layout.h
+++ b/pango/opentype/hb-ot-layout.h
@@ -53,11 +53,6 @@ hb_ot_layout_create_for_tables (const char *gdef_data,
void
hb_ot_layout_destroy (hb_ot_layout_t *layout);
-/* XXX */
-void
-hb_ot_layout_set_direction (hb_ot_layout_t *layout,
- hb_bool_t r2l);
-
void
hb_ot_layout_set_hinting (hb_ot_layout_t *layout,
hb_bool_t hinted);
diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c
index a977e7d9..cd654535 100644
--- a/pango/pango-ot-buffer.c
+++ b/pango/pango-ot-buffer.c
@@ -155,6 +155,8 @@ pango_ot_buffer_set_rtl (PangoOTBuffer *buffer,
gboolean rtl)
{
buffer->rtl = rtl != FALSE;
+ hb_buffer_set_direction (buffer->buffer,
+ buffer->rtl ? HB_DIRECTION_RTL : HB_DIRECTION_LTR);
}
/**
diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index 541062ab..2a2c1470 100644
--- a/pango/pango-ot-info.c
+++ b/pango/pango-ot-info.c
@@ -558,8 +558,6 @@ _pango_ot_info_position (const PangoOTInfo *info,
/* XXX */
_hb_buffer_clear_positions (buffer->buffer);
- hb_ot_layout_set_direction (info->layout,
- buffer->rtl);
hb_ot_layout_set_hinting (info->layout,
buffer->font->is_hinted);
hb_ot_layout_set_scale (info->layout,