Use hb_enumerate in more places
This commit is contained in:
parent
02bc4dd69b
commit
2cdaedaf54
|
@ -372,7 +372,7 @@ struct MarkBasePosFormat1 : public OT::Layout::GPOS_impl::MarkBasePosFormat1_2<S
|
||||||
if (!mark_coverage) return false;
|
if (!mark_coverage) return false;
|
||||||
hb_set_t marks = sc.marks_for (0, count);
|
hb_set_t marks = sc.marks_for (0, count);
|
||||||
auto new_coverage =
|
auto new_coverage =
|
||||||
+ hb_zip (hb_range (), mark_coverage.table->iter ())
|
+ hb_enumerate (mark_coverage.table->iter ())
|
||||||
| hb_filter (marks, hb_first)
|
| hb_filter (marks, hb_first)
|
||||||
| hb_map_retains_sorting (hb_second)
|
| hb_map_retains_sorting (hb_second)
|
||||||
;
|
;
|
||||||
|
@ -431,7 +431,7 @@ struct MarkBasePosFormat1 : public OT::Layout::GPOS_impl::MarkBasePosFormat1_2<S
|
||||||
if (!mark_coverage) return false;
|
if (!mark_coverage) return false;
|
||||||
hb_set_t marks = sc.marks_for (start, end);
|
hb_set_t marks = sc.marks_for (start, end);
|
||||||
auto new_coverage =
|
auto new_coverage =
|
||||||
+ hb_zip (hb_range (), mark_coverage.table->iter ())
|
+ hb_enumerate (mark_coverage.table->iter ())
|
||||||
| hb_filter (marks, hb_first)
|
| hb_filter (marks, hb_first)
|
||||||
| hb_map_retains_sorting (hb_second)
|
| hb_map_retains_sorting (hb_second)
|
||||||
;
|
;
|
||||||
|
|
|
@ -337,13 +337,13 @@ struct fvar
|
||||||
{
|
{
|
||||||
const InstanceRecord *instance = get_instance (i);
|
const InstanceRecord *instance = get_instance (i);
|
||||||
|
|
||||||
if (hb_any (+ hb_zip (instance->get_coordinates (axisCount), hb_range ((unsigned)axisCount))
|
if (hb_any (+ hb_enumerate (instance->get_coordinates (axisCount))
|
||||||
| hb_filter (pinned_axes, hb_second)
|
| hb_filter (pinned_axes, hb_first)
|
||||||
| hb_map ([&] (const hb_pair_t<const F16DOT16&, unsigned>& _)
|
| hb_map ([&] (const hb_pair_t<unsigned, const F16DOT16&>& _)
|
||||||
{
|
{
|
||||||
hb_tag_t axis_tag = pinned_axes.get (_.second);
|
hb_tag_t axis_tag = pinned_axes.get (_.first);
|
||||||
float location = user_axes_location->get (axis_tag);
|
float location = user_axes_location->get (axis_tag);
|
||||||
if (fabs ((double)location - (double)_.first.to_float ()) > 0.001) return true;
|
if (fabs ((double)location - (double)_.second.to_float ()) > 0.001) return true;
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
))
|
))
|
||||||
|
|
|
@ -85,10 +85,8 @@ static void
|
||||||
_remap_indexes (const hb_set_t *indexes,
|
_remap_indexes (const hb_set_t *indexes,
|
||||||
hb_map_t *mapping /* OUT */)
|
hb_map_t *mapping /* OUT */)
|
||||||
{
|
{
|
||||||
unsigned count = indexes->get_population ();
|
for (auto _ : + hb_enumerate (indexes->iter ()))
|
||||||
|
mapping->set (_.second, _.first);
|
||||||
for (auto _ : + hb_zip (indexes->iter (), hb_range (count)))
|
|
||||||
mapping->set (_.first, _.second);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue