gnome-icon-theme r1886 - in trunk: . src



Author: jimmac
Date: Mon Mar  9 14:06:02 2009
New Revision: 1886
URL: http://svn.gnome.org/viewvc/gnome-icon-theme?rev=1886&view=rev

Log:
a11y icon

Added:
   trunk/render-bitmaps.rb   (contents, props changed)
   trunk/src/
   trunk/src/preferences-desktop-accessibility.svg   (contents, props changed)
Modified:
   trunk/ChangeLog

Added: trunk/render-bitmaps.rb
==============================================================================
--- (empty file)
+++ trunk/render-bitmaps.rb	Mon Mar  9 14:06:02 2009
@@ -0,0 +1,40 @@
+#!/usr/bin/env ruby
+
+require "rexml/document"
+require "ftools"
+include REXML
+INKSCAPE = '/usr/bin/inkscape'
+SRC = "./src"
+
+def renderit(file)
+  svg = Document.new(File.new("#{SRC}/#{file}", 'r'))
+  svg.root.each_element("//g[contains(@inkscape:label,'plate')]") do |icon|
+    context = icon.elements["text[ inkscape:label='context']/tspan"].text
+    icon_name = icon.elements["text[ inkscape:label='icon-name']/tspan"].text
+    puts "#{file}:#{icon.attributes['inkscape:label']}  #{context}/#{icon_name}"
+    icon.each_element("rect") do |box|
+      dir = "#{box.attributes['width']}x#{box.attributes['height']}/#{context}"
+      cmd = "#{INKSCAPE} -i #{box.attributes['id']} -e #{dir}/#{file.gsub(/\.svg$/,'.png')} #{SRC}/#{file} > /dev/null 2>&1"
+      File.makedirs(dir) unless File.exists?(dir)
+      system(cmd)
+      print "."
+    end
+    puts ''
+  end
+end
+
+if (ARGV[0].nil?) #render all SVGs
+  puts "Rendering from SVGs in #{SRC}"
+  Dir.foreach(SRC) do |file|
+    renderit(file) if file.match(/svg$/)
+  end
+  puts "\nrendered all SVGs"
+else #only render the SVG passed
+  file = "#{ARGV[0]}.svg"
+  if (File.exists?("#{SRC}/#{file}"))
+    renderit(file)
+    puts "\nrendered #{file}"
+  else
+    puts "[E] No such file (#{file})"
+  end
+end

Added: trunk/src/preferences-desktop-accessibility.svg
==============================================================================
Binary file. No diff available.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]