Kas Tutorials

These tutorials concern the Kas GUI system. See also the Kas examples and 7GUIs examples.

Further reading can be found on the Kas blog.

Please ask questions on the discussion boards or on the tutorials issue tracker.

Requirements

It is assumed that you are already familiar with the Rust language. If not, then Learn Rust! You are not expected to master Rust before learning Kas, but this tutorial series assumes a moderate understanding of the language.

Kas supports both nightly and stable Rust. Due to the nature of procedural macros, better diagnostics are available when using nightly.

Tutorials use the latest stable release of Kas, currently v0.14.

Examples

All significant examples can be found as working apps in the example directory.

To run the examples locally, check out the tutorials repository, then run e.g.:

git clone https://github.com/kas-gui/tutorials.git
cd tutorials
cargo run --example counter

Kas Dependencies

What is kas? Here is a heavily-reduced dependency tree:

kas — Wrapper crate to expose all components under a single API
├── kas-core — Core types, traits and event handling
│   ├── arboard — Clipboard support (optional)
│   ├── async-global-executor — Executor supporting EventState::push_spawn (optional)
│   ├── easy-cast — Numeric type-casting, re-exposed as kas::cast
│   ├── kas-macros (proc-macro) — Macros
│   │   └── impl-tools-lib — Backend used to implement macros
│   ├── kas-text — Font handling, type setting
│   │   ├── ab_glyph — Glyph rastering
│   │   ├── harfbuzz_rs — Shaping (optional)
│   │   ├── pulldown-cmark — Markdown parsing (optional)
│   │   └── rustybuzz — Shaping (optional, default)
│   ├── log — Logging facade
│   ├── serde — Serialization support for persistent configuration (optional)
│   ├── serde_json, serde_yaml, ron — Output formats for configuration (optional)
│   ├── smithay-clipboard — Wayland clipboard support (optional)
│   └── winit — Cross-platform window creation
│   │   └── raw-window-handle — Interoperability for Rust Windowing applications
├── kas-widgets — Standard widget collection
├── kas-resvg — Canvas and Svg widgets
│   ├── resvg — An SVG rendering library
│   └── tiny-skia — Tiny CPU-only Skia subset
├── kas-view — "View widgets" over data models (optional)
└── kas-wgpu — Kas graphics backend over WGPU
    └── wgpu — Rusty WebGPU API wrapper

Licence

This tutorial, including text but excluding code samples, is licensed under CC BY-SA 4.0

Code samples found within this tutorial are marked with CC0 1.0