diff options
Diffstat (limited to 'crates/typst-cli/src')
| -rw-r--r-- | crates/typst-cli/src/compile.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/typst-cli/src/compile.rs b/crates/typst-cli/src/compile.rs index d1526425..cc85d920 100644 --- a/crates/typst-cli/src/compile.rs +++ b/crates/typst-cli/src/compile.rs @@ -10,10 +10,9 @@ use parking_lot::RwLock; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use typst::diag::{bail, Severity, SourceDiagnostic, StrResult, Warned}; use typst::foundations::{Datetime, Smart}; -use typst::layout::{Frame, PageRanges}; +use typst::layout::{Frame, Page, PageRanges}; use typst::model::Document; use typst::syntax::{FileId, Source, Span}; -use typst::visualize::Color; use typst::WorldExt; use crate::args::{ @@ -269,7 +268,7 @@ fn export_image( Output::Stdout => Output::Stdout, }; - export_image_page(command, &page.frame, &output, fmt)?; + export_image_page(command, page, &output, fmt)?; Ok(()) }) .collect::<Result<Vec<()>, EcoString>>()?; @@ -309,13 +308,13 @@ mod output_template { /// Export single image. fn export_image_page( command: &CompileCommand, - frame: &Frame, + page: &Page, output: &Output, fmt: ImageExportFormat, ) -> StrResult<()> { match fmt { ImageExportFormat::Png => { - let pixmap = typst_render::render(frame, command.ppi / 72.0, Color::WHITE); + let pixmap = typst_render::render(page, command.ppi / 72.0); let buf = pixmap .encode_png() .map_err(|err| eco_format!("failed to encode PNG file ({err})"))?; @@ -324,7 +323,7 @@ fn export_image_page( .map_err(|err| eco_format!("failed to write PNG file ({err})"))?; } ImageExportFormat::Svg => { - let svg = typst_svg::svg(frame); + let svg = typst_svg::svg(page); output .write(svg.as_bytes()) .map_err(|err| eco_format!("failed to write SVG file ({err})"))?; |
