Icon font (experimental) - #2304
Open
cfsmp3 wants to merge 3 commits into
Open
Conversation
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.
bim9262
reviewed
Aug 11, 2026
Collaborator
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?