textorize 0.25 → 0.26
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/textorize/saver.rb +6 -2
- metadata +2 -2
data/lib/textorize/saver.rb
CHANGED
@@ -4,12 +4,16 @@ module Textorize
|
|
4
4
|
attr_reader :png
|
5
5
|
|
6
6
|
def initialize(renderer)
|
7
|
-
bitmap = renderer.bitmap
|
8
|
-
@png = bitmap.representationUsingType_properties(NSPNGFileType, nil)
|
7
|
+
@bitmap = renderer.bitmap
|
8
|
+
@png = @bitmap.representationUsingType_properties(NSPNGFileType, nil)
|
9
9
|
end
|
10
10
|
|
11
11
|
def write_to_file(file)
|
12
12
|
@png.writeToFile_atomically(file, true)
|
13
|
+
|
14
|
+
cg = @bitmap.CGImage
|
15
|
+
w, h = CGImageGetWidth(cg), CGImageGetHeight(cg)
|
16
|
+
puts "\n{\n background: url(#{file});\n width: #{w}px;\n height: #{h}px;\n}\n"
|
13
17
|
end
|
14
18
|
|
15
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textorize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.26"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Fuchs
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-12 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|