Skip to content

Commit

Permalink
[write-fonts] Add VariationStoreBuilder::is_empty
Browse files Browse the repository at this point in the history
I need this in fea-rs
  • Loading branch information
cmyr committed Nov 27, 2023
1 parent d447bf0 commit 35d82ab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions write-fonts/src/tables/variations/ivs_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ impl VariationStoreBuilder {
Default::default()
}

/// Returns `true` if no deltas have been added to this builder
pub fn is_empty(&self) -> bool {
match &self.delta_sets {
DeltaSetStorage::Direct(val) => val.is_empty(),
DeltaSetStorage::Deduplicated(val) => val.is_empty(),
}
}

/// Create a builder that does not share deltas between entries.
///
/// This is used in HVAR, where it is possible to use glyph ids as the
Expand Down

0 comments on commit 35d82ab

Please sign in to comment.