text2svg 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/text2svg/typography.rb +3 -3
- data/lib/text2svg/typography_test.rb +11 -0
- data/lib/text2svg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e29c2ffc44a242de91e2876aef21d394daa5daa0
|
4
|
+
data.tar.gz: f860b743cecb07c3678290131ecaeeafdaf10bf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07bfe6642e0e844de542503f5611fc04eae4f82b91e09a7fd0ae47ddaa4904f9da02c1581f3b41fe2ed4dd01246d23222b5d76bb82278f19d8598a8c69d39b15
|
7
|
+
data.tar.gz: 6b868b446bc1ffd78b9df88080eaf347a8503b6d27d984fe9f9d5c88b58b95ae8d611113fa81c340ee7bfa0313aa6d19079f5af2ed135c3d6622c587c7091bf4
|
data/lib/text2svg/typography.rb
CHANGED
@@ -31,7 +31,7 @@ module Text2svg
|
|
31
31
|
option = Option.from_hash(option)
|
32
32
|
end
|
33
33
|
text = String.try_convert(text)
|
34
|
-
return Content.new('', 0, 0) if text.nil? || text.empty?
|
34
|
+
return Content.new('', 0, 0, []) if text.nil? || text.empty?
|
35
35
|
|
36
36
|
option.encoding ||= Encoding::UTF_8
|
37
37
|
option.text_align ||= :left
|
@@ -179,8 +179,8 @@ module Text2svg
|
|
179
179
|
Content.new(
|
180
180
|
output,
|
181
181
|
(max_width + option_width).to_i,
|
182
|
-
y.to_i - f.face[:size][:metrics][:descender] * 1.2,
|
183
|
-
notdef_indexes
|
182
|
+
(y.to_i - f.face[:size][:metrics][:descender] * 1.2).ceil,
|
183
|
+
notdef_indexes,
|
184
184
|
)
|
185
185
|
end
|
186
186
|
end
|
@@ -42,6 +42,17 @@ module Text2svgTypographyTest
|
|
42
42
|
t.error('return value was break')
|
43
43
|
end
|
44
44
|
|
45
|
+
unless Integer === c.width
|
46
|
+
t.error('return value was break')
|
47
|
+
end
|
48
|
+
|
49
|
+
unless Integer === c.height
|
50
|
+
t.error('return value was break')
|
51
|
+
end
|
52
|
+
unless Array === c.notdef_indexes
|
53
|
+
t.error('return value was break')
|
54
|
+
end
|
55
|
+
|
45
56
|
unless c.data.encoding == Encoding::UTF_8
|
46
57
|
t.error('encoding was changed')
|
47
58
|
end
|
data/lib/text2svg/version.rb
CHANGED