From 1770cbf7d88b7bf719204fe063cc7504d3eb3c62 Mon Sep 17 00:00:00 2001 From: GoldStrikeArch Date: Sat, 6 Jun 2026 09:31:33 +0200 Subject: [PATCH 1/3] fix: add font-kit mentioning in GPUI readme --- crates/gpui/README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/gpui/README.md b/crates/gpui/README.md index 6d4a37932ff6fe..8017378ebb9287 100644 --- a/crates/gpui/README.md +++ b/crates/gpui/README.md @@ -5,16 +5,20 @@ for Rust, designed to support a wide variety of applications. ## Getting Started -GPUI is still in active development as we work on the Zed code editor, and is still pre-1.0. There will often be breaking changes between versions. You'll also need to use the latest version of stable Rust and be on macOS or Linux. Add the following to your `Cargo.toml`: +GPUI is still in active development as we work on the Zed code editor, and is still pre-1.0. There will often be breaking changes between versions. You'll also need to use the latest version of stable Rust and be on macOS, Linux, FreeBSD, or Windows. Add the following to your `Cargo.toml` when depending on GPUI from the Zed repository: ```toml -gpui = { version = "*" } +gpui = { git = "https://github.com/zed-industries/zed" } +gpui_platform = { git = "https://github.com/zed-industries/zed", features = ["font-kit", "wayland", "x11"] } ``` - [Ownership and data flow](_ownership_and_data_flow) - [Accessibility](_accessibility) -Everything in GPUI starts with an `Application`. You can create one with `Application::new()`, and kick off your application by passing a callback to `Application::run()`. Inside this callback, you can create a new window with `App::open_window()`, and register your first root view. See [gpui.rs](https://www.gpui.rs/) for a complete example. +Everything in a standalone GPUI app starts with an `Application`. You can create one with `gpui_platform::application()`, which picks the windowing and text backends for the host OS, and kick off your application by passing a callback to `Application::run()`. Inside this callback, you can create a new window with `App::open_window()` and register your first root view. The features on `gpui_platform` are platform-specific, so the list above is a safe cross-platform default. If you build for a single platform, you can trim it: +- **macOS** — enable `font-kit`. Rendering uses Metal and is always available, but glyph rasterization needs `font-kit`. Without it, GPUI falls back to a placeholder text system that lays text out but renders no glyphs. Use `features = ["font-kit"]`. +- **Linux / FreeBSD** — enable at least one windowing backend for desktop windows: `wayland`, `x11`, or both. These features also compile the renderer and text system, so no separate text feature is needed. Use `features = ["wayland", "x11"]`. +- **Windows** — no features are required. Windowing uses Win32 and text uses DirectWrite, both built in, and `font-kit` has no effect here. Omit the `features` field. ### Dependencies From 5ed9e0c6a71ec52281639d7d6a096443ff30842a Mon Sep 17 00:00:00 2001 From: Christopher Biscardi Date: Mon, 8 Jun 2026 21:50:53 -0700 Subject: [PATCH 2/3] fixup --- crates/gpui/README.md | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/crates/gpui/README.md b/crates/gpui/README.md index 8017378ebb9287..48066e583673e2 100644 --- a/crates/gpui/README.md +++ b/crates/gpui/README.md @@ -5,21 +5,48 @@ for Rust, designed to support a wide variety of applications. ## Getting Started -GPUI is still in active development as we work on the Zed code editor, and is still pre-1.0. There will often be breaking changes between versions. You'll also need to use the latest version of stable Rust and be on macOS, Linux, FreeBSD, or Windows. Add the following to your `Cargo.toml` when depending on GPUI from the Zed repository: +GPUI is still in active development as we work on the Zed code editor, and is still pre-1.0. There will often be breaking changes between versions. You'll also need to use the latest version of stable Rust. Add `gpui`, and optionally `gpui_platform`, to your `Cargo.toml`: ```toml -gpui = { git = "https://github.com/zed-industries/zed" } -gpui_platform = { git = "https://github.com/zed-industries/zed", features = ["font-kit", "wayland", "x11"] } +gpui = { version = "*" } +gpui_platform = { version = "*", features = ["font-kit", "wayland", "x11"] } ``` +Everything in a standalone GPUI app starts with an `Application`. You can create one with `gpui_platform::application()`, which picks the windowing and text backends for the host OS, and kick off your application by passing a callback to `Application::run()`. Inside this callback, you can create a new window with `App::open_window()` and register your first root view. + +```rust +use gpui::*; + +fn main() { + gpui_platform::application().run(|cx: &mut App| { + // .. + }); +} +``` + +### `gpui_platform` + +The features on `gpui_platform` are platform-specific, so the list above is a safe cross-platform default. If you build for a single platform, you can trim it: + +- **macOS** — Rendering uses Metal and is always available, but glyph rasterization needs `font-kit`. Without it, GPUI falls back to a placeholder text system that lays text out but renders no glyphs. + + ```toml + gpui_platform = { version = "*", features = ["font-kit"] } + ``` + +- **Linux / FreeBSD** — enable at least one windowing backend for desktop windows: `wayland`, `x11`, or both. These features also compile the renderer and text system, so no separate text feature is needed. + + ```toml + gpui_platform = { version = "*", features = ["wayland", "x11"] } + ``` + +- **Windows** — no features are required. Windowing uses Win32 and text uses DirectWrite. `font-kit` has no effect here. + +### Additional Topics + - [Ownership and data flow](_ownership_and_data_flow) - [Accessibility](_accessibility) -Everything in a standalone GPUI app starts with an `Application`. You can create one with `gpui_platform::application()`, which picks the windowing and text backends for the host OS, and kick off your application by passing a callback to `Application::run()`. Inside this callback, you can create a new window with `App::open_window()` and register your first root view. The features on `gpui_platform` are platform-specific, so the list above is a safe cross-platform default. If you build for a single platform, you can trim it: -- **macOS** — enable `font-kit`. Rendering uses Metal and is always available, but glyph rasterization needs `font-kit`. Without it, GPUI falls back to a placeholder text system that lays text out but renders no glyphs. Use `features = ["font-kit"]`. -- **Linux / FreeBSD** — enable at least one windowing backend for desktop windows: `wayland`, `x11`, or both. These features also compile the renderer and text system, so no separate text feature is needed. Use `features = ["wayland", "x11"]`. -- **Windows** — no features are required. Windowing uses Win32 and text uses DirectWrite, both built in, and `font-kit` has no effect here. Omit the `features` field. - ### Dependencies GPUI has various system dependencies that it needs in order to work. From 7da8af64509f784bb2f690921bb53cd5b3e08c5c Mon Sep 17 00:00:00 2001 From: GoldStrikeArch Date: Tue, 9 Jun 2026 11:13:37 +0200 Subject: [PATCH 3/3] fix: add no_run --- crates/gpui/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui/README.md b/crates/gpui/README.md index 48066e583673e2..132e5ac1e9f177 100644 --- a/crates/gpui/README.md +++ b/crates/gpui/README.md @@ -14,7 +14,7 @@ gpui_platform = { version = "*", features = ["font-kit", "wayland", "x11"] } Everything in a standalone GPUI app starts with an `Application`. You can create one with `gpui_platform::application()`, which picks the windowing and text backends for the host OS, and kick off your application by passing a callback to `Application::run()`. Inside this callback, you can create a new window with `App::open_window()` and register your first root view. -```rust +```rust,no_run use gpui::*; fn main() {