text2svg 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/text2svg/typography.rb +3 -5
- 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: 93c8994bfc2b60b834d4eac55340d47214aa9928
|
|
4
|
+
data.tar.gz: 0040028716fbdb275343da6654aec6b171e1d24d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d9ebb1df54bda25a60df37cf11637c9a3a71f7b92ed29690c23e8aa6b029fdefb9ecf00e9b6d18231cc8a16faad68bbdaf2570ba2c5073aa66568bdb815f803
|
|
7
|
+
data.tar.gz: 2a92007b9da174fb0b9b9326f5272951950d198f76b6cc2aad85188a05125f7194ab0543c2fb80ebc9526da5ac07d7d01b6c159db401fa5c1b5e76def748c5a7
|
data/lib/text2svg/typography.rb
CHANGED
|
@@ -136,16 +136,14 @@ module Text2svg
|
|
|
136
136
|
|
|
137
137
|
y = 0r
|
|
138
138
|
output = ''
|
|
139
|
-
line_height = f.line_height
|
|
140
|
-
|
|
141
139
|
output << %(<g #{option.attribute}>\n) if option.attribute
|
|
142
140
|
|
|
143
141
|
lines.zip(width_by_line).each_with_index do |(line, line_width), index|
|
|
144
142
|
x = 0r
|
|
145
143
|
y += if index == 0
|
|
146
|
-
|
|
144
|
+
f.face[:size][:metrics][:ascender]
|
|
147
145
|
else
|
|
148
|
-
line_height
|
|
146
|
+
f.line_height
|
|
149
147
|
end
|
|
150
148
|
before_char = nil
|
|
151
149
|
|
|
@@ -181,7 +179,7 @@ module Text2svg
|
|
|
181
179
|
Content.new(
|
|
182
180
|
output,
|
|
183
181
|
(max_width + option_width).to_i,
|
|
184
|
-
|
|
182
|
+
y.to_i - f.face[:size][:metrics][:descender] * 1.2,
|
|
185
183
|
notdef_indexes
|
|
186
184
|
)
|
|
187
185
|
end
|
data/lib/text2svg/version.rb
CHANGED