// TODO(grieger): Sanity check writes to make sure they are in-bounds.
// TODO(grieger): Sanity check allocation size for the new table.
// TODO(grieger): Subset loca simultaneously.
+ // TODO(grieger): Don't fail on bad offsets, just dump them.
unsigned int glyf_prime_size;
if (unlikely (!_calculate_glyf_prime_size (glyf,
* Since: 1.7.5
**/
bool
-hb_subset_glyf (hb_subset_plan_t *plan,
- hb_face_t *face,
- hb_blob_t **glyf_prime /* OUT */)
+hb_subset_glyf_and_loca (hb_subset_plan_t *plan,
+ hb_face_t *face,
+ hb_blob_t **glyf_prime /* OUT */,
+ hb_blob_t **loca_prime /* OUT */)
{
hb_blob_t *glyf_blob = OT::Sanitizer<OT::glyf>().sanitize (face->reference_table (HB_OT_TAG_glyf));
const char *glyf_data = hb_blob_get_data(glyf_blob, nullptr);
bool result = _hb_subset_glyf (glyf, glyf_data, plan->glyphs_to_retain, glyf_prime);
glyf.fini();
+ // TODO(grieger): Subset loca
+
return result;
}
#include "hb-subset-plan.hh"
bool
-hb_subset_glyf (hb_subset_plan_t *plan,
- hb_face_t *face,
- hb_blob_t **glyf_prime /* OUT */);
+hb_subset_glyf_and_loca (hb_subset_plan_t *plan,
+ hb_face_t *face,
+ hb_blob_t **glyf_prime /* OUT */,
+ hb_blob_t **loca_prime /* OUT */);
#endif /* HB_SUBSET_GLYF_HH */
hb_face_t *dest = nullptr; // TODO allocate dest
hb_blob_t *glyf_prime = nullptr;
- if (hb_subset_glyf (plan, source, &glyf_prime)) {
- // TODO: write new glyf to new face.
+ hb_blob_t *loca_prime = nullptr;
+ if (hb_subset_glyf_and_loca (plan, source, &glyf_prime, &loca_prime)) {
+ // TODO: write new glyf and loca to new face.
+ } else {
+ success = false;
}
hb_blob_destroy (glyf_prime);