tweaked src

This commit is contained in:
Sam Hewitt 2016-04-21 10:24:05 -04:00
parent 5130448e11
commit dfce4d49dc
7 changed files with 172 additions and 136 deletions

View File

@ -1,15 +1,49 @@
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<svg height="16" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" version="1.1" width="16" xmlns="http://www.w3.org/2000/svg" enable-background="new">
<metadata id="metadata90"/>
<defs id="defs7386">
<linearGradient id="linearGradient5606" osb:paint="solid">
<stop id="stop5608"/>
</linearGradient>
<filter inkscape:collect="always" color-interpolation-filters="sRGB" id="filter7554">
<feBlend inkscape:collect="always" id="feBlend7556" in2="BackgroundImage" mode="darken"/>
</filter>
</defs>
<g inkscape:groupmode="layer" id="layer12" inkscape:label="actions" transform="translate(-441.0002,-9.0000001)">
<path inkscape:connector-curvature="0" d="m 449.00006,9.99998 c -3.86295,0 -7,3.13704 -7,7 0,3.86295 3.13705,7 7,7 3.86295,0 7,-3.13705 7,-7 0,-3.86296 -3.13705,-7 -7,-7 z m 0,2 c 1.01943,0 1.95898,0.28763 2.75,0.8125 l -6.9375,6.9375 c -0.52487,-0.79102 -0.8125,-1.73057 -0.8125,-2.75 0,-2.75926 2.24075,-5 5,-5 z m 4.1875,2.25 c 0.52487,0.79102 0.8125,1.73057 0.8125,2.75 0,2.75925 -2.24075,5 -5,5 -1.01943,0 -1.95898,-0.28763 -2.75,-0.8125 l 6.9375,-6.9375 z" id="path4992" color="#000000" stroke-width="2" fill="#555555"/>
</g>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:cc='http://creativecommons.org/ns#' xmlns:dc='http://purl.org/dc/elements/1.1/' sodipodi:docname='action-unavailable-symbolic.svg' inkscape:export-filename='/home/sam/source-symbolic.png' inkscape:export-xdpi='270' inkscape:export-ydpi='270' height='16' id='svg7384' xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape' xmlns:osb='http://www.openswatchbook.org/uri/2009/osb' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd' style='enable-background:new' xmlns:svg='http://www.w3.org/2000/svg' version='1.1' inkscape:version='0.91 r13725' width='16' xmlns='http://www.w3.org/2000/svg'>
<sodipodi:namedview inkscape:bbox-nodes='true' inkscape:bbox-paths='false' bordercolor='#666666' borderlayer='false' borderopacity='1' inkscape:current-layer='layer12' inkscape:cx='-343.61562' inkscape:cy='-267.45438' gridtolerance='10' inkscape:guide-bbox='true' guidetolerance='10' id='namedview88' inkscape:object-nodes='true' inkscape:object-paths='true' objecttolerance='10' pagecolor='#f7f7f7' inkscape:pageopacity='1' inkscape:pageshadow='2' showborder='true' showgrid='false' showguides='false' inkscape:showpageshadow='false' inkscape:snap-bbox='true' inkscape:snap-bbox-edge-midpoints='false' inkscape:snap-bbox-midpoints='true' inkscape:snap-center='false' inkscape:snap-global='true' inkscape:snap-grids='true' inkscape:snap-intersection-paths='false' inkscape:snap-midpoints='true' inkscape:snap-nodes='true' inkscape:snap-object-midpoints='true' inkscape:snap-others='true' inkscape:snap-page='false' inkscape:snap-smooth-nodes='false' inkscape:snap-to-guides='true' inkscape:window-height='1018' inkscape:window-maximized='1' inkscape:window-width='1920' inkscape:window-x='0' inkscape:window-y='32' inkscape:zoom='2.8284271'>
<inkscape:grid color='#000000' dotted='false' empcolor='#0800ff' empopacity='0.4627451' empspacing='4' enabled='true' id='grid4866' opacity='0.16470588' originx='-584.0002' originy='-272.00336' snapvisiblegridlinesonly='true' spacingx='0.25px' spacingy='0.25px' type='xygrid' visible='true'/>
</sodipodi:namedview>
<metadata id='metadata90'>
<rdf:RDF>
<cc:Work rdf:about=''>
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource='http://purl.org/dc/dcmitype/StillImage'/>
<dc:title>Paper Symbolic Icon Theme</dc:title>
<cc:license rdf:resource='http://creativecommons.org/licenses/by-sa/3.0/'/>
</cc:Work>
<cc:License rdf:about='http://creativecommons.org/licenses/by-sa/3.0/'>
<cc:permits rdf:resource='http://creativecommons.org/ns#Reproduction'/>
<cc:permits rdf:resource='http://creativecommons.org/ns#Distribution'/>
<cc:requires rdf:resource='http://creativecommons.org/ns#Notice'/>
<cc:requires rdf:resource='http://creativecommons.org/ns#Attribution'/>
<cc:permits rdf:resource='http://creativecommons.org/ns#DerivativeWorks'/>
<cc:requires rdf:resource='http://creativecommons.org/ns#ShareAlike'/>
</cc:License>
</rdf:RDF>
</metadata>
<title id='title8473'>Paper Symbolic Icon Theme</title>
<defs id='defs7386'>
<linearGradient id='linearGradient6882' osb:paint='solid'>
<stop id='stop6884' offset='0' style='stop-color:#555555;stop-opacity:1;'/>
</linearGradient>
<linearGradient id='linearGradient5606' osb:paint='solid'>
<stop id='stop5608' offset='0' style='stop-color:#000000;stop-opacity:1;'/>
</linearGradient>
<filter inkscape:collect='always' id='filter7554' style='color-interpolation-filters:sRGB'>
<feBlend inkscape:collect='always' id='feBlend7556' in2='BackgroundImage' mode='darken'/>
</filter>
</defs>
<g inkscape:groupmode='layer' id='layer9' inkscape:label='status' style='display:inline' transform='translate(-825.0004,55.003361)'/>
<g inkscape:groupmode='layer' id='layer10' inkscape:label='devices' style='display:inline;filter:url(#filter7554)' transform='translate(-825.0004,55.003361)'/>
<g inkscape:groupmode='layer' id='layer1' inkscape:label='places' style='display:inline' transform='translate(-584.0002,-561.99664)'/>
<g inkscape:groupmode='layer' id='layer14' inkscape:label='mimetypes' style='display:inline' transform='translate(-825.0004,55.003361)'/>
<g inkscape:groupmode='layer' id='layer15' inkscape:label='emblems' style='display:inline' transform='translate(-825.0004,55.003361)'/>
<g inkscape:groupmode='layer' id='g71291' inkscape:label='emotes' style='display:inline' transform='translate(-825.0004,55.003361)'/>
<g inkscape:groupmode='layer' id='layer2' inkscape:label='categories' style='display:inline' transform='translate(-584.0002,-411.99664)'/>
<g inkscape:groupmode='layer' id='layer12' inkscape:label='actions' style='display:inline' transform='translate(-825.0004,55.003361)'>
<path inkscape:connector-curvature='0' d='m 833.00026,-54.00338 c -3.86295,0 -7,3.13704 -7,7 0,3.86295 3.13705,7 7,7 3.86295,0 7,-3.13705 7,-7 0,-3.86296 -3.13705,-7 -7,-7 z m 0,2 c 1.01943,0 1.95898,0.28763 2.75,0.8125 l -6.9375,6.9375 c -0.52487,-0.79102 -0.8125,-1.73057 -0.8125,-2.75 0,-2.75926 2.24075,-5 5,-5 z m 4.1875,2.25 c 0.52487,0.79102 0.8125,1.73057 0.8125,2.75 0,2.75925 -2.24075,5 -5,5 -1.01943,0 -1.95898,-0.28763 -2.75,-0.8125 l 6.9375,-6.9375 z' id='path4992' style='color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;font-family:Sans;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#555555;fill-opacity:1;stroke:none;stroke-width:2;marker:none;enable-background:accumulate'/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -22,6 +22,7 @@ require "fileutils"
include REXML
INKSCAPE = '/usr/bin/inkscape'
#INKSCAPE = '/usr/bin/inkscape' # like this works for me, while using `which` inkscape hangs
# Render 24x24 pixel panel icons
SRC24 = "panel/source-panel-24.svg"
@ -33,12 +34,12 @@ def chopSVG(icon)
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC24,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f -z #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd = "#{INKSCAPE} -f #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileClose > /dev/null 2>&1"
cmd += "--verb=FileSave --verb=FileQuit > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f -z #{icon[:file]} --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#cmd = "#{INKSCAPE} -f #{icon[:file]} -z --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#system(cmd)
svgcrop = Document.new(File.new(icon[:file], 'r'))
svgcrop.root.each_element("//rect") do |rect|
@ -111,12 +112,12 @@ def chopSVG(icon)
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC22,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f -z #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd = "#{INKSCAPE} -f #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileClose > /dev/null 2>&1"
cmd += "--verb=FileSave --verb=FileQuit > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f -z #{icon[:file]} --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#cmd = "#{INKSCAPE} -f #{icon[:file]} -z --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#system(cmd)
svgcrop = Document.new(File.new(icon[:file], 'r'))
svgcrop.root.each_element("//rect") do |rect|
@ -188,12 +189,12 @@ def chopSVG(icon)
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC16,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f -z #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd = "#{INKSCAPE} -f #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileClose > /dev/null 2>&1"
cmd += "--verb=FileSave --verb=FileQuit > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f -z #{icon[:file]} --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#cmd = "#{INKSCAPE} -f #{icon[:file]} -z --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#system(cmd)
svgcrop = Document.new(File.new(icon[:file], 'r'))
svgcrop.root.each_element("//rect") do |rect|

