Open-source project
pop-os/cosmic-text avatar
pop-os/cosmic-text

cosmic-text: shaping, layout and rendering in Rust

Pure Rust multi-line text handling

2,196 stars239 forksRustApache-2.0

At a glance

What is it?
pop-os/cosmic-text is a Rust text crate published under the pop-os organisation. It combines HarfRust shaping, swash rendering and its own bidirectional layout, and its roadmap still lists no-wrap, ellipsize and copy/paste as undone.
Who is it for?
Pick cosmic-text if you are building a Rust UI or editor on Linux, macOS or Windows and need bidirectional text, font fallback and color emoji without binding to C libraries. Version 0.19.0 exposes `Wrap::None` and ellipsizing APIs despite the unchecked README roadmap boxes.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 30 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • pop-os/cosmic-text2,196 ★ · +31
Star history
Repository2026-10-092026-11-25
pop-os/cosmic-text2.2k2.2k

31 Stars in the last 47 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Three engines behind one buffer abstraction

cosmic-text bundles shaping, layout and rendering behind one interface, with each stage coming from a different place. Shaping is done by HarfRust, which the README says supports a wide variety of advanced shaping operations. Rendering is done by swash, which supports ligatures and color emoji. Layout is the project's own code, written in safe Rust, with support for bidirectional text.

Font fallback is custom as well. It reuses some of the static fallback lists found in browsers such as Chromium and Firefox, and the roadmap adds that it can choose a font by locale to work around Han unification, at both per-line and per-character granularity.

The description is Pure Rust multi-line text handling, and the Cargo manifest backs that up with dependencies such as `fontdb`, `harfrust`, `skrifa` and `unicode-bidi`. The screenshots in the README lead with Arabic, Hindi and Simplified Chinese, which shows where the project aims its testing.

Full feature set on three desktops, fallback is your job elsewhere

Linux, macOS and Windows are supported with the full feature set. The README then adds a sentence that matters for porting: other platforms may need to implement font fallback capabilities. Fallback depends on knowing which fonts exist on the system, and that discovery is where a new platform needs your code.

The default feature set in `Cargo.toml` is `std`, `swash` and `fontconfig`. The `fontconfig` feature pulls in `fontdb/fontconfig`, which ties the Linux build to system font configuration. Other features are `monospace_fallback`, `peniko`, `shape-run-cache` and `no_std`.

The repository root includes `redoxer.sh`, a script name that points at testing on Redox OS, though the README does not discuss that platform. The crate declares `rust-version = "1.89"` and `edition = "2021"`, so a toolchain older than 1.89 will not build version 0.19.0.

Bidirectional editing is proved against 500 translations of one document

The README backs its editing claims with a stress test. It takes the Universal Declaration of Human Rights in almost 500 languages, concatenates the translations into one file of 8 megabytes, and feeds the file to the `editor-test` example one character at a time. Backspace and delete are exercised per character and per line, and the final buffer is compared to the original file. All 106746 lines are correct.

That is a strong check for round-tripping, since it covers right-to-left scripts, combining characters and mixed directions in a single buffer. The screenshots in the repository show Arabic, Hindi and Simplified Chinese renderings of the same document.

The test says nothing about rendering speed or memory. It shows that editing operations leave the text intact, and the roadmap lists text selection, bidirectional selection and performance improvements as done. The `editor-test.sh` script at the repository root is the entry point for running it.

Wrapping and ellipsizing: check the versioned API

The README roadmap leaves no wrapping, ellipsize and wrapping with indentation unchecked. The versioned 0.19.0 API and source nevertheless expose `Wrap::None` and `Ellipsize` variants, with documented height-limit behavior, so an unchecked roadmap item should not be treated as proof that the API is absent.

Test the exact layout and edge cases your application needs against the version you install. In particular, the documented ellipsize height limit behaves as a single line when `Wrap::None` is selected. The roadmap still helps identify work the maintainers consider unfinished, but the versioned API and tests are the better starting point for what exists today.

The crate is published before 1.0, so review release notes and test your layout when changing minor versions.

Copy and paste is unchecked in the editing section

Under text editing, the roadmap marks performance improvements, text selection and bidirectional selection as done. Copy/paste remains open. Text editing in this crate means the buffer and cursor logic, not the integration with a platform clipboard.

An application therefore reads the selection from the editor and talks to the system clipboard itself. The five example programs show what a host looks like: `editor`, `editor-test`, `multiview`, `rich-text` and `terminal`, each with a shell script of its own at the root.

The manifest marks `syntect`, `cosmic_undo_2`, `modit` and `sys-locale` as optional dependencies. The README does not explain what each one enables, so read the feature list in `Cargo.toml` and the docs.rs page before turning them on. None of them is in the default feature set.

no_std covers shaping and layout, not font loading or rendering

Setting `default-features = false` enables no_std use. The roadmap spells out what that gives you: no_std shaping and no_std layout are done, while no_std font loading and no_std rendering are not.

The `no_std` feature in `Cargo.toml` switches on `hashbrown`, `libm`, `core_maths` and the `libm` options of `skrifa`, `swash` and `harfrust`. In practice an embedded or kernel-side target can shape and lay out text from fonts you load yourself, then must find another way to put the glyphs on screen.

If you need no_std end to end, plan your own font loader and glyph renderer, since both of those roadmap boxes are open. The `swash` dependency is declared with the `render` and `scale` features and is marked optional.

License choice and release cadence

The README offers two licenses, Apache-2.0 or MIT, at your option, and `Cargo.toml` states `MIT OR Apache-2.0`. GitHub reports Apache-2.0 alone, so the dual license in the README and manifest is the one to trust. Contributions are dual licensed the same way unless stated otherwise.

The release list shows 0.19.0 on 2026-04-22, then 0.18.2 and 0.18.1 on 2026-02-20, a few hours apart. The last push to the repository was on 2026-09-30, and the project is not archived. Documentation lives on docs.rs and at the project's GitHub Pages site.

The maintainer listed in the manifest is Jeremy Soller of System76. A `deny.toml` file indicates dependency checks with cargo-deny, and a `benches/` directory holds benchmarks, though the README quotes no benchmark numbers.

Editorial conclusion

Pick cosmic-text if you are building a Rust UI or editor on Linux, macOS or Windows and need bidirectional text, font fallback and color emoji without binding to C libraries. Version 0.19.0 exposes `Wrap::None` and ellipsizing APIs despite the unchecked README roadmap boxes. Test their behavior on your target platform, especially if you need custom font fallback. Check the open roadmap items against your widget list before adopting.

Frequently asked questions

What does cosmic-text use for shaping and rendering?

Shaping is provided by HarfRust and rendering by swash, which supports ligatures and color emoji. Layout and font fallback are the project's own implementations.

Which platforms does cosmic-text fully support?

Linux, macOS and Windows get the full feature set. Other platforms may need to implement font fallback capabilities themselves.

Does cosmic-text work without the standard library?

Partly. With default-features = false, no_std shaping and layout are supported, while no_std font loading and rendering are not yet done.

Official sources

  1. License: Apache-2.0
  2. pop-os/cosmic-text on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/pop-os-cosmic-text.svg)](https://hysenlabs.com/projects/pop-os-cosmic-text)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/pop-os-cosmic-text.svg)](https://hysenlabs.com/projects/pop-os-cosmic-text)

Was this useful?