HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
pop-os
cosmic-text
Rust2022–2025
pop-os / cosmic-text

cosmic-text

Pure Rust multi-line text handling

5Distinct people
10Mentions
0Explicit recommenders
2.2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Pure Rust multi-line text handling

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year10 dated mentions

Observed mentions: 2022-10-25 18:10:55 UTC to 2025-12-22 02:14:32 UTC.

0123452022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20222023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 5 mentions; 1 submissions, 4 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC211
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC514
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC202
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC110

What Hacker News says

10 sources
rekireki·Dec 22, 2025Submission

Build Android apps using Rust and Iced

Some time ago I decided to try building an Android app using Rust. After a few weeks I got it working. There was a new iced release recently, so I've just updated the example to new iced and wgpu. I'd like to share my experience to attract more attention to Rust on Android. First things, I want to thank all the people who work on the foundational crates and tools such as: - https://github.com/rust-mobile/android-activity - https://github.com/jni-rs/jni-rs - https://github.com/gfx-rs/wgpu - https://github.com/rust-windowing/winit - and many others When I started I had to learn what tools and examples already exist. Luckily, there's a good set of examples using both NativeActivity and GameActivity: https://github.com/rust-mobile/rust-android-examples The basic approach is that we take android-activity, winit and wgpu and that's it. On top o
Read the rest
f that you can find a few egui examples in the rust-android-examples repo. Alright, so after I've got the basic examples running, I wanted to combine them with iced. Iced is a crossplatform gui library focusing on desktop and web. The mobile support is explicitly a non-goal, as far as I can tell at the moment of writing. Yet, there's an issue where some people posted their experiments. That's how I knew it was possible: https://github.com/iced-rs/iced/issues/302 There's a way to integrate iced in wgpu applications, so called integration example: https://github.com/iced-rs/iced/tree/0.14.0/examples/integra... Above I mentioned that using winit and wgpu in combination with android-activity is enough to build the app. Putting together 1 + 1 I got 2: let's use iced integration example with android-activity. It was quite easy to compile with almost no errors. First issue I encountered is that there was no text rendered. I solved this by loading fonts the way it was shown here: https://github.com/pop-os/cosmic-text/issues/243#issue-21899... Then I patched a few widgets to add touch support. And that's it. My role here was to take all the prior work and combine it together in a way that there's a working example. Some other ways of building Android apps using Rust: - xilem has an explicit goal to support mobile https://github.com/linebender/xilem - egui supports mobile https://github.com/emilk/egui - game engines such as Fyrox and Bevy support mobile: - https://github.com/FyroxEngine/Fyrox - https://github.com/bevyengine/bevy - pretty much anything built on top of winit and wgpu All of the above is related to building native apps using either NativeActivity or GameActivity. I'm leaving webview out of scope of current post. What about iOS? As far as I know it should be similar or maybe simpler compared to Android. I haven't built it yet, but the next time I have a sizeable amount of free time, I'll try to make it work. The plan is the same: pick winit, wgpu, iced integration example, mix it together until it works. It'll require the same trick to load fonts, and maybe something else, but no visible blockers as of now. Once again, thanks to all the people who made it possible and I wish you have a great time building mobile apps with Rust!
173 points · Open discussion
> Is there any easy to use/hack HTML layouting engine where I could experiment with custom CSS attributes and bridge that gap? Would anything from Servo be suitable? Servo could be used for this. You'd want to add support for parsing the CSS properties themselves to the style crate in https://github.com/servo/stylo and then the layout implementation to the layout2020 crate in https://github.com/servo/servo. You do effectively get a whole browser though. I'm currently working on building a lighter weight / hackable layout engine based on a combination of https://github.com/servo/stylo (for css parsing and selector resolution), https://github.com/DioxusLabs/taffy (for box-level layout) and https://github.com/pop-os/cosmic-text (for flow/inline layout). I expect to have something decent in around 6 months Neither of these setups currently ha
Read the rest
ve any support for pagination though.
In CSS for printing to paper
I maintain a web layout library that is designed to be integrated into other software: https://github.com/DioxusLabs/taffy It needs to be combined with a text layout engine (such as https://github.com/pop-os/cosmic-text), and it doesn't support everything yet (notable features that are currently missing: "float", "display: inline-block", "box-sizing: content-box", "position: static"). But we have Block, Flexbox and CSS Grid support with more on the way.
In I'm fed up with it, so I'm writing a browser
You might be interested in the combination of Taffy [0] which handles box-level browser layout (block, flexbox, grid, etc) and Cosmic Text [1] which handles text-level layout and basic text editing functionality. Integrating them into browsers while retaining accessibility could be tricky. But in they're general they're relatively small standalone libraries implementing most of the layout algorithms that browsers implement (although there are currently a few key missing features like laying out "inline-block" items in line with text). [0]: https://github.com/DioxusLabs/taffy [1]: https://github.com/pop-os/cosmic-text
In Conflict-Driven Synthesis for Layout Engines
Libraries for a lot of this stuff exist (albeit in many cases not very mature yet): - https://github.com/pop-os/cosmic-text does text layout (which Taffy explicitly considers out of scope) - https://github.com/AccessKit/accesskit does accessibility - https://github.com/servo/rust-cssparser does value-agnostic CSS parsing (it will parse the general syntax but leaves value parsing up to the user, meaning you can easily add support for whatever properties you what). Libraries like https://github.com/parcel-bundler/lightningcss implement parsing for the standard css properties. - There are crates like https://github.com/BurntSushi/bstr and https://docs.rs/wtf8/latest/wtf8/ for working with non-unicode text We are planning to add a C API to Taffy, but tbh I feel like C is not very good for this kind of modularised approach. You really want to
Read the rest
be able to expose complex APIs with enforced type safety and this isn't possible with C.
In We're building a browser when it's supposed to be impossible
There are a number of up-and-coming Rust-based frameworks in this niche: - https://github.com/iced-rs/iced (probably the most usable today) - https://github.com/vizia/vizia - https://github.com/marc2332/freya - https://github.com/linebender/xilem (currently very incomplete but exciting because it's from a team with a strong track record) What is also exciting to me is that the Rust GUI ecosystem is in many cases building itself up with modular libraries. So while we have umpteen competing frameworks they are to a large degree all building and collaborating on the same foundations. For example, we have: - https://github.com/rust-windowing/winit (cross-platform window creation) - https://github.com/gfx-rs/wgpu (abstraction on top of vulkan/metal/dx12) - https://github.com/linebender/vello (a canvas like imperative drawing API on top of wgpu
Read the rest
) - https://github.com/DioxusLabs/taffy (UI layout algorithms) - https://github.com/pop-os/cosmic-text (text rendering and editing) - https://github.com/AccessKit/accesskit (cross-platform accessibility APIs) In many cases there a see https://blessed.rs/crates#section-graphics-subsection-gui for a more complete list of frameworks and foundational libraries)
In XUL Layout is gone
It's two years since this was posted, and the amazing news is that we now have not just one but two projects implementing text layout in Rust that look like they might be viable: - https://github.com/pop-os/cosmic-text/ - which is still has a way to go but already complex scenarios involving asian and arabic scripts, which is impressive considering it's only a couple of months old. This one is backed by System76 for use in their new desktop environment - And https://github.com/dfrg/parley which looks abandoned but is already impressively complete and the author has signalled they intend to revisit at the start of this year. This one is being used in the Druid toolkit mentioned in the article (and it's successor Xilem) and also the text editor https://github.com/lapce/lapce which is based on that toolkit.
In Text layout is a loose hierarchy of segmentation (2020)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.