mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-14 06:22:24 +00:00
* Add craft-wordmodel: WordCraft's document model without its editing code
WordCraft's crates/doc (wordcraft-doc, at 07f97737) moved as it is, so the DOCX,
RTF, ODT and other text-format crates can read into and write from one model.
Module paths, type names and serde attributes are unchanged: an app that
re-exports the crate keeps its native file format.
Left in the app: range editing (edit.rs), IME text and equation editing. Not
model, and already in craft-libs: code pages (craft-rtf), the ZIP entry-count
check (craft-opc), the compound-file guard (craft-cfb). The paragraph walks
moved to walk.rs and the unit helpers of wordcraft-geom to geom.rs.
* craft-wordmodel: math_tree, the arguments of an equation node and a walk over its runs
The DOCX reader and writer walk an equation's runs. The walk and the child
accessors it uses were in WordCraft's equation editor (math_edit.rs), which
stays in the app; they are structure, not editing.
* craft-mime: detect, for bytes that name no character set
is_text, decode (BOM, unmarked UTF-16, UTF-8, else the legacy encoding
the bytes look like), legacy and legacy_label, behind a detect feature
that brings in chardetng. Moved from WordCraft's crates/formats/src/txt.rs
at 06c2ae6f with its text-sniffing tests. Also charset::is_known, so a
caller can tell a label decode would read as UTF-8 from one it knows.
* craft-wordmodel: keep the document operations (edit.rs) with the model
The DOCX and RTF readers use them: alternative-format chunks are merged into
a document with adopt_blocks, and a reader formats ranges with format_range
and inserts objects. They operate on the document, not on a view, so they
belong beside it. The tests that drove them come back with them; the
paragraph walks stay in walk.rs and edit re-exports them.
base64 0.23, as WordCraft and craft-offcrypto use.
* Add craft-math: the equation tree with OMML, MathML, LaTeX and UnicodeMath
The math tree, LaTeX, linear-format, symbol and tree-walk modules come
from craft-wordmodel (storytold/craft-libs#963, WordCraft's crates/doc at
07f97737) unchanged, with the run colour (Rgb) and the symbol-font tables
they use. MathML is WordCraft's crates/formats/src/mathml.rs and OMML is
WordCraft's crates/docx/src/read/math.rs and write/math.rs (06c2ae6f /
07f97737), moved onto craft-xml. The HTML-specific MathML tests stay in
WordCraft; the rest moved with the code.
mathml::parse and omml::parse/read_str/write_str are new: string entry
points for callers that have no tree of their own.
* craft-math: read MathLive's and other spellings of LaTeX math commands
\abs{...} (an absolute value), \lvert \rvert \lVert \rVert, \nparallel,
\backprime, \infinity, \cross, \differentialD, \exponentialE and
\imaginaryI (MathLive's d, upright e and i), \emph, \textsf, \hbox,
\mathnormal and \underleftarrow / \underrightarrow /
\underleftrightarrow were unknown and read as literal text. They are read
as equaSHion's typed-input parser reads them (storytold/craft-libs#29).
* craft-math: equaSHion's equation corpus as test data
corpus/equations.tsv, corpus/latex.tsv and the OMML samples of
storytold/craft-libs#29 (7a6ef6b9), unmodified.
* craft-math: corpus round trips, GridCraft's OMML cases, entry points and limits tested; README
The corpus equations go through OMML, MathML and LaTeX and back; the OMML
samples are written back as kept and from the tree. GridCraft's OMML to
LaTeX test cases (crates/xlsx/src/omml.rs) give LaTeX that reads back the
same through the tree. omml::parse and read_str are tested against other
prefixes, the strict namespace, kept OMML, junk, the element cap and deep
nesting.
* Add craft-flow: the flow model the text formats map to, on craft-wordmodel
WordCraft's crates/formats/src/model (07f97737) moved as it is: Flow,
FBlock, Para, Inline, Fmt, tables and cells, pictures, to_doc and
from_doc, picture sniffing, colours, base64 and the Dropped report. Only
the paths changed (wordcraft_doc is craft_wordmodel); the report helpers
are public so the format crates can call them; the image re-encoding
helper stays with WordCraft's RTF writer.
* Add craft-markdown: Markdown read and written, on craft-flow
WordCraft's crates/formats/src/markdown (07f97737) with its 35 tests,
moved onto craft-flow and craft-wordmodel. Character references come from
craft-html. The table cell budget lives in craft-flow, which names it in
its warning. Two test lines that wrote plain text through WordCraft's txt
module stay in WordCraft.
* WIP: craft-latex sources from WordCraft (unmodified)
* Add craft-latex: LaTeX documents read and written, on craft-flow
WordCraft's crates/formats/src/latex (07f97737) with its 21 tests, moved
onto craft-flow and craft-wordmodel; bytes are decoded by craft-mime's
detect. The LaTeX parts of WordCraft's cross-format tests (nesting,
column specs, labels, no TeX commands from the document, the fuzz and
round-trip properties) come along as tests/hostile.rs. The ligature test
builds its three-font paragraph as a flow instead of reading HTML.
* craft-math: latex_text, LaTeX math and the linear format converted as text
WordCraft's crates/formats/src/latex/math.rs (07f97737): the converter its
LaTeX document reader and writer use, which keeps the source's spacing.
It moves here so craft-math is the one place that converts LaTeX math;
craft-latex calls it, and its output does not change. Its tests (from
WordCraft's latex tests and cross-format tests) come along.
* craft-math: latex_text's group finders are public, for craft-latex's length parser
* craft-latex: math through craft_math::latex_text; label timing test by ratio
The document math converter moved to craft-math (#1040) unchanged; this
crate calls it there (and its length parser uses its group finders), so
export output is the same. The label test compared one read with a
ten-second wall clock and failed on a loaded machine; it now compares the
fastest of three reads of 25,000 and 100,000 labels, which a linear read
keeps near 4x and a quadratic one near 16x.
---------
Co-authored-by: shuff57 <62350898+shuff57@users.noreply.github.com>
196 lines
9.1 KiB
TOML
196 lines
9.1 KiB
TOML
[workspace]
|
|
resolver = "3"
|
|
members = ["crates/*"]
|
|
exclude = ["vendor/krilla", "vendor/hayro", "vendor/hayro-interpret", "vendor/hayro-syntax", "vendor/hayro-jbig2", "vendor/hayro-cmap", "vendor/hayro-postscript", "vendor/linesweeper"]
|
|
|
|
[workspace.package]
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
license = "MIT OR Apache-2.0"
|
|
rust-version = "1.95"
|
|
repository = "https://github.com/storytold/craft-libs"
|
|
|
|
[workspace.dependencies]
|
|
# internal: add each crate here as `craft-<name> = { path = "crates/<name>" }`
|
|
craft-platform = { path = "crates/platform" }
|
|
craft-aep = { path = "crates/aep" }
|
|
craft-affinity = { path = "crates/affinity" }
|
|
craft-ai-core = { path = "crates/ai-core" }
|
|
craft-pdf = { path = "crates/pdf", version = "=0.1.0" }
|
|
craft-pdn = { path = "crates/pdn" }
|
|
craft-plate-test = { path = "crates/plate-test" }
|
|
krilla = { version = "=0.8.2", default-features = false, features = ["raster-images"] }
|
|
hayro = { version = "=0.7.1", default-features = false }
|
|
hayro-interpret = { version = "=0.7.0", default-features = false, features = ["embed-fonts", "embed-cmaps"] }
|
|
hayro-syntax = { version = "=0.7.2", default-features = false, features = ["std"] }
|
|
bytemuck = "1"
|
|
kurbo = "0.13"
|
|
thiserror = "2"
|
|
craft-aaf = { path = "crates/aaf" }
|
|
craft-atomic = { path = "crates/atomic" }
|
|
craft-captions = { path = "crates/captions" }
|
|
craft-cfb = { path = "crates/cfb" }
|
|
craft-codepage = { path = "crates/codepage" }
|
|
craft-cms = { path = "crates/cms" }
|
|
craft-crs = { path = "crates/crs" }
|
|
craft-crw = { path = "crates/crw" }
|
|
craft-csv = { path = "crates/csv" }
|
|
craft-dav = { path = "crates/dav" }
|
|
craft-dialogs = { path = "crates/dialogs" }
|
|
craft-docx = { path = "crates/docx" }
|
|
craft-dxf = { path = "crates/dxf" }
|
|
craft-drawingml = { path = "crates/drawingml" }
|
|
craft-eps = { path = "crates/eps" }
|
|
craft-doc = { path = "crates/doc" }
|
|
craft-docpath = { path = "crates/docpath" }
|
|
craft-dpx = { path = "crates/dpx" }
|
|
craft-ecproj-format = { path = "crates/ecproj-format" }
|
|
craft-figma-rest = { path = "crates/figma-rest" }
|
|
craft-exr = { path = "crates/exr" }
|
|
craft-font-catalog = { path = "crates/font-catalog" }
|
|
craft-font-manager = { path = "crates/font-manager" }
|
|
craft-font-store = { path = "crates/font-store" }
|
|
craft-gainmap = { path = "crates/gainmap" }
|
|
craft-flow = { path = "crates/flow" }
|
|
craft-gcode = { path = "crates/gcode" }
|
|
craft-gif = { path = "crates/gif" }
|
|
craft-hdr = { path = "crates/hdr" }
|
|
craft-mesh = { path = "crates/mesh" }
|
|
craft-html = { path = "crates/html" }
|
|
craft-heif = { path = "crates/heif" }
|
|
craft-fig = { path = "crates/fig" }
|
|
craft-fonts-build = { path = "crates/fonts-build" }
|
|
craft-i18n = { path = "crates/i18n" }
|
|
craft-idml = { path = "crates/idml" }
|
|
craft-jmap = { path = "crates/jmap" }
|
|
craft-ical = { path = "crates/ical" }
|
|
craft-jpeg = { path = "crates/jpeg" }
|
|
craft-kiwi = { path = "crates/kiwi" }
|
|
craft-keymap = { path = "crates/keymap" }
|
|
craft-assuan = { path = "crates/assuan" }
|
|
craft-kra = { path = "crates/kra" }
|
|
craft-audio = { path = "crates/audio" }
|
|
# No default features, so craft-audio's `encode` builds craft-media without `isobmff`.
|
|
craft-latex = { path = "crates/latex" }
|
|
craft-markdown = { path = "crates/markdown" }
|
|
craft-math = { path = "crates/math" }
|
|
craft-media = { path = "crates/media", default-features = false }
|
|
craft-media-testkit = { path = "crates/media-testkit" }
|
|
craft-midi = { path = "crates/midi" }
|
|
craft-mime = { path = "crates/mime" }
|
|
craft-odf = { path = "crates/odf" }
|
|
craft-ods = { path = "crates/ods" }
|
|
craft-prc = { path = "crates/prc" }
|
|
craft-lottie = { path = "crates/lottie" }
|
|
craft-menu = { path = "crates/menu" }
|
|
craft-metafile = { path = "crates/metafile" }
|
|
craft-offcrypto = { path = "crates/offcrypto" }
|
|
craft-opc = { path = "crates/opc" }
|
|
craft-ora = { path = "crates/ora" }
|
|
craft-penpot = { path = "crates/penpot" }
|
|
craft-pcraft-format = { path = "crates/pcraft-format" }
|
|
craft-plotter = { path = "crates/plotter" }
|
|
craft-prepress = { path = "crates/prepress" }
|
|
craft-print = { path = "crates/print" }
|
|
craft-proof = { path = "crates/proof" }
|
|
craft-raster-codecs = { path = "crates/raster-codecs" }
|
|
craft-psd = { path = "crates/psd" }
|
|
craft-pst = { path = "crates/pst" }
|
|
craft-quit = { path = "crates/quit" }
|
|
craft-rtf = { path = "crates/rtf" }
|
|
craft-raw = { path = "crates/raw" }
|
|
craft-sheet = { path = "crates/sheet" }
|
|
craft-sketch = { path = "crates/sketch" }
|
|
craft-settings = { path = "crates/settings" }
|
|
craft-silhouette-studio = { path = "crates/silhouette-studio" }
|
|
craft-svg = { path = "crates/svg" }
|
|
craft-svg-paths = { path = "crates/svg-paths" }
|
|
craft-stream-codecs = { path = "crates/stream-codecs" }
|
|
craft-text = { path = "crates/text" }
|
|
craft-tga = { path = "crates/tga" }
|
|
craft-timeline = { path = "crates/timeline" }
|
|
craft-tiff = { path = "crates/tiff" }
|
|
craft-metadata = { path = "crates/metadata" }
|
|
craft-ui = { path = "crates/ui" }
|
|
craft-update = { path = "crates/update" }
|
|
craft-vcard = { path = "crates/vcard" }
|
|
craft-vectorcraft-format = { path = "crates/vectorcraft-format" }
|
|
craft-vectordrawable = { path = "crates/vectordrawable" }
|
|
craft-xls = { path = "crates/xls" }
|
|
craft-wordmodel = { path = "crates/wordmodel" }
|
|
craft-xlsx = { path = "crates/xlsx" }
|
|
craft-xcf = { path = "crates/xcf" }
|
|
craft-xml = { path = "crates/xml" }
|
|
craft-zip = { path = "crates/zip" }
|
|
craft-y4m = { path = "crates/y4m" }
|
|
craft-epub = { path = "crates/epub" }
|
|
craft-ews = { path = "crates/ews" }
|
|
craft-video = { path = "crates/video" }
|
|
craft-web-api = { path = "crates/web-api" }
|
|
craft-window = { path = "crates/window" }
|
|
craft-web-host = { path = "crates/web-host" }
|
|
craft-webp = { path = "crates/webp" }
|
|
egui = { version = "0.37", default-features = false }
|
|
md5 = { package = "md-5", version = "0.10", default-features = false }
|
|
rayon = "1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
proptest = "1"
|
|
# Character sets of the WHATWG Encoding Standard (craft-mime). (Apache-2.0 OR MIT) AND BSD-3-Clause.
|
|
encoding_rs = "0.8"
|
|
# All date/time conversion goes through chrono (no hand-rolled calendar code beyond the 400-year range extension; AGENTS.md).
|
|
chrono = { version = "0.4.45", default-features = false, features = ["std"] }
|
|
|
|
[workspace.lints.rust]
|
|
unsafe_code = "forbid"
|
|
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(craft_pdf_unicode_fixtures)"] }
|
|
|
|
[workspace.lints.clippy]
|
|
cognitive_complexity = "deny"
|
|
too_many_arguments = "deny"
|
|
wildcard_imports = "deny"
|
|
dbg_macro = "warn"
|
|
todo = "warn"
|
|
|
|
[patch.crates-io]
|
|
krilla = { path = "vendor/krilla" }
|
|
|
|
hayro = { path = "vendor/hayro" }
|
|
hayro-interpret = { path = "vendor/hayro-interpret" }
|
|
hayro-syntax = { path = "vendor/hayro-syntax" }
|
|
hayro-jbig2 = { path = "vendor/hayro-jbig2" }
|
|
hayro-cmap = { path = "vendor/hayro-cmap" }
|
|
hayro-postscript = { path = "vendor/hayro-postscript" }
|
|
linesweeper = { path = "vendor/linesweeper" }
|
|
ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui-winit = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui_glow = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui_extras = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
eframe = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
|
|
winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
|
|
|
|
# symphonia's FLAC decoder restores LPC samples as `residual + (prediction as i32)`. In a valid
|
|
# 32-bit stream the prediction can leave the i32 range while the sum does not, so a debug build
|
|
# panics where a release build wraps to the right sample. Apps that decode 32-bit FLAC through
|
|
# craft-audio's `decode` need the same override in their own workspace.
|
|
[profile.dev.package.symphonia-bundle-flac]
|
|
overflow-checks = false
|
|
|
|
# Codec hot loops: the oracle and conformance tests of a debug build take minutes below opt-level 3.
|
|
[profile.dev.package.craft-video]
|
|
opt-level = 3
|
|
|
|
# The object-stream parser follows nesting 384 levels deep: unoptimised, its frames overflow the
|
|
# 2 MiB stack of a test thread. The apps this reader came from build their crates at this level.
|
|
[profile.dev.package.craft-affinity]
|
|
opt-level = 1
|