From 9c42f05a5ccbb48a9367b80ecdf3679e88088fcf Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 18 May 2009 17:43:49 -0400 Subject: [PATCH] Switch Pango to new, defunt, GPOS --- src/hb-ot-layout-gpos-private.h | 22 +++++++++++++++------- src/hb-ot-layout.cc | 13 +++++++++++++ src/hb-ot-layout.h | 5 +++++ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-layout-gpos-private.h b/src/hb-ot-layout-gpos-private.h index b0b9513..056131b 100644 --- a/src/hb-ot-layout-gpos-private.h +++ b/src/hb-ot-layout-gpos-private.h @@ -843,16 +843,24 @@ struct PosLookup : Lookup { if (HB_UNLIKELY (!buffer->in_length)) return false; - _hb_buffer_clear_positions (buffer); + layout->gpos_info.last = 0xFFFF; /* no last valid glyph for cursive pos. */ + buffer->in_pos = 0; while (buffer->in_pos < buffer->in_length) { - if ((~IN_PROPERTIES (buffer->in_pos) & mask) && - position_once (layout, buffer)) - ret = true; - else - _hb_buffer_next_glyph (buffer); - + bool done; + if (~IN_PROPERTIES (buffer->in_pos) & mask) { + done = position_once (layout, buffer); + ret |= done; + } else { + done = false; + /* Contrary to properties defined in GDEF, user-defined properties + will always stop a possible cursive positioning. */ + layout->gpos_info.last = 0xFFFF; + } + + if (!done) + buffer->in_pos++; } return ret; diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 46f4555..4bb2eb5 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -531,6 +531,19 @@ hb_ot_layout_substitute_lookup (hb_ot_layout_t *layout, return layout->gsub->substitute_lookup (layout, buffer, lookup_index, mask); } +/* + * GPOS + */ + +hb_bool_t +hb_ot_layout_position_lookup (hb_ot_layout_t *layout, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_ot_layout_feature_mask_t mask) +{ + return layout->gpos->position_lookup (layout, buffer, lookup_index, mask); +} + /* TODO dupped, until he old code can be removed */ diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index f6c0c44..f907b65 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -207,6 +207,11 @@ hb_ot_layout_substitute_lookup (hb_ot_layout_t *layout, unsigned int lookup_index, hb_ot_layout_feature_mask_t mask); +hb_bool_t +hb_ot_layout_position_lookup (hb_ot_layout_t *layout, + hb_buffer_t *buffer, + unsigned int lookup_index, + hb_ot_layout_feature_mask_t mask); -- 2.7.4