From be7cfc85d08c545abfac08098b7b33b4bd71f37e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 27 Oct 2024 19:04:55 +0100 Subject: Split out four new crates (#5302) --- crates/typst-svg/Cargo.toml | 3 ++- crates/typst-svg/src/image.rs | 4 ++-- crates/typst-svg/src/lib.rs | 8 ++++---- crates/typst-svg/src/paint.rs | 8 ++++---- crates/typst-svg/src/shape.rs | 4 ++-- crates/typst-svg/src/text.rs | 8 ++++---- 6 files changed, 18 insertions(+), 17 deletions(-) (limited to 'crates/typst-svg') diff --git a/crates/typst-svg/Cargo.toml b/crates/typst-svg/Cargo.toml index df49a2b1..41d35565 100644 --- a/crates/typst-svg/Cargo.toml +++ b/crates/typst-svg/Cargo.toml @@ -13,9 +13,10 @@ keywords = { workspace = true } readme = { workspace = true } [dependencies] -typst = { workspace = true } +typst-library = { workspace = true } typst-macros = { workspace = true } typst-timing = { workspace = true } +typst-utils = { workspace = true } base64 = { workspace = true } comemo = { workspace = true } ecow = { workspace = true } diff --git a/crates/typst-svg/src/image.rs b/crates/typst-svg/src/image.rs index 87bfbd27..ede4e76e 100644 --- a/crates/typst-svg/src/image.rs +++ b/crates/typst-svg/src/image.rs @@ -1,7 +1,7 @@ use base64::Engine; use ecow::{eco_format, EcoString}; -use typst::layout::{Abs, Axes}; -use typst::visualize::{Image, ImageFormat, RasterFormat, VectorFormat}; +use typst_library::layout::{Abs, Axes}; +use typst_library::visualize::{Image, ImageFormat, RasterFormat, VectorFormat}; use crate::SVGRenderer; diff --git a/crates/typst-svg/src/lib.rs b/crates/typst-svg/src/lib.rs index deb5fb00..0ae7b2da 100644 --- a/crates/typst-svg/src/lib.rs +++ b/crates/typst-svg/src/lib.rs @@ -10,12 +10,12 @@ use std::fmt::{self, Display, Formatter, Write}; use ecow::EcoString; use ttf_parser::OutlineBuilder; -use typst::layout::{ +use typst_library::layout::{ Abs, Frame, FrameItem, FrameKind, GroupItem, Page, Point, Ratio, Size, Transform, }; -use typst::model::Document; -use typst::utils::hash128; -use typst::visualize::{Geometry, Gradient, Pattern}; +use typst_library::model::Document; +use typst_library::visualize::{Geometry, Gradient, Pattern}; +use typst_utils::hash128; use xmlwriter::XmlWriter; use crate::paint::{GradientRef, PatternRef, SVGSubGradient}; diff --git a/crates/typst-svg/src/paint.rs b/crates/typst-svg/src/paint.rs index 364cdd23..58348c94 100644 --- a/crates/typst-svg/src/paint.rs +++ b/crates/typst-svg/src/paint.rs @@ -2,10 +2,10 @@ use std::f32::consts::TAU; use ecow::{eco_format, EcoString}; use ttf_parser::OutlineBuilder; -use typst::foundations::Repr; -use typst::layout::{Angle, Axes, Frame, Quadrant, Ratio, Size, Transform}; -use typst::utils::hash128; -use typst::visualize::{Color, FillRule, Gradient, Paint, Pattern, RatioOrAngle}; +use typst_library::foundations::Repr; +use typst_library::layout::{Angle, Axes, Frame, Quadrant, Ratio, Size, Transform}; +use typst_library::visualize::{Color, FillRule, Gradient, Paint, Pattern, RatioOrAngle}; +use typst_utils::hash128; use xmlwriter::XmlWriter; use crate::{Id, SVGRenderer, State, SvgMatrix, SvgPathBuilder}; diff --git a/crates/typst-svg/src/shape.rs b/crates/typst-svg/src/shape.rs index 12be2e22..e188ed8b 100644 --- a/crates/typst-svg/src/shape.rs +++ b/crates/typst-svg/src/shape.rs @@ -1,7 +1,7 @@ use ecow::EcoString; use ttf_parser::OutlineBuilder; -use typst::layout::{Abs, Ratio, Size, Transform}; -use typst::visualize::{ +use typst_library::layout::{Abs, Ratio, Size, Transform}; +use typst_library::visualize::{ FixedStroke, Geometry, LineCap, LineJoin, Paint, Path, PathItem, RelativeTo, Shape, }; diff --git a/crates/typst-svg/src/text.rs b/crates/typst-svg/src/text.rs index 4a99b4b8..76cd53cb 100644 --- a/crates/typst-svg/src/text.rs +++ b/crates/typst-svg/src/text.rs @@ -3,10 +3,10 @@ use std::io::Read; use base64::Engine; use ecow::EcoString; use ttf_parser::GlyphId; -use typst::layout::{Abs, Point, Ratio, Size, Transform}; -use typst::text::{Font, TextItem}; -use typst::utils::hash128; -use typst::visualize::{FillRule, Image, Paint, RasterFormat, RelativeTo}; +use typst_library::layout::{Abs, Point, Ratio, Size, Transform}; +use typst_library::text::{Font, TextItem}; +use typst_library::visualize::{FillRule, Image, Paint, RasterFormat, RelativeTo}; +use typst_utils::hash128; use crate::{SVGRenderer, State, SvgMatrix, SvgPathBuilder}; -- cgit v1.2.3