Reformat & rearrange imports

This commit is contained in:
Laurenz Stampfl 2025-07-20 00:36:56 +02:00
parent 5427645c7a
commit d19b45784c
2 changed files with 9 additions and 8 deletions

View File

@ -9,9 +9,9 @@ use krilla::embed::EmbedError;
use krilla::error::KrillaError;
use krilla::geom::PathBuilder;
use krilla::page::{PageLabel, PageSettings};
use krilla::pdf::PdfError;
use krilla::surface::Surface;
use krilla::{Document, SerializeSettings};
use krilla::pdf::PdfError;
use krilla_svg::render_svg_glyph;
use typst_library::diag::{bail, error, SourceDiagnostic, SourceResult};
use typst_library::foundations::{NativeElement, Repr};
@ -373,8 +373,8 @@ fn finish(
let pdf_ver = v.as_str();
let config_ver = configuration.version();
let cur_ver = config_ver.as_str();
bail!(span,
bail!(span,
"the version of the PDF file is too high";
hint: "the current export target is {cur_ver}, while the PDF has version {pdf_ver}";
hint: "raise the export target to {pdf_ver} or higher";
@ -616,7 +616,7 @@ fn convert_error(
"embedding PDFs is currently not supported in this export mode";
hint: "try converting the PDF to SVG before embedding it"
)
},
}
}
}

View File

@ -1,9 +1,10 @@
use std::borrow::Cow;
use std::sync::Arc;
use base64::Engine;
use ecow::{eco_format, EcoString};
use hayro::{FontData, FontQuery, InterpreterSettings, RenderSettings, StandardFont};
use image::{codecs::png::PngEncoder, ImageEncoder};
use std::borrow::Cow;
use std::sync::Arc;
use typst_library::foundations::Smart;
use typst_library::layout::{Abs, Axes};
use typst_library::visualize::{
@ -71,8 +72,8 @@ pub fn convert_image_to_base64_url(image: &Image) -> EcoString {
ImageKind::Svg(svg) => ("svg+xml", Cow::Borrowed(svg.data())),
ImageKind::Pdf(pdf) => {
// To make sure the image isn't pixelated, we always scale up so the lowest
// dimension has at least 1000 pixels. However, we also ensure that the largest dimension
// doesn't exceed 3000 pixels.
// dimension has at least 1000 pixels. However, we only scale up as much so that the
// largest dimension doesn't exceed 3000 pixels.
const MIN_WIDTH: f32 = 1000.0;
const MAX_WIDTH: f32 = 3000.0;