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

Add Makefile and rasterized formats #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,21 @@ For reference on how to use any of our assets please visit [manual.codebar.io/br

If you have any questions about the fair usage of these assets please email hello@codebar.io.

### Re-creating the logos

If you changed a logo or added another one in SVG format, you can automatically create rasterized versions using the [Makefile](logo/Makefile).

To create the images, make, imagemagick and inkscape need to be installed. On Mac, make should come with [XCode](https://developer.apple.com/xcode/), imagemagick can be installed using brew (`brew install imagemagick`) and inkscape is available as a package from https://inkscape.org/

On Linux, all three applications should be available in your package-manager, where `make` comes with `build-essentials` on Ubuntu & `base-devel` on Arch

If all these applications are installed, running

```
make all
```

in `logo/` should recreate rasterized versions for all SVGs that have changed. If you added a new logo, a new PHONY recipe needs to be created like for [`codebar-logo`](logo/Makefile#L30-L31) and that recipe needs to be added to the [`all` recipe](logo/Makefile#L24).


##### All content in this repo is Copyright © 2019 codebar Ltd, 10791813. All rights reserved.
58 changes: 58 additions & 0 deletions logo/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This Makefile creates the logo in different formats based on the svg version
# in svg/codebar-logo.svg. A Makefile specifies how a specific file should
# be created.
#
# To create the images, make and inkscape need to be installed.
# On Mac, make should come with XCode (https://developer.apple.com/xcode/),
# and inkscape is available as a package from https://inkscape.org/
#
# On Linux, all three applications should be available in your package-manager
# where `make` comes with `build-essentials` on Ubuntu & `base-devel` on Arch
#
# If you want to update all rasterized versions, issuing `make all` should
# re-create all files. If Make reports `make: Nothing to be done for 'all'.`,
# that means the source file (the svg) hasn't changed and thus Make does not
# need to recreate the rasterized versions.
#
# If you want to force re-creation, issue `make clean`, which will delete all
# rasterized versions and then will force `make all` to re-create them.

# Create all derived formats using the recipes below
all: codebar-logo codebar-logo-banner

## the next tasks are marked as .PHONY because they don't create a specific file
## (https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html)

# This recipe will create all derived formats for codebar-logo
.PHONY: codebar-logo
codebar-logo: eps/codebar-logo.eps png/codebar-logo-72dpi.png png/codebar-logo-300dpi.png

# This recipe will create all derived formats for codebar-logo-banner
.PHONY: codebar-logo-banner
codebar-logo-banner: eps/codebar-logo-banner.eps png/codebar-logo-banner-72dpi.png png/codebar-logo-banner-300dpi.png

# clean will delete all derived files. Usually you won't need this.
.PHONY: clean
clean:
rm eps/*.eps
rm png/*.png

# Create an EPS format in eps/ of a file that exists in svg/
# If you invoke `make eps/codebar-logo.eps` Make will look for
# a file called svg/codebar-logo.svg (or another recipe that creates said file)
# it will then substitute $@ with the target filename (eps/codebar-logo.eps)
# and $< with the source filename (svg/codebar-logo.svg).
#
# This recipe thus reads as: In order to create a file matching eps/%.eps,
# I need a corresponding file in svg/ to exist and will call this command to
# create the eps file.
eps/%.eps: svg/%.svg
inkscape -z -E $@ $<

# Creates a 300dpi rasterized version of an svg in png format
png/%-300dpi.png: svg/%.svg
inkscape -z -e $@ -d 300 $<

png/%-72dpi.png: svg/%.svg
inkscape -z -e $@ -d 72 $<

198 changes: 198 additions & 0 deletions logo/eps/codebar-logo-banner.eps

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading