Skip to content

Commit

Permalink
bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
staticintlucas committed Oct 12, 2024
1 parent dea31f7 commit e4ad849
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
allow-unwrap-in-tests = true
allowed-duplicate-crates = ["bitflags"]
allowed-duplicate-crates = ["bitflags", "itertools"]
doc-valid-idents = ["sRGB", "OpenType", "InDesign", ".."]
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ profile = { package = "keyset-profile", path = "keyset-profile", version = "0.3.
assert_matches = "1.5"
euclid = "0.22"
indoc = "2.0"
interp = { version = "1.0", features = ["interp_array"] }
interp = "2.0"
isclose = "0.1"
kle-serial = "0.3"
log = "0.4"
miniz_oxide = "0.7"
miniz_oxide = "0.8"
ouroboros = "0.18"
pdf-writer = "0.9"
pdf-writer = "0.12"
rgb = { version = "0.8", default-features = false }
saturate = "0.1"
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = "1.0"
svg = "0.17"
svg = "0.18"
tiny-skia = { version = "0.11", default-features = false }
toml = { version = "0.8", default-features = false, features = ["parse"] }
ttf-parser = { version = "0.21", default-features = false, features = ["std"] }
ttf-parser = { version = "0.25", default-features = false, features = ["std"] }

[workspace.lints.rust]
future-incompatible = "warn"
Expand Down
5 changes: 3 additions & 2 deletions keyset-font/src/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Face {
self.borrow_face().names()
}

pub fn italic_angle(&self) -> Option<f32> {
pub fn italic_angle(&self) -> f32 {
self.borrow_face().italic_angle()
}

Expand Down Expand Up @@ -155,6 +155,7 @@ impl Face {
#[cfg(test)]
mod tests {
use assert_matches::assert_matches;
use isclose::assert_is_close;

use super::*;

Expand Down Expand Up @@ -229,7 +230,7 @@ mod tests {
let face = Face::from_ttf(data).unwrap();

assert_eq!(face.names().len(), 4);
assert_eq!(face.italic_angle(), None);
assert_is_close!(face.italic_angle(), 0.0);
assert_eq!(face.ascender(), 1024);
assert_eq!(face.descender(), -400);
assert_eq!(face.line_gap(), 0);
Expand Down
8 changes: 4 additions & 4 deletions keyset-font/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ impl Font {

/// The font's slope angle, anticlockwise being positive
#[inline]
pub fn slope(&self) -> Option<Angle> {
self.face.italic_angle().map(Angle::degrees) // Negate so forward = positive
pub fn slope(&self) -> Angle {
Angle::degrees(self.face.italic_angle())
}

/// The number of glyph outlines in the font
Expand Down Expand Up @@ -471,7 +471,7 @@ mod tests {
assert_is_close!(font.descender(), Length::new(400.0));
assert_is_close!(font.line_gap(), Length::new(0.0));
assert_is_close!(font.line_height(), Length::new(1424.0));
assert_eq!(font.slope(), None);
assert_is_close!(font.slope(), Angle::degrees(0.0));
assert_eq!(font.num_glyphs(), 3);

let data = std::fs::read(env!("NULL_TTF")).unwrap();
Expand All @@ -487,7 +487,7 @@ mod tests {
assert_is_close!(font.descender(), Length::new(400.0));
assert_is_close!(font.line_gap(), Length::new(200.0));
assert_is_close!(font.line_height(), Length::new(1200.0));
assert_eq!(font.slope(), None);
assert_is_close!(font.slope(), Angle::degrees(0.0));
assert_eq!(font.num_glyphs(), 1); // Just .notdef
}

Expand Down
7 changes: 5 additions & 2 deletions keyset-profile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use geom::{
Dot, ExtRect, Inch, Length, Mm, Point, Rect, RoundRect, SideOffsets, Size, Unit, Vector,
DOT_PER_INCH, DOT_PER_MM, DOT_PER_UNIT,
};
use interp::interp_array;
use interp::{interp_array, InterpMode};
use key::Homing;
use saturate::SaturatingFrom;

Expand Down Expand Up @@ -160,7 +160,10 @@ impl TextHeight {
};

let all_indices = array::from_fn(f32::saturating_from);
Self(interp_array(&indices, &heights, &all_indices).map(Length::<Dot>::new))
Self(
interp_array(&indices, &heights, &all_indices, &InterpMode::Extrapolate)
.map(Length::<Dot>::new),
)
}
}

Expand Down

0 comments on commit e4ad849

Please sign in to comment.