textorize 0.23 → 0.24
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/textorize +4 -0
- data/lib/textorize/renderer.rb +1 -1
- data/lib/textorize/runner.rb +11 -0
- metadata +1 -1
data/bin/textorize
CHANGED
@@ -46,6 +46,10 @@ opts = OptionParser.new do |opts|
|
|
46
46
|
options[:background] = v
|
47
47
|
end
|
48
48
|
|
49
|
+
opts.on('-a', '--smoothing=[VALUE]', Integer, 'Font smoothing: 0=no subpixel AA, 1=light, 2=normal, 3=strong') do |v|
|
50
|
+
options[:font_smoothing] = v
|
51
|
+
end
|
52
|
+
|
49
53
|
opts.on_tail('-h', '--help', 'Display this message and exit') do
|
50
54
|
puts opts
|
51
55
|
exit
|
data/lib/textorize/renderer.rb
CHANGED
data/lib/textorize/runner.rb
CHANGED
@@ -4,6 +4,12 @@ module Textorize
|
|
4
4
|
class Runner
|
5
5
|
|
6
6
|
def initialize(string, output, options)
|
7
|
+
if options[:font_smoothing]
|
8
|
+
defaults = OSX::NSUserDefaults.standardUserDefaults
|
9
|
+
options[:original_font_smoothing] = defaults.integerForKey('AppleFontSmoothing')
|
10
|
+
defaults.setInteger_forKey(options[:font_smoothing], 'AppleFontSmoothing')
|
11
|
+
end
|
12
|
+
|
7
13
|
app = OSX::NSApplication.sharedApplication
|
8
14
|
app.delegate = RunnerApplication.alloc.initWithString_output_options(string, output, options)
|
9
15
|
app.run
|
@@ -40,6 +46,11 @@ module Textorize
|
|
40
46
|
Saver.new(renderer).write_to_file(@output)
|
41
47
|
end
|
42
48
|
NSApplication.sharedApplication.terminate(nil)
|
49
|
+
|
50
|
+
if @options[:font_smoothing]
|
51
|
+
defaults = NSUserDefaults.standardUserDefaults
|
52
|
+
defaults.setInteger_forKey(options[:original_font_smoothing], 'AppleFontSmoothing')
|
53
|
+
end
|
43
54
|
end
|
44
55
|
|
45
56
|
end
|