Skip to content

Commit

Permalink
build: remove unnecessary deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Aug 25, 2024
1 parent 14bc5d9 commit 9fdfcb8
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 1 addition & 8 deletions crates/conversion/typst2vec/src/ir.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions crates/conversion/vec2dom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = []
Expand Down
7 changes: 3 additions & 4 deletions crates/conversion/vec2dom/src/canvas_backend.rs
Original file line number Diff line number Diff line change
@@ -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::*;

Expand Down
7 changes: 3 additions & 4 deletions crates/conversion/vec2dom/src/dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
8 changes: 3 additions & 5 deletions crates/conversion/vec2dom/src/incr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
18 changes: 9 additions & 9 deletions crates/conversion/vec2dom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -139,15 +139,15 @@ impl From<BBoxBuilder> 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,
Expand Down
6 changes: 3 additions & 3 deletions crates/conversion/vec2dom/src/svg_backend.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down

0 comments on commit 9fdfcb8

Please sign in to comment.