1 | #ifndef OT_LAYOUT_GPOS_MARKRECORD_HH |
---|---|
2 | #define OT_LAYOUT_GPOS_MARKRECORD_HH |
3 | |
4 | namespace OT { |
5 | namespace Layout { |
6 | namespace GPOS_impl { |
7 | |
8 | struct MarkRecord |
9 | { |
10 | friend struct MarkArray; |
11 | |
12 | public: |
13 | HBUINT16 klass; /* Class defined for this mark */ |
14 | Offset16To<Anchor> |
15 | markAnchor; /* Offset to Anchor table--from |
16 | * beginning of MarkArray table */ |
17 | public: |
18 | DEFINE_SIZE_STATIC (4); |
19 | |
20 | unsigned get_class () const { return (unsigned) klass; } |
21 | bool sanitize (hb_sanitize_context_t *c, const void *base) const |
22 | { |
23 | TRACE_SANITIZE (this); |
24 | return_trace (c->check_struct (this) && markAnchor.sanitize (c, base)); |
25 | } |
26 | |
27 | MarkRecord *subset (hb_subset_context_t *c, |
28 | const void *src_base, |
29 | const hb_map_t *klass_mapping) const |
30 | { |
31 | TRACE_SUBSET (this); |
32 | auto *out = c->serializer->embed (this); |
33 | if (unlikely (!out)) return_trace (nullptr); |
34 | |
35 | out->klass = klass_mapping->get (klass); |
36 | out->markAnchor.serialize_subset (c, markAnchor, src_base); |
37 | return_trace (out); |
38 | } |
39 | |
40 | void collect_variation_indices (hb_collect_variation_indices_context_t *c, |
41 | const void *src_base) const |
42 | { |
43 | (src_base+markAnchor).collect_variation_indices (c); |
44 | } |
45 | }; |
46 | |
47 | |
48 | } |
49 | } |
50 | } |
51 | |
52 | #endif /* OT_LAYOUT_GPOS_MARKRECORD_HH */ |
53 |