Skip to content

Commit 4ba677e

Browse files
authored
Bump to fontdb 0.15 + usvg 0.36 (#41)
1 parent 4654803 commit 4ba677e

9 files changed

Lines changed: 74 additions & 40 deletions

File tree

Cargo.lock

Lines changed: 29 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ required-features = ["cli"]
3737
[dependencies]
3838
miniz_oxide = "0.7"
3939
pdf-writer = "0.9"
40-
usvg = { version = "0.35", default-features = false }
40+
usvg = { version = "0.36", default-features = false }
4141
image = { version = "0.24", default-features = false, features = ["jpeg", "png", "gif"], optional = true }
4242
termcolor = { version = "1", optional = true }
4343
clap = { version = "4.4.2", features = ["derive"], optional = true }
44-
fontdb = { version = "0.14", optional= true }
44+
fontdb = { version = "0.15", optional= true }
4545

4646
[dev-dependencies]
47-
usvg = { version = "0.35.0" }
47+
usvg = { version = "0.36.0" }

src/util/helper.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ impl LineJoinExt for LineJoin {
115115
fn to_pdf_line_join(&self) -> LineJoinStyle {
116116
match self {
117117
LineJoin::Miter => LineJoinStyle::MiterJoin,
118+
//TODO: is it possible to implement this in PDF?
119+
LineJoin::MiterClip => LineJoinStyle::MiterJoin,
118120
LineJoin::Round => LineJoinStyle::RoundJoin,
119121
LineJoin::Bevel => LineJoinStyle::BevelJoin,
120122
}
@@ -147,6 +149,8 @@ pub trait GroupExt {
147149
}
148150

149151
impl GroupExt for usvg::Group {
152+
// We use this instead of usvg's should_isolate method because that one also includes
153+
// clip paths, which shouldn't strictly be necessary but only bloats the file size in PDF.
150154
fn is_isolated(&self) -> bool {
151155
// According to the SVG spec, any of these makes a group isolated.
152156
self.isolate

tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ path = "src/typst.rs"
2828
test = false
2929

3030
[dependencies]
31-
fontdb = "0.14"
31+
fontdb = "0.15"
3232
svg2pdf = { path = ".." }
33-
usvg = "0.35.0"
33+
usvg = "0.36.0"
3434
pdfium-render = "0.8.6"
3535
walkdir = "2.3.3"
3636
lazy_static = "1.4.0"
225 Bytes
Loading
1.54 KB
Loading
Lines changed: 8 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)