madrobby-textorize 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/Rakefile +16 -0
  2. data/bin/textorize +69 -0
  3. metadata +54 -0
data/Rakefile ADDED
@@ -0,0 +1,16 @@
1
+ require "rubygems"
2
+ require "rake/testtask"
3
+ require "rake/gempackagetask"
4
+
5
+ task :default => :test
6
+
7
+ Rake::TestTask.new do |t|
8
+ t.libs << "test"
9
+ t.test_files = FileList["test/test_*.rb"]
10
+ t.verbose = true
11
+ end
12
+
13
+ Rake::GemPackageTask.new(eval(IO.read(File.join(File.dirname(__FILE__), "textorize.gemspec")))) do |pkg|
14
+ pkg.need_zip = true
15
+ pkg.need_tar = true
16
+ end
data/bin/textorize ADDED
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env ruby
2
+ require "optparse"
3
+ require "lib/textorize"
4
+
5
+
6
+ options = {}
7
+ opts = OptionParser.new do |opts|
8
+ opts.banner = "Usage: #$0 [options] string"
9
+
10
+ opts.on('-f', '--font=[FONT]', String, 'Font name') do |v|
11
+ options[:font] = v
12
+ end
13
+
14
+ opts.on('-s', '--size=[SIZE]', Float, 'Font size in point') do |v|
15
+ options[:size] = v
16
+ end
17
+
18
+ opts.on('-l', '--lineheight=[HEIGHT]', Float, 'Line height in point') do |v|
19
+ options[:lineheight] = v
20
+ end
21
+
22
+ opts.on('-k', '--kerning=[STEPS]', Integer, 'Tighten or loosen kerning by the given amount') do |v|
23
+ options[:kerning] = v
24
+ end
25
+
26
+ opts.on('-w', '--width=[WIDTH]', Integer, 'Wrapping width in pixels') do |v|
27
+ options[:width] = v
28
+ end
29
+
30
+ opts.on('-o', '--output=[FILENAME]', String, 'Specify filename for saving') do |v|
31
+ options[:output] = v
32
+ end
33
+
34
+ opts.on('-b', '--obliqueness=[ANGLE]', Float, 'Slant angle') do |v|
35
+ options[:obliqueness] = v
36
+ end
37
+
38
+ opts.on('-t', '--stencil=[COLOR]', String, 'Render background with color and stencil text') do |v|
39
+ options[:stencil] = v
40
+ end
41
+
42
+ opts.on('-r', '--reverse', 'Reverse stencil (color on transparent background)') do
43
+ options[:reverse_stencil] = true
44
+ end
45
+
46
+ opts.on('-c', '--color=[COLOR]', String, 'Render text in specific color') do |v|
47
+ options[:color] = v
48
+ end
49
+
50
+ opts.on('-b', '--background=[COLOR]', String, 'Render background in specific color') do |v|
51
+ options[:background] = v
52
+ end
53
+
54
+ opts.on_tail('-h', '--help', 'Display this message and exit') do
55
+ puts opts
56
+ exit
57
+ end
58
+ end.parse!
59
+
60
+ options[:font] ||= 'Arial'
61
+ options[:size] ||= 28.0
62
+ options[:kerning] ||= 0
63
+ options[:lineheight] ||= options[:size]
64
+ options[:output] ||= 'output.png'
65
+ options[:strings] = ARGV.first || 'Hello World'
66
+ options[:width] ||= 250
67
+ options[:obliqueness] ||= 0
68
+
69
+ renderer = Textorize::Runner.new(options[:strings], options[:output], options)
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: madrobby-textorize
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Thomas Fuchs
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-26 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Textorize is a OS X utility to render subpixel antialised strings into PNG files.
17
+ email: thomas@fesch.at
18
+ executables:
19
+ - textorize
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - Rakefile
26
+ has_rdoc: false
27
+ homepage: http://github.com/madrobby/textorize
28
+ licenses:
29
+ post_install_message:
30
+ rdoc_options: []
31
+
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: "0"
39
+ version:
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: "0"
45
+ version:
46
+ requirements: []
47
+
48
+ rubyforge_project:
49
+ rubygems_version: 1.3.5
50
+ signing_key:
51
+ specification_version: 2
52
+ summary: OS X subpixel antialiased PNG string renderer
53
+ test_files: []
54
+