Skip to content

Commit

Permalink
use latest kurbo's BezPath::control_box instead of ControlBoundsPen
Browse files Browse the repository at this point in the history
because now we can: linebender/kurbo#306
  • Loading branch information
anthrotype committed Oct 4, 2023
1 parent 1d97dcd commit 615d7f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion write-fonts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ serde = ["dep:serde", "font-types/serde", "read-fonts/serde"]
font-types = { version = "0.4.0", path = "../font-types" }
read-fonts = { version = "0.11.2", path = "../read-fonts" }
log = "0.4"
kurbo = "0.9.4"
kurbo = "0.10.1"
dot2 = { version = "1.0", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
indexmap = "2.0"
Expand Down
5 changes: 1 addition & 4 deletions write-fonts/src/tables/glyf/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
use crate::{
from_obj::{FromObjRef, FromTableRef, ToOwnedTable},
pens::{self, ControlBoundsPen},
util::{self, MultiZip, WrappingGet},
FontWrite, OtRound,
};
Expand Down Expand Up @@ -572,10 +571,8 @@ fn simple_glyphs_from_kurbo(paths: &[BezPath]) -> Result<Vec<SimpleGlyph>, Malfo
for (contours, path) in glyph_contours.into_iter().zip(paths.iter()) {
// https://github.com/googlefonts/fontmake-rs/issues/285 we want control point box, not tight bbox
// so don't call path.bounding_box
let mut cbox_pen = ControlBoundsPen::new();
pens::write_to_pen(path, &mut cbox_pen);
glyphs.push(SimpleGlyph {
bbox: cbox_pen.bounds().unwrap_or_default().into(),
bbox: path.control_box().into(),
contours,
_instructions: Default::default(),
})
Expand Down

0 comments on commit 615d7f3

Please sign in to comment.