* Copyright (C) 1998-2004 David Turner and Werner Lemberg
* Copyright (C) 2004,2007,2009,2010 Red Hat, Inc.
*
- * This is part of HarfBuzz, a text shaping library.
+ * This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
HB_INTERNAL void
_hb_buffer_clear_output (hb_buffer_t *buffer);
+HB_INTERNAL void
+_hb_buffer_clear_positions (hb_buffer_t *buffer);
+
HB_INTERNAL void
_hb_buffer_replace_glyphs_be16 (hb_buffer_t *buffer,
unsigned int num_in,
inline unsigned int next_serial (void) { return serial++; }
inline void swap (void) { _hb_buffer_swap (this); }
inline void clear_output (void) { _hb_buffer_clear_output (this); }
+ inline void clear_positions (void) { _hb_buffer_clear_positions (this); }
inline void next_glyph (void) { _hb_buffer_next_glyph (this); }
inline void replace_glyphs_be16 (unsigned int num_in,
unsigned int num_out,
* Copyright (C) 2004,2007,2009,2010 Red Hat, Inc.
* Copyright (C) 2011 Google, Inc.
*
- * This is part of HarfBuzz, a text shaping library.
+ * This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
buffer->len++;
}
-void
-hb_buffer_clear_positions (hb_buffer_t *buffer)
-{
- _hb_buffer_clear_output (buffer);
- buffer->have_output = FALSE;
- buffer->have_positions = TRUE;
-
- memset (buffer->pos, 0, sizeof (buffer->pos[0]) * buffer->len);
-}
-
/* HarfBuzz-Internal API */
void
{
buffer->have_output = TRUE;
buffer->have_positions = FALSE;
+
buffer->out_len = 0;
buffer->out_info = buffer->info;
}
+void
+_hb_buffer_clear_positions (hb_buffer_t *buffer)
+{
+ buffer->have_output = FALSE;
+ buffer->have_positions = TRUE;
+
+ memset (buffer->pos, 0, sizeof (buffer->pos[0]) * buffer->len);
+}
+
void
_hb_buffer_swap (hb_buffer_t *buffer)
{
hb_buffer_get_glyph_positions (hb_buffer_t *buffer)
{
if (!buffer->have_positions)
- hb_buffer_clear_positions (buffer);
+ _hb_buffer_clear_positions (buffer);
return (hb_glyph_position_t *) buffer->pos;
}
* Copyright (C) 2004,2007,2009 Red Hat, Inc.
* Copyright (C) 2011 Google, Inc.
*
- * This is part of HarfBuzz, a text shaping library.
+ * This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
void
hb_buffer_reset (hb_buffer_t *buffer);
-void
-hb_buffer_clear_positions (hb_buffer_t *buffer);
-
hb_bool_t
hb_buffer_ensure (hb_buffer_t *buffer,
unsigned int size);
return &_get_gpos (face) != &Null(GPOS);
}
+void
+hb_ot_layout_position_start (hb_buffer_t *buffer)
+{
+ buffer->clear_positions ();
+}
+
hb_bool_t
hb_ot_layout_position_lookup (hb_font_t *font,
hb_face_t *face,
hb_bool_t
hb_ot_layout_has_positioning (hb_face_t *face);
+/* Should be called before all the position_lookup's are done. Resets positions to zero. */
+void
+hb_ot_layout_position_start (hb_buffer_t *buffer);
+
hb_bool_t
hb_ot_layout_position_lookup (hb_font_t *font,
hb_face_t *face,
static void
hb_position_default (hb_ot_shape_context_t *c)
{
- hb_buffer_clear_positions (c->buffer);
+ hb_ot_layout_position_start (c->buffer);
unsigned int count = c->buffer->len;
for (unsigned int i = 0; i < count; i++) {