From 9ea0aa43ac5cf243b698aae0ec80241b5efd7488 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 18 Dec 2015 17:30:18 +0000 Subject: [PATCH] Don't deserialize positions if buffer has no positions --- src/hb-buffer-serialize.cc | 3 +++ src/hb-ot-layout.cc | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc index 7839cbc3f..2dc146ab1 100644 --- a/src/hb-buffer-serialize.cc +++ b/src/hb-buffer-serialize.cc @@ -282,6 +282,9 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer, assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) || buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS); + if (!buffer->have_positions) + flags |= HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS; + if (unlikely (start == end)) return 0; diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index b0257f6b9..6bb4059e5 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -1020,8 +1020,6 @@ inline void hb_ot_map_t::apply (const Proxy &proxy, 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