[name] Add NameRecord::copy()
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 2 May 2019 23:26:06 +0000 (16:26 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 2 May 2019 23:26:06 +0000 (16:26 -0700)
src/hb-ot-name-table.hh

index 10a2255..00686ee 100644 (file)
@@ -95,6 +95,16 @@ struct NameRecord
     return UNSUPPORTED;
   }
 
+  NameRecord* copy (hb_serialize_context_t *c,
+                   const void *src_base,
+                   const void *dst_base) const
+  {
+    auto *out = c->embed (this);
+    out->offset = 0;
+    out->offset.serialize_copy (c, src_base + offset, dst_base, length);
+    return out;
+  }
+
   bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);