[HarfBuzz] harfbuzz: Branch 'master' - 3 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Tue Aug 18 10:55:33 PDT 2015
src/hb-buffer-serialize.cc | 6 ++++--
src/hb-ot-layout.cc | 12 ++++++++++++
src/hb-ot-shape.cc | 2 ++
3 files changed, 18 insertions(+), 2 deletions(-)
New commits:
commit 902e74a098dad8c3b487856284f9fdf99b04f9f1
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Aug 18 18:55:03 2015 +0100
Commented-out code to print buffer before each lookup
To be turned into a useful HB_DEBUG_SHAPE infrastructure...
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 5a573dd..39d007d 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -1010,6 +1010,18 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
const stage_map_t *stage = &stages[table_index][stage_index];
for (; i < stage->last_lookup; i++)
{
+#if 0
+ char buf[4096];
+ hb_buffer_serialize_glyphs (buffer, 0, buffer->len,
+ buf, sizeof (buf), NULL,
+ font,
+ HB_BUFFER_SERIALIZE_FORMAT_TEXT,
+ Proxy::table_index == 0 ?
+ HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS :
+ HB_BUFFER_SERIALIZE_FLAG_DEFAULT);
+ printf ("buf: [%s]\n", buf);
+#endif
+
unsigned int lookup_index = lookups[table_index][i].index;
c.set_lookup_index (lookup_index);
c.set_lookup_mask (lookups[table_index][i].mask);
commit 75504a50488a6aac0b9789f728fb5b87e641d4c3
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Aug 18 18:47:02 2015 +0100
Allow serializing buffer with output-buffer being used
Ie, don't call get_positions() if positions are not
requested for serialization.
diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc
index 406d69d..8a22224 100644
--- a/src/hb-buffer-serialize.cc
+++ b/src/hb-buffer-serialize.cc
@@ -99,7 +99,8 @@ _hb_buffer_serialize_glyphs_json (hb_buffer_t *buffer,
hb_buffer_serialize_flags_t flags)
{
hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
- hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, NULL);
+ hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
+ NULL : hb_buffer_get_glyph_positions (buffer, NULL);
*buf_consumed = 0;
for (unsigned int i = start; i < end; i++)
@@ -172,7 +173,8 @@ _hb_buffer_serialize_glyphs_text (hb_buffer_t *buffer,
hb_buffer_serialize_flags_t flags)
{
hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, NULL);
- hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, NULL);
+ hb_glyph_position_t *pos = (flags & HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS) ?
+ NULL : hb_buffer_get_glyph_positions (buffer, NULL);
*buf_consumed = 0;
for (unsigned int i = start; i < end; i++)
commit e47b772a56af44a9a4f9ec907ee2091b725b94c1
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Aug 18 18:42:47 2015 +0100
[ot] Change buffer content type right after we map to glyphs
Needed for upcoming debug output changes.
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index f20be2a..e24f7a8 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -513,6 +513,8 @@ hb_ot_map_glyphs_fast (hb_buffer_t *buffer)
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 0; i < count; i++)
info[i].codepoint = info[i].glyph_index();
+
+ buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
}
static inline void
More information about the HarfBuzz
mailing list