readme: explain the cargo feature 'textlayout'
@@ -19,6 +19,7 @@ Skia-safe wraps most parts of the public Skia C++ APIs:
- [x] PDF & SVG rendering
- [ ] Skia Modules
- [x] Text shaping with [Harfbuzz](https://www.freedesktop.org/wiki/Software/HarfBuzz/) and [ICU](http://site.icu-project.org/home).
+ - [x] Text layout (skparagraph)
- [ ] Animation via [Skottie](https://skia.org/user/modules/skottie)
- [ ] GPU Backends
- [x] Vulkan
@@ -31,17 +32,17 @@ Wrappers for functions that take callbacks and virtual classes are not supported
Skia-safe supports the following features that can be configured [via cargo](https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section):
-### Feature `vulkan`
+### `vulkan`
Vulkan support can be enabled by setting the Cargo feature `default = ["vulkan"]` in `skia-safe/Cargo.toml`, which will cause a rebuild of Skia. To render the examples with Vulkan use `cargo run --example skia-org -- [OUTPUT_DIR] --driver vulkan`.
Note that Vulkan drivers need to be available. On Windows, they are most likely available already, on Linux [this article on linuxconfig.org](<https://linuxconfig.org/install-and-test-vulkan-on-linux>) might get you started, and on macOS with Metal support, [install the Vulkan SDK](<https://vulkan.lunarg.com/sdk/home>) for Mac and configure MoltenVK by setting the `DYLD_LIBRARY_PATH`, `VK_LAYER_PATH`, and `VK_ICD_FILENAMES` environment variables as described in `Documentation/getting_started_macos.html`.
-### Feature `svg`
+### `svg`
This feature enables the SVG rendering backend. To create a new Skia canvas that renders to SVG, use the function `skia-safe::svg::Canvas::new()`.
-### Feature `shaper`
+### `shaper`
The Cargo feature `shaper` enables text shaping with Harfbuzz and ICU.
@@ -49,4 +50,9 @@ On **Windows**, the file `icudtl.dat` must be available in your executable's dir
A simple example can be found [in the skia-org command line application](https://github.com/rust-skia/rust-skia/blob/master/skia-safe/examples/skia-org/skshaper_example.rs).
+### `textlayout`
+
+This feature makes the Skia module skparagraph available, which contains types that are used to lay out paragraphs. In Rust, the types are available from the `skia_safe::textlayout` module.
+
+A code snippet that lays out a paragraph can be found [in the skia-org example](https://github.com/rust-skia/rust-skia/blob/master/skia-safe/examples/skia-org/skshaper_example.rs).
