Update to typst 0.9.0

This commit is contained in:
Jack
2023-11-01 19:52:39 +00:00
parent 66c32157de
commit d01e7ed2e7
3 changed files with 565 additions and 332 deletions

889
compiler/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,8 +12,8 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
# Everything to do with Typst # Everything to do with Typst
typst = { git = "https://github.com/typst/typst.git", tag = "v0.8.0" } typst = { git = "https://github.com/typst/typst.git", tag = "v0.9.0" }
typst-library = { git = "https://github.com/typst/typst.git", tag = "v0.8.0" } typst-library = { git = "https://github.com/typst/typst.git", tag = "v0.9.0" }
comemo = "0.3" comemo = "0.3"

View File

@ -4,7 +4,7 @@ use fast_image_resize as fr;
use fr::Resizer; use fr::Resizer;
use typst::{ use typst::{
doc::Document, doc::Document,
geom::{Color, RgbaColor}, geom::Color,
}; };
use wasm_bindgen::Clamped; use wasm_bindgen::Clamped;
use web_sys::ImageData; use web_sys::ImageData;
@ -20,7 +20,7 @@ pub fn to_image(
let mut pixmap = typst::export::render( let mut pixmap = typst::export::render(
&document.pages[0], &document.pages[0],
pixel_per_pt, pixel_per_pt,
Color::Rgba(RgbaColor::from_str(&fill)?), Color::from_str(&fill)?,
); );
let width = pixmap.width(); let width = pixmap.width();