diff --git a/Cargo.toml b/Cargo.toml index 2a6621fd..91f86932 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,7 @@ typst-syntax = "0.11.1" ttf-parser = "0.20.0" typst-assets = "0.11.1" -typst-dev-assets = "0.11.1" +typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", tag = "v0.11.1" } # general anyhow = "1" diff --git a/crates/conversion/typst2vec/src/ir.rs b/crates/conversion/typst2vec/src/ir.rs index 0edbc343..086371ef 100644 --- a/crates/conversion/typst2vec/src/ir.rs +++ b/crates/conversion/typst2vec/src/ir.rs @@ -1,17 +1,10 @@ use std::sync::Arc; -use reflexo::hash::Fingerprint; +use reflexo::hash::{item_hash128, Fingerprint}; pub use reflexo::vector::ir::*; - use ttf_parser::GlyphId; use typst::text::Font; -// use super::{preludes::*, ImageItem, PathStyle}; -use crate::{ - hash::item_hash128, - // vector::vm::{GroupContext, TransformContext}, -}; - /// A glyph item. #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub enum GlyphItem { diff --git a/crates/conversion/vec2dom/Cargo.toml b/crates/conversion/vec2dom/Cargo.toml index a7926062..ecde89f9 100644 --- a/crates/conversion/vec2dom/Cargo.toml +++ b/crates/conversion/vec2dom/Cargo.toml @@ -16,7 +16,6 @@ svgtypes.workspace = true tiny-skia.workspace = true tiny-skia-path.workspace = true -reflexo-typst.workspace = true reflexo.workspace = true reflexo-typst2vec.workspace = true reflexo-vec2canvas.workspace = true @@ -47,7 +46,7 @@ web-sys = { workspace = true, features = [ default = [] # "debug_repaint", "debug_repaint_svg", "debug_repaint_canvas" no-content-hint = ["reflexo-typst2vec/no-content-hint"] -experimental-ligature = ["reflexo-typst/experimental-ligature"] +experimental-ligature = ["reflexo-typst2vec/experimental-ligature"] aggresive-browser-rasterization = [] debug_repaint = [] debug_repaint_svg = [] diff --git a/crates/conversion/vec2dom/src/canvas_backend.rs b/crates/conversion/vec2dom/src/canvas_backend.rs index 13ad4375..07ac5e73 100644 --- a/crates/conversion/vec2dom/src/canvas_backend.rs +++ b/crates/conversion/vec2dom/src/canvas_backend.rs @@ -1,8 +1,7 @@ -use reflexo_typst::error::prelude::ZResult; -use reflexo_typst::vector::ir::{Module, Page}; -use reflexo_typst::vector::vm::RenderVm; +use reflexo::error::prelude::*; +use reflexo::vector::ir::{self, Module, Page, Point, Scalar}; +use reflexo::vector::vm::RenderVm; use reflexo_vec2canvas::{BBoxAt, CanvasElem, CanvasNode, CanvasOp, CanvasTask, ExportFeature}; -use reflexo_vec2svg::ir::{self, Point, Scalar}; use crate::dom::*; diff --git a/crates/conversion/vec2dom/src/dom.rs b/crates/conversion/vec2dom/src/dom.rs index 912e50ef..f0b2484c 100644 --- a/crates/conversion/vec2dom/src/dom.rs +++ b/crates/conversion/vec2dom/src/dom.rs @@ -4,11 +4,10 @@ use std::{ sync::{Arc, Mutex}, }; -use reflexo_typst::error::prelude::*; -use reflexo_typst::hash::Fingerprint; -use reflexo_typst::vector::ir::{Page, Point, Scalar, Size, TextItem, TransformItem}; +use reflexo::error::prelude::*; +use reflexo::hash::Fingerprint; +use reflexo::vector::ir::{self, Module, Page, Point, Scalar, Size, TextItem, TransformItem}; use reflexo_vec2canvas::{CanvasElem, CanvasNode, CanvasOp, CanvasStateGuard}; -use reflexo_vec2svg::{ir, Module}; use web_sys::{ js_sys::Reflect, wasm_bindgen::{JsCast, JsValue}, diff --git a/crates/conversion/vec2dom/src/incr.rs b/crates/conversion/vec2dom/src/incr.rs index b667f7f2..2d7a5b78 100644 --- a/crates/conversion/vec2dom/src/incr.rs +++ b/crates/conversion/vec2dom/src/incr.rs @@ -4,11 +4,9 @@ use std::{ }; use js_sys::Reflect; -use reflexo::{ - error::prelude::*, - hash::Fingerprint, - vector::ir::{FontItem, FontRef, LayoutRegionNode, Module, Page, VecItem}, -}; +use reflexo::error::prelude::*; +use reflexo::hash::Fingerprint; +use reflexo::vector::ir::{FontItem, FontRef, LayoutRegionNode, Module, Page, VecItem}; use reflexo_typst2vec::incr::{IncrDocClient, IncrDocServer}; use reflexo_vec2canvas::{CanvasElem, CanvasOp}; use wasm_bindgen::prelude::*; diff --git a/crates/conversion/vec2dom/src/lib.rs b/crates/conversion/vec2dom/src/lib.rs index 6d65e7f6..1b6cfe6d 100644 --- a/crates/conversion/vec2dom/src/lib.rs +++ b/crates/conversion/vec2dom/src/lib.rs @@ -5,14 +5,14 @@ mod incr; mod semantics_backend; mod svg_backend; -use comemo::Prehashed; -use reflexo_typst::hash::Fingerprint; -use reflexo_typst::vector::ir::{ - self, Abs, Axes, FontItem, GlyphRef, Ratio, Rect, Scalar, Transform, -}; -use reflexo_typst::vector::vm::{GroupContext, RenderVm, TransformContext}; use std::ops::Deref; use std::sync::Arc; + +use comemo::Prehashed; +use reflexo::hash::Fingerprint; +use reflexo::vector::ir::{self, Abs, Axes, FontItem, GlyphRef, Ratio, Rect, Scalar, Transform}; +use reflexo::vector::vm::{GroupContext, RenderVm, TransformContext}; +use reflexo_typst2vec::ir::GlyphItem; use tiny_skia as sk; pub use crate::dom::DomPage; @@ -139,15 +139,15 @@ impl From for BBox { /// Internal methods for [`BBoxBuilder`]. impl BBoxBuilder { - pub fn render_glyph_inner(&mut self, pos: Scalar, _id: &GlyphRef, glyph: &ir::GlyphItem) { + pub fn render_glyph_inner(&mut self, pos: Scalar, _id: &GlyphRef, glyph: &GlyphItem) { let pos = ir::Point::new(pos, Scalar(0.)); match glyph { - ir::GlyphItem::Outline(outline) => { + GlyphItem::Outline(outline) => { let path = PathRepr::from_path_data(&outline.d).unwrap(); self.inner .push((pos, BBox::new(BBoxRepr::Node(Box::new(path))))) } - ir::GlyphItem::Image(image_item) => self.inner.push(( + GlyphItem::Image(image_item) => self.inner.push(( pos, BBox::new(BBoxRepr::Transform(( image_item.ts, diff --git a/crates/conversion/vec2dom/src/svg_backend.rs b/crates/conversion/vec2dom/src/svg_backend.rs index 6407fa80..65bd78a7 100644 --- a/crates/conversion/vec2dom/src/svg_backend.rs +++ b/crates/conversion/vec2dom/src/svg_backend.rs @@ -1,8 +1,8 @@ #![allow(dead_code)] -use reflexo_typst::hash::Fingerprint; -use reflexo_typst::vector::ir::{self, Module, Page, TransformedRef, VecItem}; -use reflexo_typst::vector::{incr::IncrDocClient, vm::RenderVm}; +use reflexo::hash::Fingerprint; +use reflexo::vector::ir::{self, Module, Page, TransformedRef, VecItem}; +use reflexo::vector::{incr::IncrDocClient, vm::RenderVm}; use reflexo_vec2canvas::BBoxAt; use reflexo_vec2svg::{SvgExporter, SvgTask, SvgText}; use web_sys::{wasm_bindgen::JsCast, Element, SvgGraphicsElement};