Files
vectorcraft/crates/svg/Cargo.toml
T
dotCooCoo c764c59825 SVG import: plaintext finds its first strong character across tspans
With `unicode-bidi: plaintext`, SVG import looked for the first strong
character of an element in each text node on its own and kept the
first answer. An isolate that opened in one text node and closed in a
later one hid the rest of that node, and the node then answered left
to right. For `&#x2067;ab<tspan>&#x2069;&#x5D0;</tspan>` the element
ran left to right, where UAX #9 P2 skips the isolate and finds the
right-to-left letter after it
(https://www.unicode.org/reports/tr9/#P2).

The characters of the whole `<text>` are now read once, in order, and
each isolate initiator is matched with its PDI (UAX #9 BD9). Each
element's first strong character is then found in constant time, so
nested `plaintext` elements do not read the same characters again. An
isolate that opens inside an element and closes after it hides the
rest of that element.

vectorcraft-svg takes `unicode-bidi` 0.3.18, which vectorcraft-text
already uses, for the bidi classes.
2026-11-14 03:50:57 -08:00

48 lines
1.7 KiB
TOML

[package]
name = "vectorcraft-svg"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "VectorCraft SVG import and export"
[lints]
workspace = true
[dependencies]
craft-svg = { workspace = true }
# Which paths stored in documents may be opened.
craft-docpath = { workspace = true }
vectorcraft-geom = { workspace = true }
vectorcraft-color = { workspace = true }
vectorcraft-doc = { workspace = true }
vectorcraft-effects = { workspace = true }
vectorcraft-brush = { workspace = true }
vectorcraft-text = { workspace = true }
vectorcraft-pathops = { workspace = true }
kurbo = { workspace = true }
usvg = { workspace = true }
thiserror = { workspace = true }
serde = { workspace = true }
# Live effect params read from filters.
serde_json = { workspace = true }
# SVGZ (gzip, pure-Rust backend: builds for wasm).
flate2 = { workspace = true }
image = { workspace = true }
# Colour / transform / length parsing for the <text> fallback (MIT OR Apache-2.0; already used by usvg).
svgtypes = "0.16"
simplecss = "0.2.2"
# Bidi classes for the first strong character of `unicode-bidi: plaintext` text (MIT OR Apache-2.0; already used by vectorcraft-text).
unicode-bidi = "0.3.18"
[dev-dependencies]
# Reading embedded font subsets back.
skrifa = { workspace = true }
# A variable font built in code (no font file is committed).
vectorcraft-text = { workspace = true, features = ["test-fonts"] }
resvg = { version = "0.45", default-features = false, features = ["raster-images"] }
# usvg as a reference viewer that lays text out in a font (text_layout.rs).
usvg = { workspace = true, features = ["text"] }
vectorcraft-testkit = { workspace = true }
proptest = { workspace = true }
image = { workspace = true }