View File

@ -33,7 +33,7 @@ def chopSVG(icon)
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f -z #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileClose > /dev/null 2>&1"
cmd += "--verb=FileSave --verb=FileQuit > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f #{icon[:file]} -z --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"

View File

@ -31,7 +31,7 @@ def chopSVG(icon)
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f -z #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd = "#{INKSCAPE} -f #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileQuit > /dev/null 2>&1"
system(cmd)

View File

@ -26,38 +26,38 @@ SRC16 = "vector/source-16x16.svg"
PREFIX16 = "../Paper/16x16"
def chopSVG(icon)
FileUtils.mkdir_p(icon[:dir]) unless File.exists?(icon[:dir])
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC16,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileQuit > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f -z #{icon[:file]} --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#system(cmd)
svgcrop = Document.new(File.new(icon[:file], 'r'))
svgcrop.root.each_element("//rect") do |rect|
w = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #get rid of 16 vs 15.99999
h = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #Inkscape bugs
if w == 16 && h == 16
rect.remove
end
end
FileUtils.mkdir_p(icon[:dir]) unless File.exists?(icon[:dir])
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC16,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileQuit > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f #{icon[:file]} --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#system(cmd)
svgcrop = Document.new(File.new(icon[:file], 'r'))
svgcrop.root.each_element("//rect") do |rect|
w = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #get rid of 16 vs 15.99999
h = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #Inkscape bugs
if w == 16 && h == 16
rect.remove
end
end
icon_f = File.new(icon[:file],'w+')
icon_f.puts svgcrop
icon_f.close
else
puts " -- #{icon[:name]} already exists"
end
else
puts " -- #{icon[:name]} already exists"
end
end #end of function
def get_output_filename(d,n)
if (/rtl$/.match(n))
outfile = "#{d}/#{n.chomp('-rtl')}-rtl.svg"
else
outfile = "#{d}/#{n}.svg"
if (/rtl$/.match(n))
outfile = "#{d}/#{n.chomp('-rtl')}-rtl.svg"
else
outfile = "#{d}/#{n}.svg"
end
return outfile
end
@ -68,32 +68,32 @@ svg = Document.new(File.new(SRC16, 'r'))
if (ARGV[0].nil?) #render all SVGs
puts "Rendering from icons in #{SRC16}"
# Go through every layer.
svg.root.each_element("/svg/g[@inkscape:groupmode='layer']") do |context|
context_name = context.attributes.get_attribute("inkscape:label").value
puts "Going through layer '" + context_name + "'"
context.each_element("g") do |icon|
#puts "DEBUG #{icon.attributes.get_attribute('id')}"
dir = "#{PREFIX16}/#{context_name}"
icon_name = icon.attributes.get_attribute("inkscape:label").value
chopSVG({ :name => icon_name,
:id => icon.attributes.get_attribute("id"),
:dir => dir,
:file => get_output_filename(dir, icon_name)})
end
end
# Go through every layer.
svg.root.each_element("/svg/g[@inkscape:groupmode='layer']") do |context|
context_name = context.attributes.get_attribute("inkscape:label").value
puts "Going through layer '" + context_name + "'"
context.each_element("g") do |icon|
#puts "DEBUG #{icon.attributes.get_attribute('id')}"
dir = "#{PREFIX16}/#{context_name}"
icon_name = icon.attributes.get_attribute("inkscape:label").value
chopSVG({ :name => icon_name,
:id => icon.attributes.get_attribute("id"),
:dir => dir,
:file => get_output_filename(dir, icon_name)})
end
end
puts "\nrendered all SVGs"
else #only render the icons passed
icons = ARGV
ARGV.each do |icon_name|
icon = svg.root.elements["//g[@inkscape:label='#{icon_name}']"]
dir = "#{PREFIX16}/#{icon.parent.attributes['inkscape:label']}"
chopSVG({ :name => icon_name,
:id => icon.attributes["id"],
:dir => dir,
:file => get_output_filename(dir, icon_name),
:forcerender => true})
end
icon = svg.root.elements["//g[@inkscape:label='#{icon_name}']"]
dir = "#{PREFIX16}/#{icon.parent.attributes['inkscape:label']}"
chopSVG({ :name => icon_name,
:id => icon.attributes["id"],
:dir => dir,
:file => get_output_filename(dir, icon_name),
:forcerender => true})
end
puts "\nrendered #{ARGV.length} icons"
end
@ -101,38 +101,38 @@ SRC48 = "vector/source-48x48.svg"
PREFIX48 = "../Paper/48x48"
def chopSVG(icon)
FileUtils.mkdir_p(icon[:dir]) unless File.exists?(icon[:dir])
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC48,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f -z #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileClose > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f -z #{icon[:file]} --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#system(cmd)
svgcrop = Document.new(File.new(icon[:file], 'r'))
svgcrop.root.each_element("//rect") do |rect|
w = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #get rid of 16 vs 15.99999
h = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #Inkscape bugs
if w == 16 && h == 16
rect.remove
end
end
FileUtils.mkdir_p(icon[:dir]) unless File.exists?(icon[:dir])
unless (File.exists?(icon[:file]) && !icon[:forcerender])
FileUtils.cp(SRC48,icon[:file])
puts " >> #{icon[:name]}"
cmd = "#{INKSCAPE} -f #{icon[:file]} --select #{icon[:id]} --verb=FitCanvasToSelection --verb=EditInvertInAllLayers "
cmd += "--verb=EditDelete --verb=EditSelectAll --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=SelectionUnGroup --verb=StrokeToPath --verb=FileVacuum "
cmd += "--verb=FileSave --verb=FileClose > /dev/null 2>&1"
system(cmd)
#saving as plain SVG gets rid of the classes :/
#cmd = "#{INKSCAPE} -f #{icon[:file]} --vacuum-defs -l #{icon[:file]} > /dev/null 2>&1"
#system(cmd)
svgcrop = Document.new(File.new(icon[:file], 'r'))
svgcrop.root.each_element("//rect") do |rect|
w = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #get rid of 16 vs 15.99999
h = ((rect.attributes["width"].to_f * 10).round / 10.0).to_i #Inkscape bugs
if w == 16 && h == 16
rect.remove
end
end
icon_f = File.new(icon[:file],'w+')
icon_f.puts svgcrop
icon_f.close
else
puts " -- #{icon[:name]} already exists"
end
else
puts " -- #{icon[:name]} already exists"
end
end #end of function
def get_output_filename(d,n)
if (/rtl$/.match(n))
outfile = "#{d}/#{n.chomp('-rtl')}-rtl.svg"
else
outfile = "#{d}/#{n}.svg"
if (/rtl$/.match(n))
outfile = "#{d}/#{n.chomp('-rtl')}-rtl.svg"
else
outfile = "#{d}/#{n}.svg"
end
return outfile
end
@ -143,32 +143,32 @@ svg = Document.new(File.new(SRC48, 'r'))
if (ARGV[0].nil?) #render all SVGs
puts "Rendering from icons in #{SRC48}"
# Go through every layer.
svg.root.each_element("/svg/g[@inkscape:groupmode='layer']") do |context|
context_name = context.attributes.get_attribute("inkscape:label").value
puts "Going through layer '" + context_name + "'"
context.each_element("g") do |icon|
#puts "DEBUG #{icon.attributes.get_attribute('id')}"
dir = "#{PREFIX48}/#{context_name}"
icon_name = icon.attributes.get_attribute("inkscape:label").value
chopSVG({ :name => icon_name,
:id => icon.attributes.get_attribute("id"),
:dir => dir,
:file => get_output_filename(dir, icon_name)})
end
end
# Go through every layer.
svg.root.each_element("/svg/g[@inkscape:groupmode='layer']") do |context|
context_name = context.attributes.get_attribute("inkscape:label").value
puts "Going through layer '" + context_name + "'"
context.each_element("g") do |icon|
#puts "DEBUG #{icon.attributes.get_attribute('id')}"
dir = "#{PREFIX48}/#{context_name}"
icon_name = icon.attributes.get_attribute("inkscape:label").value
chopSVG({ :name => icon_name,
:id => icon.attributes.get_attribute("id"),
:dir => dir,
:file => get_output_filename(dir, icon_name)})
end
end
puts "\nrendered all SVGs"
else #only render the icons passed
icons = ARGV
ARGV.each do |icon_name|
icon = svg.root.elements["//g[@inkscape:label='#{icon_name}']"]
dir = "#{PREFIX48}/#{icon.parent.attributes['inkscape:label']}"
chopSVG({ :name => icon_name,
:id => icon.attributes["id"],
:dir => dir,
:file => get_output_filename(dir, icon_name),
:forcerender => true})
end
icon = svg.root.elements["//g[@inkscape:label='#{icon_name}']"]
dir = "#{PREFIX48}/#{icon.parent.attributes['inkscape:label']}"
chopSVG({ :name => icon_name,
:id => icon.attributes["id"],
:dir => dir,
:file => get_output_filename(dir, icon_name),
:forcerender => true})
end
puts "\nrendered #{ARGV.length} icons"
end

