Skip to content

Commit

Permalink
Make a cosmetic adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed May 23, 2024
1 parent 2080589 commit f8b4922
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions src/formats/opentype/features/glyphs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ impl Glyphs for opentype::tables::glyph_substitution::Type {
record.records.iter().map(move |record| {
let mut value = Vec::with_capacity(record.glyph_count as usize);
value.push(glyph_id.into());
for glyph_id in record.glyph_ids.iter().cloned() {
value.push(glyph_id.into());
}
value.extend(record.glyph_ids.iter().cloned().map(Into::into));
(value, vec![record.glyph_id.into()])
})
},
Expand All @@ -128,9 +126,7 @@ impl Glyphs for opentype::tables::glyph_substitution::Type {
record.records.iter().map(move |record| {
let mut value = Vec::with_capacity(record.glyph_count as usize);
value.push(glyph_id.into());
for glyph_id in record.glyph_ids.iter().cloned() {
value.push(glyph_id.into());
}
value.extend(record.glyph_ids.iter().cloned().map(Into::into));
(value, Default::default())
})
},
Expand Down Expand Up @@ -176,16 +172,17 @@ impl Glyphs for opentype::tables::glyph_substitution::Type {
+ record.glyph_count as usize
+ record.forward_glyph_count as usize,
);
for glyph_id in record.backward_glyph_ids.iter().rev().cloned() {
value.push(glyph_id.into());
}
value.extend(
record
.backward_glyph_ids
.iter()
.rev()
.cloned()
.map(Into::into),
);
value.push(glyph_id.into());
for glyph_id in record.glyph_ids.iter().cloned() {
value.push(glyph_id.into());
}
for glyph_id in record.forward_glyph_ids.iter().cloned() {
value.push(glyph_id.into());
}
value.extend(record.glyph_ids.iter().cloned().map(Into::into));
value.extend(record.forward_glyph_ids.iter().cloned().map(Into::into));
(value, Default::default())
})
},
Expand Down

0 comments on commit f8b4922

Please sign in to comment.