Skip to content

Commit

Permalink
Use pure-rust woff decoder (woff2 crate)
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <[email protected]>
  • Loading branch information
nicoburns committed Dec 16, 2024
1 parent 6c1855b commit 6ecf49b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ reqwest = "0.12"

# Media & Decoding
image = { version = "0.25", default-features = false }
woff = "0.3.3"
woff2 = "0.3"
html-escape = "0.2.13"

# Other dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/blitz-dom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ slab = { workspace = true }
# Media & Decoding
image = { workspace = true }
usvg = { workspace = true }
woff = { workspace = true }
woff2 = { workspace = true }
html-escape = { workspace = true }

# IO & Networking
Expand Down
4 changes: 2 additions & 2 deletions packages/blitz-dom/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ impl NetHandler for FontFaceHandler {
match self.0 {
FontFaceSourceFormatKeyword::Woff2 => {
tracing::info!("Decompressing woff2 font");
let decompressed = woff::version2::decompress(&bytes);
if let Some(decompressed) = decompressed {
let decompressed = woff2::decode::convert_woff2_to_ttf(&mut bytes);
if let Ok(decompressed) = decompressed {
bytes = Bytes::from(decompressed);
} else {
tracing::warn!("Failed to decompress woff2 font");
Expand Down

0 comments on commit 6ecf49b

Please sign in to comment.