Created
May 16, 2019 21:01
-
-
Save behdad/a161586b18009dd2c69a2e44c3d311de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --cc src/hb-ot-layout-gsub-table.hh | |
index 364ef189,364ef189..4de505aa | |
--- a/src/hb-ot-layout-gsub-table.hh | |
+++ b/src/hb-ot-layout-gsub-table.hh | |
@@@ -899,8 -899,8 +899,31 @@@ struct LigatureSubstFormat | |
bool subset (hb_subset_context_t *c) const | |
{ | |
TRACE_SUBSET (this); | |
-- // TODO(subset) | |
-- return_trace (false); | |
++ const hb_set_t &glyphset = *c->plan->glyphset (); | |
++ const hb_map_t &glyph_map = *c->plan->glyph_map; | |
++ | |
++ auto *out = c->serializer->start_embed (*this); | |
++ if (unlikely (!c->extend_min (out))) trace_return (false); | |
++ out->format = format; | |
++ | |
++ hb_sorted_vector_t<hb_codepoint_t> new_coverage; | |
++ + hb_zip (this+coverage, ligatureSet) | |
++ | hb_filter (glyphset, hb_first) | |
++ | hb_filter ([&] (const OffsetTo<LigatureSet>& _) | |
++ { | |
++ if (unlikely (!out->ligatureSet.serialize_append (c->serializer))) return false; | |
++ bool ret = out.ligatureSet.tail ().serialize_subset (c, this+_, out); | |
++ if (!ret) out->ligatureSet.len--; umm. | |
++ return ret; | |
++ }, | |
++ hb_second) | |
++ | hb_map (hb_first) | |
++ | hb_map (glyph_map) | |
++ | hb_sink (new_coverage); | |
++ ; | |
++ out->coverage.serialize (c->serializer, out) | |
++ .serialize (c->serializer, new_coverage.iter ()); | |
++ return_trace (bool (new_coverage)); | |
} | |
bool sanitize (hb_sanitize_context_t *c) const |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment