diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2019-09-30 22:08:36 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2019-09-30 22:08:36 +0000 |
commit | 883a87cde515fcdd076708f212ebb66ed32b145f (patch) | |
tree | ac0fce4c70597596bb267f760197a09232b219b1 /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh | |
parent | 6c0fed440c27ba0d6856feeb1000320320cf8a96 (diff) |
harfbuzz 2.6.2
git-svn-id: svn://tug.org/texlive/trunk@52233 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh index 11a588e3814..6b2cc866265 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh @@ -66,7 +66,7 @@ struct hmtxvmtx bool subset_update_header (hb_subset_plan_t *plan, - unsigned int num_hmetrics) const + unsigned int num_hmetrics) const { hb_blob_t *src_blob = hb_sanitize_context_t ().reference_table<H> (plan->source, H::tableTag); hb_blob_t *dest_blob = hb_blob_copy_writable_or_fail (src_blob); @@ -87,30 +87,30 @@ struct hmtxvmtx } template<typename Iterator, - hb_requires (hb_is_iterator (Iterator))> + hb_requires (hb_is_iterator (Iterator))> void serialize (hb_serialize_context_t *c, - Iterator it, - unsigned num_advances) + Iterator it, + unsigned num_advances) { unsigned idx = 0; + it | hb_apply ([c, &idx, num_advances] (const hb_item_type<Iterator>& _) - { - if (idx < num_advances) - { - LongMetric lm; - lm.advance = _.first; - lm.sb = _.second; - if (unlikely (!c->embed<LongMetric> (&lm))) return; - } - else - { - FWORD *sb = c->allocate_size<FWORD> (FWORD::static_size); - if (unlikely (!sb)) return; - *sb = _.second; - } - idx++; - }) + { + if (idx < num_advances) + { + LongMetric lm; + lm.advance = _.first; + lm.sb = _.second; + if (unlikely (!c->embed<LongMetric> (&lm))) return; + } + else + { + FWORD *sb = c->allocate_size<FWORD> (FWORD::static_size); + if (unlikely (!sb)) return; + *sb = _.second; + } + idx++; + }) ; } @@ -131,8 +131,8 @@ struct hmtxvmtx { hb_codepoint_t old_gid; if (c->plan->old_gid_for_new_gid (_, &old_gid)) - return hb_pair (_mtx.get_advance (old_gid), _mtx.get_side_bearing (old_gid)); - else + return hb_pair (_mtx.get_advance (old_gid), _mtx.get_side_bearing (old_gid)); + else return hb_pair (0u, 0u); }) ; @@ -158,7 +158,7 @@ struct hmtxvmtx friend struct hmtxvmtx; void init (hb_face_t *face, - unsigned int default_advance_ = 0) + unsigned int default_advance_ = 0) { default_advance = default_advance_ ? default_advance_ : hb_face_get_upem (face); @@ -194,10 +194,10 @@ struct hmtxvmtx unsigned int get_side_bearing (hb_codepoint_t glyph) const { if (glyph < num_advances) - return table->longMetricZ[glyph].sb; + return table->longMetricZ[glyph].sb; if (unlikely (glyph >= num_metrics)) - return 0; + return 0; const FWORD *bearings = (const FWORD *) &table->longMetricZ[num_advances]; return bearings[glyph - num_advances]; @@ -234,12 +234,12 @@ struct hmtxvmtx { unsigned int num_advances = plan->num_output_glyphs (); unsigned int last_advance = _advance_for_new_gid (plan, - num_advances - 1); + num_advances - 1); while (num_advances > 1 && - last_advance == _advance_for_new_gid (plan, - num_advances - 2)) + last_advance == _advance_for_new_gid (plan, + num_advances - 2)) { - num_advances--; + num_advances--; } return num_advances; @@ -247,11 +247,11 @@ struct hmtxvmtx private: unsigned int _advance_for_new_gid (const hb_subset_plan_t *plan, - hb_codepoint_t new_gid) const + hb_codepoint_t new_gid) const { hb_codepoint_t old_gid; if (!plan->old_gid_for_new_gid (new_gid, &old_gid)) - return 0; + return 0; return get_advance (old_gid); } |