| 1 | [package] |
| 2 | name = "draw" |
| 3 | version = "0.1.0" |
| 4 | edition = "2024" |
| 5 | publish = false |
| 6 | |
| 7 | [features] |
| 8 | default = ["wgpu"] |
| 9 | # The renderer; `edit` needs only parley. It submits through wgpu, or without it through |
| 10 | # OpenGL 2.1, for Mac OS X 10.6. On Windows it has Direct3D 11 and OpenGL besides, as Windows |
| 11 | # 7 has no Direct3D 12, on macOS OpenGL, and in a browser the 2D canvas; its maker picks one. |
| 12 | render = ["dep:base64", "dep:bytemuck", "dep:image", "dep:linebender_resource_handle", "dep:roxmltree", "dep:skrifa", "dep:swash"] |
| 13 | wgpu = ["render", "dep:wgpu", "dep:windows", "dep:js-sys", "dep:wasm-bindgen", "dep:web-sys"] |
| 14 | # Writes layers as PDF pages, text as real text in subset fonts. |
| 15 | pdf = ["render", "dep:miniz_oxide", "dep:pdf-writer", "dep:subsetter"] |
| 16 | |
| 17 | [dependencies] |
| 18 | parley.workspace = true |
| 19 | # std's clock where there is one; the browser's on wasm32-unknown-unknown, whose std has none. |
| 20 | web-time = "1.1" |
| 21 | |
| 22 | base64 = { version = "0.23.1", default-features = false, features = ["std"], optional = true } |
| 23 | bytemuck = { version = "1.25", features = ["derive"], optional = true } |
| 24 | image = { version = "0.25", default-features = false, features = ["gif", "jpeg", "png", "tiff"], optional = true } |
| 25 | linebender_resource_handle = { version = "0.1.1", optional = true } |
| 26 | miniz_oxide = { version = "0.8", optional = true } |
| 27 | pdf-writer = { version = "0.15", optional = true } |
| 28 | roxmltree = { version = "0.21", optional = true } |
| 29 | subsetter = { version = "0.2.6", default-features = false, optional = true } |
| 30 | # COLRv1 glyphs, which swash can't paint. |
| 31 | skrifa = { version = "0.44.0", optional = true } |
| 32 | swash = { version = "0.2.10", optional = true } |
| 33 | wgpu = { workspace = true, optional = true } |
| 34 | |
| 35 | [target.'cfg(windows)'.dependencies] |
| 36 | windows = { version = "0.62", default-features = false, optional = true, features = [ |
| 37 | "Win32_Graphics_Direct3D", |
| 38 | "Win32_Graphics_Direct3D11", |
| 39 | "Win32_Graphics_DirectComposition", |
| 40 | "Win32_Graphics_Dxgi_Common", |
| 41 | "Win32_System_LibraryLoader", |
| 42 | "Win32_UI_WindowsAndMessaging", |
| 43 | ] } |
| 44 | |
| 45 | [target.'cfg(target_arch = "wasm32")'.dependencies] |
| 46 | js-sys = { version = "0.3", optional = true } |
| 47 | wasm-bindgen = { version = "0.2", optional = true } |
| 48 | web-sys = { version = "0.3", optional = true, features = [ |
| 49 | "CanvasGradient", |
| 50 | "CanvasRenderingContext2d", |
| 51 | "CanvasWindingRule", |
| 52 | "console", |
| 53 | "CssStyleDeclaration", |
| 54 | "Document", |
| 55 | "DomRect", |
| 56 | "Element", |
| 57 | "HtmlCanvasElement", |
| 58 | "HtmlElement", |
| 59 | "ImageData", |
| 60 | "Node", |
| 61 | "Window", |
| 62 | ] } |
| 63 | |
| 64 | [dev-dependencies] |
| 65 | pollster = "0.4" |
| 66 | png = "0.18" |
| 67 | |
| 68 | [[example]] |
| 69 | name = "snowflakes" |
| 70 | required-features = ["wgpu"] |