Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate build status-dependent icons for the editor #98622

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tehKaiN
Copy link

@tehKaiN tehKaiN commented Oct 28, 2024

Closes godotengine/godot-proposals#541

Also auto-generates the icons for console executables under Windows. They are not pixel-exact to the previous ones, since they're composited dynamically, but they should be close enough.

Sample preview using some kind of web-based .ico previewer - might be a bit distorted.

main_full
main_full

Caveats:

  • Icon components are rendered to PNG first, then composited, because doing everything in SVG and then converting to PNG yielded bad results - some lines were thinner than others, also getting color-mixed with the neighbors.
  • I'm mainly a programmer, so SVGs present in the PR are not perfect - though I assume they are good enough placeholders. I've concocted them in GodSVG in conjunction with some kind of web-based SVG text path generator.
  • No linux icons because I couldn't get any response on how to tackle it in the proposal issue. :(

Also it made a bit of make_icons.sh obsolete, so perhaps it could supersede it further? I don't know how it's called though - make_icons.py is intended to generate files which are to be commited, whereas it looks like make_icons.sh is used for packaging?

@tehKaiN tehKaiN requested review from a team as code owners October 28, 2024 19:20
@bruvzg
Copy link
Member

bruvzg commented Oct 28, 2024

No linux icons because I couldn't get any response on how to tackle it in the proposal issue. :(

The script for generating PNGs is pretty much all that can be done, Linux icon is not part of the executable or official distribution, so it's up to distro specific package maintainers how to use it.

like make_icons.sh is used for packaging?

Not sure if it's used for anything (definitely not used in the official build pipeline).

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

There's also embedded PNG icon which is used for window title / taskbar / task switcher:

godot/main/SCsub

Lines 35 to 40 in a308047

env_main.Depends("#main/app_icon.gen.h", "#main/app_icon.png")
env_main.CommandNoCache(
"#main/app_icon.gen.h",
"#main/app_icon.png",
env.Run(main_builders.make_app_icon),
)

@tehKaiN tehKaiN force-pushed the build-status-icons branch from f226712 to ccdc6fc Compare October 28, 2024 19:45
@AThousandShips AThousandShips added this to the 4.x milestone Oct 28, 2024
@tehKaiN tehKaiN force-pushed the build-status-icons branch from ccdc6fc to ba532a1 Compare October 28, 2024 19:58
@tehKaiN
Copy link
Author

tehKaiN commented Oct 28, 2024

The script for generating PNGs is pretty much all that can be done, Linux icon is not part of the executable or official distribution, so it's up to distro specific package maintainers how to use it.

That should be easily doable, but I need to know what kind of PNG sizes are needed.

@bruvzg
Copy link
Member

bruvzg commented Oct 28, 2024

That should be easily doable, but I need to know what kind of PNG sizes are needed.

No sure if there's a standard set of sizes. The following seems to be used 16x16, 22x22, 24x24, 32x32, 48x48, 64x64, 96x96, 128x128, 192x192, 256x256, but not every icon is using all of them. Some apps also use single SVG instead.

@tehKaiN tehKaiN force-pushed the build-status-icons branch from ba532a1 to 5844b2d Compare October 29, 2024 18:39
@tehKaiN tehKaiN requested review from a team as code owners October 29, 2024 18:39
@tehKaiN tehKaiN force-pushed the build-status-icons branch from 5844b2d to 9760f58 Compare October 29, 2024 18:41
@tehKaiN
Copy link
Author

tehKaiN commented Oct 29, 2024

I've added a bunch of linuxbsd icons. Also generates the SVG variant. The problem is, generated icons don't pass through svgo, but since the pre-commit hook generates the optimized variant, and the script doesn't need to run that often, perhaps that's acceptable? If not then there's a problem - I see no better SVG libary than cairo and I'm not quite sure if text-based svg editing won't trigger the svgo anyway.

@tehKaiN
Copy link
Author

tehKaiN commented Nov 29, 2024

What's the status of this PR? I know it's probably of very low priority, but perhaps there are some concerns that I could investigate in the meantime.

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

macOS and Windows icons look good to me.

Copy link
Contributor

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

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

The Android section looks good.

@syntaxerror247
Copy link
Member

@tehKaiN Can you provide Android icon_monochrome for different sizes too?
This is the svg file, you can resize it: https://godotengine.org/assets/press/icon_monochrome_dark.svg

@tehKaiN tehKaiN force-pushed the build-status-icons branch from 8502d5c to de2a4a5 Compare December 2, 2024 20:51
@tehKaiN
Copy link
Author

tehKaiN commented Dec 2, 2024

I didn't know that they are required/nice to have since the original icon set didn't had those. Fixed!
Regarding using SVG, if the quality of current icons isn't good enough then I'll investigate going the SVG route, but that needs extra work to make the dev/beta/rc label svgs monochrome too.

@syntaxerror247
Copy link
Member

syntaxerror247 commented Dec 2, 2024

Regarding using SVG, if the quality of current icons isn't good enough then I'll investigate going the SVG route, but that needs extra work to make the dev/beta/rc label svgs monochrome too.

I had suggested using the SVG as a base image, resizing it to your desired dimensions, and then exporting it as a PNG file. Then you can put dev/beta/RC label on png file.
Anyway, current changes looks good.

@tehKaiN
Copy link
Author

tehKaiN commented Dec 29, 2024

A friendly reminder that another month passed by. I know it's super low priority issue, but I wonder - is there some kind of review queue where I could check how things progress? Or should I just wait for the reviews, or perhaps keep pinging here and there from time to time?

@tehKaiN tehKaiN force-pushed the build-status-icons branch 2 times, most recently from 54412fe to 565d2cc Compare March 3, 2025 19:47
@tehKaiN
Copy link
Author

tehKaiN commented Mar 3, 2025

Updated the PR for post-4.4 changes.
One thing I see is that 4.4 added android icon_monochrome.png for all the DPI variants. I've removed them since they are already generated in my PR.

One thing that's curious for me is that 4.4 changed the icon_foreground and icon_monochrome proportions in mdpi: previously, and in my PR, it was 66px square icon in 108px transparent square background as per Android guidelines, but now the icon is something around 48px square. It would be nice to have a second opinion on how it should really be.

@syntaxerror247
Copy link
Member

syntaxerror247 commented Mar 3, 2025

One thing that's curious for me is that 4.4 changed the icon_foreground and icon_monochrome proportions in mdpi:

@tehKaiN icon_foreground haven't been updated for last 6 years.

@tehKaiN
Copy link
Author

tehKaiN commented Mar 4, 2025

Sorry, it was late yesterday. Anyway, there is discrepancy between proportions of those icons between current version and my version, and I'm not sure whether I should strictly follow what's in the repo currently, or keep it as I've changed it since android docs seem to confirm that latter is better. I'm not an android developer though, so I might got that wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use different app icons for alpha/beta/rc builds (and possibly Mono builds)
5 participants