Don't deserialize positions if buffer has no positions
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 18 Dec 2015 17:30:18 +0000 (17:30 +0000)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 18 Dec 2015 17:30:57 +0000 (17:30 +0000)
src/hb-buffer-serialize.cc
src/hb-ot-layout.cc

index 7839cbc..2dc146a 100644 (file)
@@ -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;
 
index b0257f6..6bb4059 100644 (file)
@@ -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