amPerl / egui-phosphor

Phosphor icons for egui
Apache License 2.0
98 stars 25 forks source link

Update to Phosphor Icons V2.1.0 and a Script for Auto Updates #18

Closed connorslade closed 2 months ago

connorslade commented 2 months ago

First off, thank you for making this crate, it has made getting a large number of icons in egui much easier. But while working on a project, I found an icon I wanted to use on the Phosphor Icons website but it was not available through this crate. Turns out that in the year since the icons were added to this crate, many hundreds of new icons have been added to the Phosphor Icons project.

In this pr, I add an update script that downloads the latest version of Phosphor Icons from the official website, extracts the TTF files into the res directory, and generates the rust code for each variant file. Using the script I also update this crate to the latest Phosphor Icons version, v2.1.0.

amPerl commented 2 months ago

Thanks! I've been meaning to do something like this, so the contribution is very much appreciated. I'll include this in the release for egui 0.28.

bircni commented 2 months ago

What about writing this script in rust and integrating it while building?

connorslade commented 2 months ago

Hm, that's an interesting idea. Maybe just the default font files and the selection.json could be packaged with the crate then with a feature flag / env vars you could have it download the latest / some specific version of Phosphor icons. Then you could use new versions of the icons even if you are using an older version of egui or something. What do you think @amPerl? I'd be interested in implementing this if you think it would be a good direction for this project.

amPerl commented 2 months ago

image will prototype this approach (from egui discord)

amPerl commented 2 months ago

Also I know I pasted in a discord screenshot just now but I do think github issues is the better place to discuss this, it just happened to start there when I posted about the new version

bircni commented 2 months ago

You can do this using tera files if you want i can give it a try