View File

@ -14,7 +14,7 @@
viewBox="0 0 720 600.00001"
id="svg6530"
version="1.1"
inkscape:version="0.91 r"
inkscape:version="0.91 r13725"
sodipodi:docname="source-panel-16.svg">
<defs
id="defs6532">
@ -87,8 +87,8 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="147.88999"
inkscape:cy="446.81469"
inkscape:cx="152.88999"
inkscape:cy="444.81469"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 179 KiB

View File

@ -35,8 +35,8 @@
id="namedview88"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="457.42382"
inkscape:cy="198.06954"
inkscape:cx="309.42382"
inkscape:cy="196.06954"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
@ -2232,6 +2232,18 @@
inkscape:label="actions"
transform="translate(-241.0002,103)"
style="display:inline">
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:125%;font-family:'Droid Sans';text-align:start;text-anchor:start;display:inline;fill:#c3c3c3;fill-opacity:1;stroke:none"
x="265.82401"
y="-76.058334"
id="text6730-2-8"
sodipodi:linespacing="125%"
inkscape:label="context"><tspan
sodipodi:role="line"
id="tspan6732-6-9"
x="265.82401"
y="-76.058334">actions</tspan></text>
<g
transform="matrix(-1,0,0,1,866.0004,-20)"
id="g13524"
@ -3255,17 +3267,6 @@
style="fill:#000000;fill-opacity:0.49803922;stroke:none"
inkscape:connector-curvature="0" />
</g>
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:125%;font-family:'Droid Sans';text-align:start;text-anchor:start;display:inline;fill:#c3c3c3;fill-opacity:1;stroke:none;"
x="265.82401"
y="-70.058334"
id="text6730-2-8"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6732-6-9"
x="265.82401"
y="-70.058334">actions</tspan></text>
<g
transform="translate(225.0004,-546.00336)"
inkscape:label="media-playback-start"

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 456 KiB