Skip to content

Commit

Permalink
fontbe/features.rs: must iterate over static_metadata.variable_axes, …
Browse files Browse the repository at this point in the history
…not just .axes

... just like in the line immediately above this, we initialized a Vec::with_capacity(self.static_metadata.variable_axes.len())

Otherwise if len(variable_axes) != len(axes) -- like in the case of Oswald -- we get spurious errors about Missing tent for <axis>

Fixes #426
  • Loading branch information
anthrotype committed Sep 5, 2023
1 parent 6560166 commit e55afdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fontbe/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl<'a> VariationInfo for FeaVariationInfo<'a> {
// https://learn.microsoft.com/en-us/typography/opentype/spec/otvarcommonformats#variation-regions
// Array of region axis coordinates records, in the order of axes given in the 'fvar' table.
let mut region_axes = Vec::with_capacity(self.static_metadata.variable_axes.len());
for axis in self.static_metadata.axes.iter() {
for axis in self.static_metadata.variable_axes.iter() {
let Some(tent) = region.get(&axis.tag) else {
return Err(Box::new(MissingTentError::new(axis.tag)));
};
Expand Down

0 comments on commit e55afdc

Please sign in to comment.