Remove hb_buffer_clear_positions(), add hb_ot_layout_position_start()
This commit is contained in:
parent
2fc56edff6
commit
8f0d7e0c3f
|
@ -2,7 +2,7 @@
|
||||||
* Copyright (C) 1998-2004 David Turner and Werner Lemberg
|
* Copyright (C) 1998-2004 David Turner and Werner Lemberg
|
||||||
* Copyright (C) 2004,2007,2009,2010 Red Hat, Inc.
|
* 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
|
* Permission is hereby granted, without written agreement and without
|
||||||
* license or royalty fees, to use, copy, modify, and distribute this
|
* license or royalty fees, to use, copy, modify, and distribute this
|
||||||
|
@ -51,6 +51,9 @@ _hb_buffer_swap (hb_buffer_t *buffer);
|
||||||
HB_INTERNAL void
|
HB_INTERNAL void
|
||||||
_hb_buffer_clear_output (hb_buffer_t *buffer);
|
_hb_buffer_clear_output (hb_buffer_t *buffer);
|
||||||
|
|
||||||
|
HB_INTERNAL void
|
||||||
|
_hb_buffer_clear_positions (hb_buffer_t *buffer);
|
||||||
|
|
||||||
HB_INTERNAL void
|
HB_INTERNAL void
|
||||||
_hb_buffer_replace_glyphs_be16 (hb_buffer_t *buffer,
|
_hb_buffer_replace_glyphs_be16 (hb_buffer_t *buffer,
|
||||||
unsigned int num_in,
|
unsigned int num_in,
|
||||||
|
@ -116,6 +119,7 @@ struct _hb_buffer_t {
|
||||||
inline unsigned int next_serial (void) { return serial++; }
|
inline unsigned int next_serial (void) { return serial++; }
|
||||||
inline void swap (void) { _hb_buffer_swap (this); }
|
inline void swap (void) { _hb_buffer_swap (this); }
|
||||||
inline void clear_output (void) { _hb_buffer_clear_output (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 next_glyph (void) { _hb_buffer_next_glyph (this); }
|
||||||
inline void replace_glyphs_be16 (unsigned int num_in,
|
inline void replace_glyphs_be16 (unsigned int num_in,
|
||||||
unsigned int num_out,
|
unsigned int num_out,
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Copyright (C) 2004,2007,2009,2010 Red Hat, Inc.
|
* Copyright (C) 2004,2007,2009,2010 Red Hat, Inc.
|
||||||
* Copyright (C) 2011 Google, 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
|
* Permission is hereby granted, without written agreement and without
|
||||||
* license or royalty fees, to use, copy, modify, and distribute this
|
* license or royalty fees, to use, copy, modify, and distribute this
|
||||||
|
@ -272,16 +272,6 @@ hb_buffer_add_glyph (hb_buffer_t *buffer,
|
||||||
buffer->len++;
|
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 */
|
/* HarfBuzz-Internal API */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -289,10 +279,20 @@ _hb_buffer_clear_output (hb_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
buffer->have_output = TRUE;
|
buffer->have_output = TRUE;
|
||||||
buffer->have_positions = FALSE;
|
buffer->have_positions = FALSE;
|
||||||
|
|
||||||
buffer->out_len = 0;
|
buffer->out_len = 0;
|
||||||
buffer->out_info = buffer->info;
|
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
|
void
|
||||||
_hb_buffer_swap (hb_buffer_t *buffer)
|
_hb_buffer_swap (hb_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
|
@ -477,7 +477,7 @@ hb_glyph_position_t *
|
||||||
hb_buffer_get_glyph_positions (hb_buffer_t *buffer)
|
hb_buffer_get_glyph_positions (hb_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
if (!buffer->have_positions)
|
if (!buffer->have_positions)
|
||||||
hb_buffer_clear_positions (buffer);
|
_hb_buffer_clear_positions (buffer);
|
||||||
|
|
||||||
return (hb_glyph_position_t *) buffer->pos;
|
return (hb_glyph_position_t *) buffer->pos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* Copyright (C) 2004,2007,2009 Red Hat, Inc.
|
* Copyright (C) 2004,2007,2009 Red Hat, Inc.
|
||||||
* Copyright (C) 2011 Google, 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
|
* Permission is hereby granted, without written agreement and without
|
||||||
* license or royalty fees, to use, copy, modify, and distribute this
|
* license or royalty fees, to use, copy, modify, and distribute this
|
||||||
|
@ -102,9 +102,6 @@ hb_buffer_get_language (hb_buffer_t *buffer);
|
||||||
void
|
void
|
||||||
hb_buffer_reset (hb_buffer_t *buffer);
|
hb_buffer_reset (hb_buffer_t *buffer);
|
||||||
|
|
||||||
void
|
|
||||||
hb_buffer_clear_positions (hb_buffer_t *buffer);
|
|
||||||
|
|
||||||
hb_bool_t
|
hb_bool_t
|
||||||
hb_buffer_ensure (hb_buffer_t *buffer,
|
hb_buffer_ensure (hb_buffer_t *buffer,
|
||||||
unsigned int size);
|
unsigned int size);
|
||||||
|
|
|
@ -462,6 +462,12 @@ hb_ot_layout_has_positioning (hb_face_t *face)
|
||||||
return &_get_gpos (face) != &Null(GPOS);
|
return &_get_gpos (face) != &Null(GPOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
hb_ot_layout_position_start (hb_buffer_t *buffer)
|
||||||
|
{
|
||||||
|
buffer->clear_positions ();
|
||||||
|
}
|
||||||
|
|
||||||
hb_bool_t
|
hb_bool_t
|
||||||
hb_ot_layout_position_lookup (hb_font_t *font,
|
hb_ot_layout_position_lookup (hb_font_t *font,
|
||||||
hb_face_t *face,
|
hb_face_t *face,
|
||||||
|
|
|
@ -179,6 +179,10 @@ hb_ot_layout_substitute_lookup (hb_face_t *face,
|
||||||
hb_bool_t
|
hb_bool_t
|
||||||
hb_ot_layout_has_positioning (hb_face_t *face);
|
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_bool_t
|
||||||
hb_ot_layout_position_lookup (hb_font_t *font,
|
hb_ot_layout_position_lookup (hb_font_t *font,
|
||||||
hb_face_t *face,
|
hb_face_t *face,
|
||||||
|
|
|
@ -249,7 +249,7 @@ hb_substitute_complex_fallback (hb_ot_shape_context_t *c HB_UNUSED)
|
||||||
static void
|
static void
|
||||||
hb_position_default (hb_ot_shape_context_t *c)
|
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;
|
unsigned int count = c->buffer->len;
|
||||||
for (unsigned int i = 0; i < count; i++) {
|
for (unsigned int i = 0; i < count; i++) {
|
||||||
|
|
Loading…
Reference in New Issue