Better documentation for script 'generate_tool_cursor.sh'.
--HG-- branch : develop
This commit is contained in:
parent
0d34320e7d
commit
deb574cc5f
|
@ -1,18 +1,29 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# The script creates SVG templates for all cursors.
|
||||||
|
# Before run create PNG icon of tool!
|
||||||
|
# Use SVG templates for creating PNG cursors.
|
||||||
|
|
||||||
|
# IMPORTANT!!! Run script inside 'scripts' directory.
|
||||||
|
|
||||||
# usage:
|
# usage:
|
||||||
# $ ./generate_tool_cursor.sh
|
# $ ./generate_tool_cursor.sh
|
||||||
|
|
||||||
|
# Notes.
|
||||||
|
# No, template_cursor.svg is not broken! It is just template, no point open it.
|
||||||
|
# After creating SVG templates open them by Inkscape, previewer doesn't show pictures inside svg file linked by url.
|
||||||
|
# I have spent hour before understand why i don't see PNG inside SVG in Nautilus.
|
||||||
|
|
||||||
PATTERN=*@2x.png
|
PATTERN=*@2x.png
|
||||||
TOOLICONPATH=../src/app/valentina/share/resources/toolicon/32x32/
|
TOOLICONPATH=../src/app/valentina/share/resources/toolicon/32x32/ # PNG tool icon should be here
|
||||||
TOOLICONS=`ls $TOOLICONPATH$PATTERN`
|
TOOLICONS=`ls $TOOLICONPATH$PATTERN`
|
||||||
OUTPATH=../src/app/valentina/share/resources/cursor/svg
|
OUTPATH=../src/app/valentina/share/resources/cursor/svg # Seek SVG templates here
|
||||||
|
|
||||||
|
|
||||||
for var in $TOOLICONS
|
for var in $TOOLICONS
|
||||||
do
|
do
|
||||||
basename=${var##*/}
|
basename=${var##*/} # remove the path from a path-string
|
||||||
basename=${basename%.png}
|
basename=${basename%.png} # remove the extension from a path-string
|
||||||
basename=${basename%@2x} # remove optional @2x suffix
|
basename=${basename%@2x} # remove optional @2x suffix
|
||||||
if [ ! -f $basename@2x.png ]; then # always prefere hidpi version
|
if [ ! -f $basename@2x.png ]; then # always prefere hidpi version
|
||||||
sed "s/<<basename>>/$basename@2x/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg
|
sed "s/<<basename>>/$basename@2x/" $OUTPATH/template_cursor.svg > $OUTPATH/${basename}_cursor.svg
|
||||||
|
|
1
src/app/valentina/share/resources/cursor/svg/README.txt
Normal file
1
src/app/valentina/share/resources/cursor/svg/README.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Use script 'generate_tool_cursor.sh' in directory 'scripts' to generate all svg templates for cursors.
|
Loading…
Reference in New Issue
Block a user