/*
- * Copyright (C) 2007,2008,2009,2010 Red Hat, Inc.
- * Copyright (C) 2010 Google, Inc.
+ * Copyright © 2007,2008,2009,2010 Red Hat, Inc.
+ * Copyright © 2010 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
HB_BEGIN_DECLS
+/* buffer var allocations */
+#define lig_id() var2.u16[0] /* unique ligature id */
+#define lig_comp() var2.u16[1] /* component number in the ligature (0 = base) */
+
+
#ifndef HB_DEBUG_APPLY
-#define HB_DEBUG_APPLY HB_DEBUG+0
+#define HB_DEBUG_APPLY (HB_DEBUG+0)
#endif
#define TRACE_APPLY() \
struct hb_apply_context_t
{
unsigned int debug_depth;
- hb_ot_layout_context_t *layout;
+ hb_font_t *font;
+ hb_face_t *face;
hb_buffer_t *buffer;
+ hb_direction_t direction;
hb_mask_t lookup_mask;
unsigned int context_length;
unsigned int nesting_level_left;
- unsigned int lookup_flag;
+ unsigned int lookup_props;
unsigned int property; /* propety of first glyph */
inline void guess_glyph_class (unsigned int klass)
{
-// buffer->info[buffer->i].gproperty() = klass;
+ /* XXX if ! has gdef */
+ buffer->info[buffer->i].props_cache() = klass;
}
private:
inline void clear_property (void) const
{
- buffer->info[buffer->i].gproperty() = 0;
+ /* XXX if has gdef */
+ buffer->info[buffer->i].props_cache() = 0;
}
};
for (i = 1, j = c->buffer->i + 1; i < count; i++, j++)
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->face, &c->buffer->info[j], c->lookup_props, NULL))
{
if (unlikely (j + count - i == end))
return false;
match_func_t match_func,
const void *match_data)
{
- if (unlikely (c->buffer->out_len < count))
+ if (unlikely (c->buffer->backtrack_len () < count))
return false;
- for (unsigned int i = 0, j = c->buffer->out_len - 1; i < count; i++, j--)
+ for (unsigned int i = 0, j = c->buffer->backtrack_len () - 1; i < count; i++, j--)
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->out_info[j], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->face, &c->buffer->out_info[j], c->lookup_props, NULL))
{
if (unlikely (j + 1 == count - i))
return false;
for (i = 0, j = c->buffer->i + offset; i < count; i++, j++)
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[j], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->face, &c->buffer->info[j], c->lookup_props, NULL))
{
if (unlikely (j + count - i == end))
return false;
apply_lookup_func_t apply_func)
{
unsigned int end = MIN (c->buffer->len, c->buffer->i + c->context_length);
- if (unlikely (c->buffer->i + count > end))
+ if (unlikely (count == 0 || c->buffer->i + count > end))
return false;
/* TODO We don't support lookupRecord arrays that are not increasing:
* Should be easy for in_place ones at least. */
- /* Note: If sublookup is reverse, i will underflow after the first loop
+ /* Note: If sublookup is reverse, it will underflow after the first loop
* and we jump out of it. Not entirely disastrous. So we don't check
* for reverse lookup here.
*/
for (unsigned int i = 0; i < count; /* NOP */)
{
- while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[c->buffer->i], c->lookup_flag, NULL))
+ while (_hb_ot_layout_skip_mark (c->face, &c->buffer->info[c->buffer->i], c->lookup_props, NULL))
{
if (unlikely (c->buffer->i == end))
return true;
ChainContextLookupContext &lookup_context)
{
/* First guess */
- if (unlikely (c->buffer->out_len < backtrackCount ||
+ if (unlikely (c->buffer->backtrack_len () < backtrackCount ||
c->buffer->i + inputCount + lookaheadCount > c->buffer->len ||
inputCount + lookaheadCount > c->context_length))
return false;
lookahead.len, lookahead.array,
lookup.len, lookup.array,
lookup_context);
- return false;
}
public:
lookahead.len, (const USHORT *) lookahead.array,
lookup.len, lookup.array,
lookup_context);
- return false;
}
inline bool sanitize (hb_sanitize_context_t *c) {