From 314b460d8a02ed4b2789ff527cf6c9bc19769114 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 20 Dec 2009 13:58:50 +0100 Subject: [PATCH] Add HB_DIRECTION_IS_FORWARD/BACKWARD --- src/hb-common.h | 2 ++ src/hb-shape.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-common.h b/src/hb-common.h index d07b204..25249cc 100644 --- a/src/hb-common.h +++ b/src/hb-common.h @@ -81,6 +81,8 @@ typedef enum _hb_direction_t { #define HB_DIRECTION_IS_HORIZONTAL(dir) ((dir) == HB_DIRECTION_LTR || (dir) == HB_DIRECTION_RTL) #define HB_DIRECTION_IS_VERTICAL(dir) ((dir) == HB_DIRECTION_TTB || (dir) == HB_DIRECTION_BTT) +#define HB_DIRECTION_IS_FORWARD(dir) ((dir) == HB_DIRECTION_LTR || (dir) == HB_DIRECTION_TTB) +#define HB_DIRECTION_IS_BACKWARD(dir) ((dir) == HB_DIRECTION_RTL || (dir) == HB_DIRECTION_BTT) #endif /* HB_COMMON_H */ diff --git a/src/hb-shape.c b/src/hb-shape.c index 197d4a0..2605af6 100644 --- a/src/hb-shape.c +++ b/src/hb-shape.c @@ -130,8 +130,7 @@ hb_shape (hb_font_t *font, /* GPOS / kern */ - /* TODO: Vertical */ - if (buffer->direction == HB_DIRECTION_RTL) + if (HB_DIRECTION_IS_BACKWARD (buffer->direction)) hb_buffer_reverse (buffer); buffer->direction = original_direction; -- 2.7.4