From 5c2b9add8b566a1bdae65cb587c415141021a99c Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 31 Jul 2026 14:48:34 +0300 Subject: [PATCH] fix(build): use Iced AW 0.15 fork --- Cargo.lock | 139 +++++++++-------------------------------------------- Cargo.toml | 79 +----------------------------- 2 files changed, 24 insertions(+), 194 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b835b5ab..b9084e01c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,10 +29,10 @@ dependencies = [ "flate2", "fontdb", "getrandom 0.3.4", - "glam 0.33.2", + "glam", "iced", "iced_aw", - "iced_core 0.15.0-dev", + "iced_core", "image", "inventory", "js-sys", @@ -1973,12 +1973,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "glam" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3" - [[package]] name = "glam" version = "0.33.2" @@ -2207,12 +2201,12 @@ name = "iced" version = "0.15.0-dev" source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb7b8546ed84db39#23604ff22ab0aad9e00b9327cb7b8546ed84db39" dependencies = [ - "iced_core 0.15.0-dev", + "iced_core", "iced_debug", - "iced_futures 0.15.0-dev", - "iced_renderer 0.15.0-dev", + "iced_futures", + "iced_renderer", "iced_runtime", - "iced_widget 0.15.0-dev", + "iced_widget", "iced_winit", "image", "thiserror 2.0.18", @@ -2221,29 +2215,11 @@ dependencies = [ [[package]] name = "iced_aw" version = "0.14.1" -source = "git+https://github.com/tsuza/iced_aw.git?rev=a9301708a4d008dc17f63cbbbb2b2aa06e0e7352#a9301708a4d008dc17f63cbbbb2b2aa06e0e7352" +source = "git+https://github.com/HakanSeven12/iced_aw.git?branch=agent%2Ffix-iced-fonts#9bff59df71c215abe91710870634886967fc9f1c" dependencies = [ - "iced_core 0.15.0-dev", - "iced_fonts", - "iced_widget 0.15.0-dev", - "web-time", -] - -[[package]] -name = "iced_core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ab1937d699403e7e69252ae743a902bcee9f4ab2052cc4c9a46fcf34729d85" -dependencies = [ - "bitflags 2.13.1", - "bytes", - "glam 0.25.0", - "lilt", - "log", - "num-traits", - "rustc-hash 2.1.3", - "smol_str 0.2.2", - "thiserror 2.0.18", + "iced_core", + "iced_fonts_macros", + "iced_widget", "web-time", ] @@ -2254,7 +2230,7 @@ source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb dependencies = [ "bitflags 2.13.1", "bytes", - "glam 0.33.2", + "glam", "lilt", "log", "num-traits", @@ -2270,22 +2246,11 @@ name = "iced_debug" version = "0.15.0-dev" source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb7b8546ed84db39#23604ff22ab0aad9e00b9327cb7b8546ed84db39" dependencies = [ - "iced_core 0.15.0-dev", - "iced_futures 0.15.0-dev", + "iced_core", + "iced_futures", "log", ] -[[package]] -name = "iced_fonts" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "214cff7c8499e328774216690e58e315a1a5f8f6fdd1035aed6298e62ffc4c1d" -dependencies = [ - "iced_core 0.14.0", - "iced_fonts_macros", - "iced_widget 0.14.2", -] - [[package]] name = "iced_fonts_macros" version = "0.3.0" @@ -2298,27 +2263,13 @@ dependencies = [ "ttf-parser", ] -[[package]] -name = "iced_futures" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c0c85ccad42dfbec7293c36c018af0ea0dbcc52d137a4a9a0b0f6822a3fdf0a" -dependencies = [ - "futures", - "iced_core 0.14.0", - "log", - "rustc-hash 2.1.3", - "wasm-bindgen-futures", - "wasmtimer", -] - [[package]] name = "iced_futures" version = "0.15.0-dev" source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb7b8546ed84db39#23604ff22ab0aad9e00b9327cb7b8546ed84db39" dependencies = [ "futures", - "iced_core 0.15.0-dev", + "iced_core", "log", "rustc-hash 2.1.3", "smol", @@ -2326,25 +2277,6 @@ dependencies = [ "wasmtimer", ] -[[package]] -name = "iced_graphics" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234ca1c2cec4155055f68fa5fad1b5242c496ac8238d80a259bca382fb44a102" -dependencies = [ - "bitflags 2.13.1", - "bytemuck", - "cosmic-text 0.15.0", - "half", - "iced_core 0.14.0", - "iced_futures 0.14.0", - "log", - "raw-window-handle", - "rustc-hash 2.1.3", - "thiserror 2.0.18", - "unicode-segmentation", -] - [[package]] name = "iced_graphics" version = "0.15.0-dev" @@ -2354,8 +2286,8 @@ dependencies = [ "bytemuck", "cosmic-text 0.19.0", "half", - "iced_core 0.15.0-dev", - "iced_futures 0.15.0-dev", + "iced_core", + "iced_futures", "image", "kamadak-exif", "log", @@ -2371,27 +2303,16 @@ name = "iced_program" version = "0.15.0-dev" source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb7b8546ed84db39#23604ff22ab0aad9e00b9327cb7b8546ed84db39" dependencies = [ - "iced_graphics 0.15.0-dev", + "iced_graphics", "iced_runtime", ] -[[package]] -name = "iced_renderer" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "250cc0802408e8c077986ec56c7d07c65f423ee658a4b9fd795a1f2aae5dac05" -dependencies = [ - "iced_graphics 0.14.0", - "log", - "thiserror 2.0.18", -] - [[package]] name = "iced_renderer" version = "0.15.0-dev" source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb7b8546ed84db39#23604ff22ab0aad9e00b9327cb7b8546ed84db39" dependencies = [ - "iced_graphics 0.15.0-dev", + "iced_graphics", "iced_tiny_skia", "iced_wgpu", "log", @@ -2404,8 +2325,8 @@ version = "0.15.0-dev" source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb7b8546ed84db39#23604ff22ab0aad9e00b9327cb7b8546ed84db39" dependencies = [ "bytes", - "iced_core 0.15.0-dev", - "iced_futures 0.15.0-dev", + "iced_core", + "iced_futures", "thiserror 2.0.18", ] @@ -2417,7 +2338,7 @@ dependencies = [ "bytemuck", "cosmic-text 0.19.0", "iced_debug", - "iced_graphics 0.15.0-dev", + "iced_graphics", "kurbo 0.10.4", "log", "resvg", @@ -2437,7 +2358,7 @@ dependencies = [ "futures", "guillotiere", "iced_debug", - "iced_graphics 0.15.0-dev", + "iced_graphics", "log", "lyon", "resvg", @@ -2446,26 +2367,12 @@ dependencies = [ "wgpu", ] -[[package]] -name = "iced_widget" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1596afa0d3109c2618e8bc12bae6c11d3064df8f95c42dfce570397dbe957ab" -dependencies = [ - "iced_renderer 0.14.0", - "log", - "num-traits", - "rustc-hash 2.1.3", - "thiserror 2.0.18", - "unicode-segmentation", -] - [[package]] name = "iced_widget" version = "0.15.0-dev" source = "git+https://github.com/iced-rs/iced.git?rev=23604ff22ab0aad9e00b9327cb7b8546ed84db39#23604ff22ab0aad9e00b9327cb7b8546ed84db39" dependencies = [ - "iced_renderer 0.15.0-dev", + "iced_renderer", "iced_runtime", "log", "num-traits", diff --git a/Cargo.toml b/Cargo.toml index e0bf293ba..a5718585f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,10 +5,6 @@ edition = "2021" build = "build.rs" [workspace] -# `dwg-thumbnailer-win` is a Windows-only COM DLL (`#![cfg(windows)]`): it -# compiles to an empty cdylib on Linux/macOS and to the real handler on Windows, -# where the `build-windows` CI job (`cargo build --release`) compiles and thus -# verifies it. members = [ "crates/ocs_plugin_api", "crates/ocs_web_worker", @@ -16,134 +12,72 @@ members = [ "crates/dwg-thumbnailer-win", ] -# Embed the application icon into the Windows .exe so Explorer, the taskbar, -# the Start-menu tile and file-association entries show it (issue #107). [target.'cfg(windows)'.build-dependencies] winresource = "0.1" [features] default = ["solid3d"] -# 3-D solid modelling: B-rep tessellation (truck-meshalgo) and booleans -# (truck-shapeops). Disabled for wasm builds — truck-meshalgo pulls -# vtkio → xz2 → lzma-sys (a C library) that does not cross-compile to -# wasm32. Without this feature the app is a 2-D CAD editor; the Model tab, -# solid tessellation and ACIS import become no-ops. solid3d = ["dep:truck-meshalgo", "dep:truck-shapeops", "dep:lzma-sys"] [dependencies] -# JSON: plugin marketplace / Patreon fetch (native) + web supporters.json parse, -# and the consolidated user config (settings.json) via serde-derived structs. serde_json = "1" serde = { version = "1", features = ["derive"] } semver = "1" -# Stable, dependency-free add-on contract (manifest + ribbon/CadModule types). -# Plugin authors target this crate's semver, not OpenCADStudio internals. -# The `host` feature (out-of-process plugin runtime: interprocess, libloading, -# memmap2, rkyv) is native-only — see the per-target sections below; the web -# build gets the dependency-free manifest/ribbon contract. -# vtkio (pulled in transitively via truck-meshalgo) depends on xz2 → lzma-sys, -# which by default links the system liblzma dynamically. On macOS that bakes a -# Homebrew dylib path (/opt/homebrew/.../liblzma.5.dylib) into the binary, so -# the .app crashes on launch on machines without that exact library (#56). -# Forcing the `static` feature builds liblzma from the bundled source, making -# the binary self-contained on every platform. lzma-sys = { version = "0.1", features = ["static"], optional = true } iced = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39", features = ["image", "svg", "advanced", "canvas", "smol", "markdown"] } iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } -# iced_aw 0.15 compatibility is pending upstream in PR #432. Pin the exact -# reviewed pair of commits so Iced and its additional widgets cannot drift. -iced_aw = { git = "https://github.com/tsuza/iced_aw.git", rev = "a9301708a4d008dc17f63cbbbb2b2aa06e0e7352", features = ["menu", "context_menu", "color_picker", "drop_down"] } +iced_aw = { git = "https://github.com/HakanSeven12/iced_aw.git", branch = "agent/fix-iced-fonts", features = ["menu", "context_menu", "color_picker", "drop_down"] } bytemuck = { version = "1.25", features = ["derive"] } glam = { version = "0.33", features = ["bytemuck"] } truck-modeling = "0.6" truck-meshalgo = { version = "0.4", default-features = false, features = ["tessellation"], optional = true } truck-polymesh = "0.6" rfd = "0.17" -# Command-line parsing: file arg, --serve/--export/--script and the headless flags. clap = { version = "4", features = ["derive"] } -# Opt-in logging via --log / RUST_LOG (surfaces wgpu / iced / winit diagnostics). env_logger = "0.11" acadrust = { version = "0.4", features = ["serde"] } -# Shared DWG embedded-preview extraction (Start-page + file-manager thumbnails). dwg-thumbnailer = { path = "crates/dwg-thumbnailer" } flate2 = "1" image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] } inventory = "0.3" truck-shapeops = { version = "0.4", optional = true } -# Fast non-cryptographic hasher. Handle/u64 keys dominate the hot block, -# hatch, draw-depth and wire caches; the default SipHash is overkill there. rustc-hash = "2" -# TrueType/OpenType support: fontdb enumerates the user's installed system -# fonts; ttf-parser extracts glyph outlines we flatten into CAD wire strokes. -# Both are already in the tree transitively via iced's cosmic-text, so pinning -# them here adds no new downloads. fontdb = "0.23" ttf-parser = "0.25" -# Full text-layout engine: shaping (ligatures, Arabic joining, kerning), bidi -# reordering, and — crucially — automatic font fallback (a glyph missing from -# the chosen family is shaped from another installed font). We use it only to -# obtain positioned (font, glyph-id) runs; outlines come from ttf-parser and -# render through our own wire pipeline. cosmic-text = "0.15" lyon_tessellation = "1.0.20" -# Exact line/arc polyline offsets with self-intersection slicing and stitching. cavalier_contours = "=0.7.0" [dev-dependencies] -# Shader-interface regression tests. This is already present transitively -# through wgpu; declaring it here lets tests inspect WGSL entry-point budgets. naga = { version = "27", features = ["wgsl-in"] } [target.'cfg(target_os = "windows")'.dependencies] -# Win32_System_Com — COM behind "Set as default app" -# (IApplicationAssociationRegistrationUI dialog). -# Win32_System_Registry — HKCU registration that lists the app under -# "Open with" for the portable .exe. windows-sys = { version = "0.61", features = ["Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", "Win32_System_Com", "Win32_System_Registry", "Win32_Storage_FileSystem", "Win32_Foundation"] } [target.'cfg(target_os = "linux")'.dependencies] -# Mint an xdg-activation token for external URL handlers on Wayland. The token -# is passed to xdg-open so an existing browser window may take focus. ashpd = { version = "0.13.13", default-features = false, features = ["async-io", "wayland"] } [patch.crates-io] -# Track standard DWG object relationships used by the scene integration. acadrust = { git = "https://github.com/OpenAEC-Foundation/acadifc.git", rev = "a7b1e07" } -# iced_aw's 0.15 branch declares the split Iced crates by version. Resolve -# those declarations to the same Iced commit as the application dependency. iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } iced_widget = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -# Native enables the plugin host runtime (out-of-process plugins). ocs_plugin_api = { path = "crates/ocs_plugin_api", features = ["host"] } rayon = "1" open = "5" -# PDF export / printing. Native-only: printpdf pulls a wasm-incompatible -# `memchr` (1.0.2) via lopdf → nom_locate, and the web build has no filesystem. printpdf = { version = "0.9.1", default-features = false } ureq = { version = "3", default-features = false, features = ["rustls", "platform-verifier", "win-system-proxy"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -# Web gets the dependency-free manifest/ribbon contract only (no plugin host). ocs_plugin_api = { path = "crates/ocs_plugin_api" } console_error_panic_hook = "0.1" -# Log facade (already in the tree via wgpu/iced): lets the web build install a -# logger that mirrors wgpu/naga pipeline errors into a copyable on-page banner — -# a WebGL2 pipeline that fails to build otherwise just leaves the canvas empty. log = "0.4" -# ahash (via acadrust) pulls getrandom 0.3, which needs the `wasm_js` backend -# enabled to support wasm32-unknown-unknown (plus the matching rustflag in -# .cargo/config.toml). getrandom = { version = "0.3", features = ["wasm_js"] } wasm-bindgen = "0.2" -# fetch() returns a JS Promise; bridge it to a Rust future for the per-script -# web font loader (#141). wasm-bindgen-futures = "0.4" js-sys = "0.3" bincode = "1.3" -# window.open (external URLs) + Blob/anchor file downloads (Save) + fetch() -# (Response) for the lazy per-script web font loader (#141). web-sys = { version = "=0.3.85", features = [ "Window", "Storage", @@ -167,27 +101,16 @@ web-sys = { version = "=0.3.85", features = [ "WorkerType", "MessageEvent", "ErrorEvent", - # Async clipboard read for paste into the text/MText editors (iced's own - # clipboard read is a no-op on the web). "Clipboard", - # Web copy/paste in plain text_input fields (#346): Ctrl+C writes the - # focused field's text; Ctrl+V replays the clipboard as synthetic - # KeyboardEvents on the canvas (the only route into a focused text_input). "KeyboardEvent", "KeyboardEventInit", "EventInit", "EventTarget", "BeforeUnloadEvent", - # Error banner (web_diag): forward wgpu/naga errors to the browser console - # and inject a copyable DOM overlay (document.body → append_child). "console", "Node", "HtmlElement", ] } -# Browsers without WebGPU (e.g. Firefox by default) need wgpu's WebGL2 backend; -# `webgl` enables it. `fira-sans` embeds the default UI font — the web has no -# system fonts, so without it all iced text (ribbon labels, command line) is -# blank. Features merge with the main `iced` dependency. iced = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39", features = ["webgl", "fira-sans"] } [profile.release]