Skip to content

Commit

Permalink
[write-fonts] implement From trait to convert VariationIndex => u32
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype committed Oct 20, 2023
1 parent 00fe058 commit acabc97
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions write-fonts/src/tables/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,12 @@ fn encode_chunk(chunk: &[i8], mask: u8, bits: usize) -> u16 {
out
}

impl From<VariationIndex> for u32 {
fn from(value: VariationIndex) -> Self {
((value.delta_set_outer_index as u32) << 16) | value.delta_set_inner_index as u32
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit acabc97

Please sign in to comment.