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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93c8994bfc2b60b834d4eac55340d47214aa9928
4
- data.tar.gz: 0040028716fbdb275343da6654aec6b171e1d24d
3
+ metadata.gz: e29c2ffc44a242de91e2876aef21d394daa5daa0
4
+ data.tar.gz: f860b743cecb07c3678290131ecaeeafdaf10bf7
5
5
  SHA512:
6
- metadata.gz: 6d9ebb1df54bda25a60df37cf11637c9a3a71f7b92ed29690c23e8aa6b029fdefb9ecf00e9b6d18231cc8a16faad68bbdaf2570ba2c5073aa66568bdb815f803
7
- data.tar.gz: 2a92007b9da174fb0b9b9326f5272951950d198f76b6cc2aad85188a05125f7194ab0543c2fb80ebc9526da5ac07d7d01b6c159db401fa5c1b5e76def748c5a7
6
+ metadata.gz: 07bfe6642e0e844de542503f5611fc04eae4f82b91e09a7fd0ae47ddaa4904f9da02c1581f3b41fe2ed4dd01246d23222b5d76bb82278f19d8598a8c69d39b15
7
+ data.tar.gz: 6b868b446bc1ffd78b9df88080eaf347a8503b6d27d984fe9f9d5c88b58b95ae8d611113fa81c340ee7bfa0313aa6d19079f5af2ed135c3d6622c587c7091bf4
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Text2svg
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: text2svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ksss