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

Modular icons #5

Merged
merged 12 commits into from
Nov 2, 2021
Merged

Modular icons #5

merged 12 commits into from
Nov 2, 2021

Conversation

daPhipz
Copy link
Member

@daPhipz daPhipz commented Oct 31, 2021

This is WIP for #4, will work on it today after my regular job ;)

I didn't commit combine.sh yet, but here's what I came up with so far in sort of pseudocode:

#!/bin/bash

# Takes SVG files and layers them above each other.
# Make sure that the canvas size is the same in all files, otherwise the positioning of the images is not correct!

# TODO Check canvas sizes

INPUT_FILES=("$@")
OUTPUT=""

# Loop through INPUT_FILES and do 'svgo --pretty --indent 0 FILE'

# Make sure all files are in the correct format
for file in "${INPUT_FILES[@]}"; do
    svgo --pretty --indent 0 "$file"
done

# Take the first file and store it in TEMP_OUT.
cat "$OUTPUT" "${INPUT_FILES[0]}"

# Loop through all other files as FILE:
# Remove the </svg> tag from TEMP_OUT.
# Remove the <svg> tag from FILE.
# Cat the file to TEMP_OUT.

Fixes #4

@Lukewh
Copy link
Contributor

Lukewh commented Oct 31, 2021

I'd be happy to merge this PR as is to keep the moving of files separate to the combine script

@Lukewh
Copy link
Contributor

Lukewh commented Oct 31, 2021

Although this breaks the current minify script as the embedded Quickemu icons are removed from the distro icons

@daPhipz
Copy link
Member Author

daPhipz commented Oct 31, 2021

I'd be happy to merge this PR as is to keep the moving of files separate to the combine script

I don't quite understand - do you mean that you want to merge this PR as is and make combine.sh a separate PR?

@daPhipz
Copy link
Member Author

daPhipz commented Oct 31, 2021

Although this breaks the current minify script as the embedded Quickemu icons are removed from the distro icons

Yeah, I think it is more sensible to do this in one go

@daPhipz
Copy link
Member Author

daPhipz commented Oct 31, 2021

There we go!
Ready to merge from my side!

# Make sure that the canvas size is the same in all files,
# otherwise the positioning of the images is not correct!

set -e
Copy link
Member Author

Choose a reason for hiding this comment

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

This ensures that the script will terminate if any of the commands executed by it fail.
May be useful for the other script as well...

@daPhipz
Copy link
Member Author

daPhipz commented Oct 31, 2021

...oops - totally forgot to actually call combine.sh in minify.sh 😂 (will rename the latter to build.sh, if you don't mind...)

@daPhipz
Copy link
Member Author

daPhipz commented Nov 1, 2021

Now it is ready!

I added some comments to build.sh, hopefully they help in understanding the changes. If you have questions - please do ask!

@daPhipz daPhipz marked this pull request as ready for review November 1, 2021 01:23
@daPhipz daPhipz changed the title WIP: Modular icons Modular icons Nov 1, 2021
Copy link
Contributor

@Lukewh Lukewh left a comment

Choose a reason for hiding this comment

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

A few little bits.

Really great work though 👍 Looking forward to landing this - I've got updated fedora and ubuntu kylin logos ready but don't want to add them until this lands :)

build.sh Outdated Show resolved Hide resolved
combine.sh Outdated Show resolved Hide resolved
combine.sh Show resolved Hide resolved
build.sh Show resolved Hide resolved
@daPhipz daPhipz mentioned this pull request Nov 1, 2021
2 tasks
@daPhipz daPhipz requested a review from Lukewh November 1, 2021 20:10
@daPhipz
Copy link
Member Author

daPhipz commented Nov 1, 2021

Should we also put the "raw" material (i.e. distro icons and quickemu icon variants) in the release zip?

@Lukewh
Copy link
Contributor

Lukewh commented Nov 1, 2021

Should we also put the "raw" material (i.e. distro icons and quickemu icon variants) in the release zip?

I think adding the raw Quickemu logo is ok, I don't think we should distribute other logos explicitly (obviously they're in the repo, but only as SVGs) personally

@daPhipz
Copy link
Member Author

daPhipz commented Nov 1, 2021

Currently, this exports the quickemu icons as they are in the SVG (155x155px on a 512x512px canvas). So, there's still room for improvement ;)

Copy link
Contributor

@Lukewh Lukewh left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@Lukewh Lukewh merged commit 826570a into quickemu-project:main Nov 2, 2021
@daPhipz daPhipz deleted the modular-icons branch November 2, 2021 15:07
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.

Idea: Modularize icon generation to allow for more combinations
2 participants