Skip to content

Icon font (experimental) - #2304

Open
cfsmp3 wants to merge 3 commits into
greshake:masterfrom
cfsmp3:icon-font
Open

Icon font (experimental)#2304
cfsmp3 wants to merge 3 commits into
greshake:masterfrom
cfsmp3:icon-font

Conversation

@cfsmp3

@cfsmp3 cfsmp3 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

A LLM generated font that contains all the icons we use, in SVG format, plus the tooling to build the actual font.

Font is usable but ugly - still, we might want to ship it, maybe a decent designer can replace worst icons?

cfsmp3 added 2 commits August 7, 2026 22:36
Adds `cargo xtask build-font`, which turns the SVG sources in
fonts/i3status-icons/svg into a TTF and the matching icon set.

The pipeline is pure Rust: usvg parses each source, the tiny-skia
stroker converts strokes to filled outlines, kurbo converts cubics to
the quadratics the glyf table requires, and write-fonts assembles the
tables. Nothing here is invoked by cargo build, install.sh or CI --
both outputs are checked in, so this only runs when the icons change.

The canonical icon names come from Icons::default() rather than being
parsed out of icons.rs, so an icon with no source, or a source with no
icon, fails the build instead of producing a set that silently
disagrees with the code.

The four new dependencies are on the xtask package only and are never
compiled into i3status-rs.
Adds an icon set drawn for this project, covering every icon name
including all progressions, plus the font that provides it.

The font deliberately does not live under files/. Runtime files there
are installed to /usr/share/i3status-rust, which fontconfig does not
scan, so a font placed alongside the themes would never be found by
either packagers or install.sh. It goes in fonts/ instead, and
manual_install.md tells distributions to install it under
/usr/share/fonts.

The icons sit in the Private Use Area, U+E900..U+E962, assigned in
sorted filename order. Those codepoints are baked into the icon set and
can be referenced directly in icons_overrides, so they are a
compatibility contract; fonts/i3status-icons/README.md explains what
that means for anyone adding a glyph.

Two tests guard the generated set: that its names still match
Icons::default(), and that every codepoint is inside the font's range
and unique.
Comment thread src/icons.rs Outdated
Comment thread fonts/i3status-icons/i3status-icons.ttf Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best not to commit this and generate as needed. Like the manpage-upload github workflow this could be generated as part of the release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best not to commit this and generate as needed. Like the manpage-upload github workflow this could be generated as part of the release.

Yes, good idea. Changed.

Follows the manpage: the TTF is no longer checked in, install.sh builds
it, and a release workflow attaches it to each published release.
Packaging notes updated to say the font is built rather than shipped.

The icon set TOML stays checked in. It is a runtime data file like the
other sets in files/icons, install.sh copies it with the rest of files/,
and the tests read it -- so regenerating it on a clean checkout would be
needed just to run cargo test.

Also moves the test-only HashSet import into the tests module.
@cfsmp3
cfsmp3 requested a review from bim9262 August 14, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants