diff options
Diffstat (limited to 'src/hb-subset.cc')
-rw-r--r-- | src/hb-subset.cc | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/hb-subset.cc b/src/hb-subset.cc index a1c52c57..a3917b86 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -70,10 +70,10 @@ _subset2 (hb_subset_plan_t *plan) { hb_vector_t<char> buf; unsigned int buf_size = _plan_estimate_subset_table_size (plan, source_blob->length); - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c initial estimated table size: %u bytes.", HB_UNTAG(tag), buf_size); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c initial estimated table size: %u bytes.", HB_UNTAG (tag), buf_size); if (unlikely (!buf.alloc (buf_size))) { - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to allocate %u bytes.", HB_UNTAG(tag), buf_size); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to allocate %u bytes.", HB_UNTAG (tag), buf_size); return false; } retry: @@ -83,10 +83,10 @@ _subset2 (hb_subset_plan_t *plan) if (serializer.ran_out_of_room) { buf_size += (buf_size >> 1) + 32; - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c ran out of room; reallocating to %u bytes.", HB_UNTAG(tag), buf_size); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c ran out of room; reallocating to %u bytes.", HB_UNTAG (tag), buf_size); if (unlikely (!buf.alloc (buf_size))) { - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to reallocate %u bytes.", HB_UNTAG(tag), buf_size); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c failed to reallocate %u bytes.", HB_UNTAG (tag), buf_size); return false; } goto retry; @@ -94,21 +94,21 @@ _subset2 (hb_subset_plan_t *plan) if (result) { hb_blob_t *dest_blob = serializer.copy_blob (); - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c final subset table size: %u bytes.", HB_UNTAG(tag), dest_blob->length); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c final subset table size: %u bytes.", HB_UNTAG (tag), dest_blob->length); result = c.plan->add_table (tag, dest_blob); hb_blob_destroy (dest_blob); } else { - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset table subsetted to empty.", HB_UNTAG(tag)); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset table subsetted to empty.", HB_UNTAG (tag)); result = true; } } else - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset sanitize failed on source table.", HB_UNTAG(tag)); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset sanitize failed on source table.", HB_UNTAG (tag)); hb_blob_destroy (source_blob); - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset %s", HB_UNTAG(tag), result ? "success" : "FAILED!"); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset %s", HB_UNTAG (tag), result ? "success" : "FAILED!"); return result; } @@ -124,19 +124,19 @@ _subset (hb_subset_plan_t *plan) if (source_blob->data) result = table->subset (plan); else - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset sanitize failed on source table.", HB_UNTAG(tag)); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset sanitize failed on source table.", HB_UNTAG (tag)); hb_blob_destroy (source_blob); - DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset %s", HB_UNTAG(tag), result ? "success" : "FAILED!"); + DEBUG_MSG(SUBSET, nullptr, "OT::%c%c%c%c::subset %s", HB_UNTAG (tag), result ? "success" : "FAILED!"); return result; } static bool _subset_table (hb_subset_plan_t *plan, - hb_tag_t tag) + hb_tag_t tag) { - DEBUG_MSG(SUBSET, nullptr, "begin subset %c%c%c%c", HB_UNTAG(tag)); + DEBUG_MSG(SUBSET, nullptr, "begin subset %c%c%c%c", HB_UNTAG (tag)); bool result = true; switch (tag) { case HB_OT_TAG_glyf: @@ -186,20 +186,20 @@ _subset_table (hb_subset_plan_t *plan, break; default: - hb_blob_t *source_table = hb_face_reference_table(plan->source, tag); + hb_blob_t *source_table = hb_face_reference_table (plan->source, tag); if (likely (source_table)) - result = plan->add_table(tag, source_table); + result = plan->add_table (tag, source_table); else - result = false; + result = false; hb_blob_destroy (source_table); break; } - DEBUG_MSG(SUBSET, nullptr, "subset %c%c%c%c %s", HB_UNTAG(tag), result ? "ok" : "FAILED"); + DEBUG_MSG(SUBSET, nullptr, "subset %c%c%c%c %s", HB_UNTAG (tag), result ? "ok" : "FAILED"); return result; } static bool -_should_drop_table(hb_subset_plan_t *plan, hb_tag_t tag) +_should_drop_table (hb_subset_plan_t *plan, hb_tag_t tag) { switch (tag) { case HB_TAG ('c', 'v', 'a', 'r'): /* hint table, fallthrough */ @@ -248,9 +248,9 @@ _should_drop_table(hb_subset_plan_t *plan, hb_tag_t tag) **/ hb_face_t * hb_subset (hb_face_t *source, - hb_subset_input_t *input) + hb_subset_input_t *input) { - if (unlikely (!input || !source)) return hb_face_get_empty(); + if (unlikely (!input || !source)) return hb_face_get_empty (); hb_subset_plan_t *plan = hb_subset_plan_create (source, input); @@ -263,17 +263,17 @@ hb_subset (hb_face_t *source, for (unsigned int i = 0; i < count; i++) { hb_tag_t tag = table_tags[i]; - if (_should_drop_table(plan, tag)) + if (_should_drop_table (plan, tag)) { - DEBUG_MSG(SUBSET, nullptr, "drop %c%c%c%c", HB_UNTAG(tag)); - continue; + DEBUG_MSG(SUBSET, nullptr, "drop %c%c%c%c", HB_UNTAG (tag)); + continue; } success = success && _subset_table (plan, tag); } offset += count; } while (success && count == ARRAY_LENGTH (table_tags)); - hb_face_t *result = success ? hb_face_reference(plan->dest) : hb_face_get_empty(); + hb_face_t *result = success ? hb_face_reference (plan->dest) : hb_face_get_empty (); hb_subset_plan_destroy (plan); return result; } |