Re-order imports

This commit is contained in:
Laurenz Stampfl 2025-03-10 14:11:26 +01:00
parent 9622906e69
commit 30ad72145b
3 changed files with 27 additions and 23 deletions

View File

@ -1,5 +1,23 @@
use std::collections::{BTreeMap, HashMap, HashSet}; use std::collections::{BTreeMap, HashMap, HashSet};
use krilla::annotation::Annotation;
use krilla::destination::{NamedDestination, XyzDestination};
use krilla::error::KrillaError;
use krilla::page::PageLabel;
use krilla::path::PathBuilder;
use krilla::surface::Surface;
use krilla::{Configuration, Document, PageSettings, SerializeSettings, ValidationError};
use typst_library::diag::{bail, SourceResult};
use typst_library::foundations::NativeElement;
use typst_library::introspection::Location;
use typst_library::layout::{
Abs, Frame, FrameItem, GroupItem, PagedDocument, Size, Transform,
};
use typst_library::model::HeadingElem;
use typst_library::text::{Font, Lang};
use typst_library::visualize::{Geometry, Paint};
use typst_syntax::Span;
use crate::embed::embed_files; use crate::embed::embed_files;
use crate::image::handle_image; use crate::image::handle_image;
use crate::link::handle_link; use crate::link::handle_link;
@ -10,24 +28,6 @@ use crate::shape::handle_shape;
use crate::text::handle_text; use crate::text::handle_text;
use crate::util::{convert_path, display_font, AbsExt, TransformExt}; use crate::util::{convert_path, display_font, AbsExt, TransformExt};
use crate::PdfOptions; use crate::PdfOptions;
use krilla::annotation::Annotation;
use krilla::configure::{Configuration, PdfVersion, ValidationError};
use krilla::destination::{NamedDestination, XyzDestination};
use krilla::error::KrillaError;
use krilla::page::PageLabel;
use krilla::path::PathBuilder;
use krilla::surface::Surface;
use krilla::{Document, PageSettings, SerializeSettings};
use typst_library::diag::{bail, SourceResult};
use typst_library::foundations::NativeElement;
use typst_library::introspection::Location;
use typst_library::layout::{
Abs, Frame, FrameItem, GroupItem, PagedDocument, Size, Transform,
};
use typst_library::model::HeadingElem;
use typst_library::text::{Font, Lang};
use typst_library::visualize::{Geometry, Paint};
use typst_syntax::Span;
pub fn convert( pub fn convert(
typst_document: &PagedDocument, typst_document: &PagedDocument,
@ -514,7 +514,9 @@ fn collect_named_destinations(
fn get_configuration(options: &PdfOptions) -> SourceResult<Configuration> { fn get_configuration(options: &PdfOptions) -> SourceResult<Configuration> {
let config = match (options.pdf_version, options.validator) { let config = match (options.pdf_version, options.validator) {
(None, None) => Configuration::new_with_version(PdfVersion::Pdf17), (None, None) => {
Configuration::new_with_version(krilla::configure::PdfVersion::Pdf17)
}
(Some(pdf), None) => Configuration::new_with_version(pdf.into()), (Some(pdf), None) => Configuration::new_with_version(pdf.into()),
(None, Some(v)) => Configuration::new_with_validator(v.into()), (None, Some(v)) => Configuration::new_with_validator(v.into()),
(Some(pdf), Some(v)) => { (Some(pdf), Some(v)) => {

View File

@ -1,6 +1,7 @@
use std::sync::Arc;
use krilla::embed::{AssociationKind, EmbeddedFile}; use krilla::embed::{AssociationKind, EmbeddedFile};
use krilla::Document; use krilla::Document;
use std::sync::Arc;
use typst_library::diag::{bail, SourceResult}; use typst_library::diag::{bail, SourceResult};
use typst_library::foundations::{NativeElement, StyleChain}; use typst_library::foundations::{NativeElement, StyleChain};
use typst_library::layout::PagedDocument; use typst_library::layout::PagedDocument;

View File

@ -1,12 +1,13 @@
use crate::convert::{FrameContext, GlobalContext};
use crate::paint;
use crate::util::{convert_path, AbsExt, TransformExt};
use krilla::geom::Rect; use krilla::geom::Rect;
use krilla::path::{Path, PathBuilder}; use krilla::path::{Path, PathBuilder};
use krilla::surface::Surface; use krilla::surface::Surface;
use typst_library::diag::SourceResult; use typst_library::diag::SourceResult;
use typst_library::visualize::{Geometry, Shape}; use typst_library::visualize::{Geometry, Shape};
use crate::convert::{FrameContext, GlobalContext};
use crate::paint;
use crate::util::{convert_path, AbsExt, TransformExt};
pub(crate) fn handle_shape( pub(crate) fn handle_shape(
fc: &mut FrameContext, fc: &mut FrameContext,
shape: &Shape, shape: &Shape,