ttfunk 1.6.2.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -1
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +15 -1
- data/lib/ttfunk.rb +3 -2
- data/lib/ttfunk/bit_field.rb +1 -1
- data/lib/ttfunk/collection.rb +8 -2
- data/lib/ttfunk/encoded_string.rb +3 -3
- data/lib/ttfunk/max.rb +1 -0
- data/lib/ttfunk/min.rb +1 -0
- data/lib/ttfunk/one_based_array.rb +1 -1
- data/lib/ttfunk/otf_encoder.rb +1 -1
- data/lib/ttfunk/reader.rb +3 -3
- data/lib/ttfunk/sci_form.rb +1 -1
- data/lib/ttfunk/subset.rb +3 -3
- data/lib/ttfunk/subset/base.rb +24 -21
- data/lib/ttfunk/subset/code_page.rb +16 -19
- data/lib/ttfunk/subset/unicode.rb +8 -6
- data/lib/ttfunk/subset/unicode_8bit.rb +14 -12
- data/lib/ttfunk/sum.rb +1 -0
- data/lib/ttfunk/table/cff.rb +17 -17
- data/lib/ttfunk/table/cff/charset.rb +31 -30
- data/lib/ttfunk/table/cff/charsets.rb +3 -3
- data/lib/ttfunk/table/cff/charstring.rb +54 -55
- data/lib/ttfunk/table/cff/dict.rb +6 -4
- data/lib/ttfunk/table/cff/encoding.rb +20 -21
- data/lib/ttfunk/table/cff/encodings.rb +1 -1
- data/lib/ttfunk/table/cff/fd_selector.rb +14 -11
- data/lib/ttfunk/table/cff/font_index.rb +7 -6
- data/lib/ttfunk/table/cff/index.rb +6 -5
- data/lib/ttfunk/table/cff/one_based_index.rb +7 -3
- data/lib/ttfunk/table/cff/path.rb +5 -3
- data/lib/ttfunk/table/cff/top_dict.rb +7 -6
- data/lib/ttfunk/table/cff/top_index.rb +5 -4
- data/lib/ttfunk/table/cmap.rb +8 -6
- data/lib/ttfunk/table/cmap/format00.rb +7 -6
- data/lib/ttfunk/table/cmap/format04.rb +16 -15
- data/lib/ttfunk/table/cmap/format06.rb +6 -5
- data/lib/ttfunk/table/cmap/format10.rb +6 -5
- data/lib/ttfunk/table/cmap/format12.rb +13 -12
- data/lib/ttfunk/table/cmap/subtable.rb +4 -4
- data/lib/ttfunk/table/dsig.rb +11 -9
- data/lib/ttfunk/table/glyf.rb +3 -3
- data/lib/ttfunk/table/glyf/compound.rb +8 -8
- data/lib/ttfunk/table/hmtx.rb +6 -5
- data/lib/ttfunk/table/kern.rb +4 -4
- data/lib/ttfunk/table/kern/format0.rb +1 -1
- data/lib/ttfunk/table/loca.rb +7 -6
- data/lib/ttfunk/table/name.rb +6 -5
- data/lib/ttfunk/table/os2.rb +261 -151
- data/lib/ttfunk/table/post.rb +1 -1
- data/lib/ttfunk/table/sbix.rb +15 -13
- data/lib/ttfunk/table/vorg.rb +1 -1
- data/lib/ttfunk/ttf_encoder.rb +4 -4
- metadata +29 -99
- metadata.gz.sig +0 -0
data/lib/ttfunk/table/post.rb
CHANGED
data/lib/ttfunk/table/sbix.rb
CHANGED
@@ -21,7 +21,7 @@ module TTFunk
|
|
21
21
|
|
22
22
|
if glyph_offset && next_glyph_offset
|
23
23
|
bytes = next_glyph_offset - glyph_offset
|
24
|
-
if bytes
|
24
|
+
if bytes.positive?
|
25
25
|
parse_from(offset + strike[:offset] + glyph_offset) do
|
26
26
|
x, y, type = read(8, 's2A4')
|
27
27
|
data = StringIO.new(io.read(bytes - 8))
|
@@ -45,20 +45,22 @@ module TTFunk
|
|
45
45
|
@version, @flags, @num_strikes = read(8, 'n2N')
|
46
46
|
strike_offsets = Array.new(num_strikes) { read(4, 'N').first }
|
47
47
|
|
48
|
-
@strikes =
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
@strikes =
|
49
|
+
strike_offsets.map do |strike_offset|
|
50
|
+
parse_from(offset + strike_offset) do
|
51
|
+
ppem, resolution = read(4, 'n2')
|
52
|
+
data_offsets =
|
53
|
+
Array.new(file.maximum_profile.num_glyphs + 1) do
|
54
|
+
read(4, 'N').first
|
55
|
+
end
|
56
|
+
{
|
57
|
+
ppem: ppem,
|
58
|
+
resolution: resolution,
|
59
|
+
offset: strike_offset,
|
60
|
+
glyph_data_offset: data_offsets
|
61
|
+
}
|
53
62
|
end
|
54
|
-
{
|
55
|
-
ppem: ppem,
|
56
|
-
resolution: resolution,
|
57
|
-
offset: strike_offset,
|
58
|
-
glyph_data_offset: data_offsets
|
59
|
-
}
|
60
63
|
end
|
61
|
-
end
|
62
64
|
end
|
63
65
|
end
|
64
66
|
end
|
data/lib/ttfunk/table/vorg.rb
CHANGED
data/lib/ttfunk/ttf_encoder.rb
CHANGED
@@ -21,7 +21,7 @@ module TTFunk
|
|
21
21
|
search_range = 2**Math.log2(tables.length).floor * 16
|
22
22
|
entry_selector = Math.log2(2**Math.log2(tables.length).floor).to_i
|
23
23
|
range_shift = tables.length * 16 - search_range
|
24
|
-
range_shift = 0 if range_shift
|
24
|
+
range_shift = 0 if range_shift.negative?
|
25
25
|
|
26
26
|
newfont = EncodedString.new
|
27
27
|
|
@@ -186,7 +186,7 @@ module TTFunk
|
|
186
186
|
'VORG' => vorg_table,
|
187
187
|
'DSIG' => dsig_table,
|
188
188
|
'gasp' => gasp_table
|
189
|
-
}.
|
189
|
+
}.compact
|
190
190
|
end
|
191
191
|
|
192
192
|
def glyphs
|
@@ -202,7 +202,7 @@ module TTFunk
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def checksum(data)
|
205
|
-
align(raw(data), 4).unpack('N*').
|
205
|
+
align(raw(data), 4).unpack('N*').sum & 0xFFFF_FFFF
|
206
206
|
end
|
207
207
|
|
208
208
|
def raw(data)
|
@@ -210,7 +210,7 @@ module TTFunk
|
|
210
210
|
end
|
211
211
|
|
212
212
|
def align(data, width)
|
213
|
-
if data.length % width
|
213
|
+
if (data.length % width).positive?
|
214
214
|
data + "\0" * (width - data.length % width)
|
215
215
|
else
|
216
216
|
data
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ttfunk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory Brown
|
@@ -10,116 +10,46 @@ authors:
|
|
10
10
|
- Jonathan Greenberg
|
11
11
|
- James Healy
|
12
12
|
- Cameron Dutro
|
13
|
-
autorequire:
|
13
|
+
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain:
|
16
16
|
- |
|
17
17
|
-----BEGIN CERTIFICATE-----
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
18
|
+
MIIDODCCAiCgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhhbGV4
|
19
|
+
L0RDPXBvaW50bGVzcy9EQz1vbmUwHhcNMjAwODAxMTQxMjE1WhcNMjEwODAxMTQx
|
20
|
+
MjE1WjAjMSEwHwYDVQQDDBhhbGV4L0RDPXBvaW50bGVzcy9EQz1vbmUwggEiMA0G
|
21
|
+
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPOVLPGEK+eaP6zJfifrpWvPTg4qo3
|
22
|
+
XNJJPom80SwqX2hVCVsRDK4RYgKUQqKRQzHhlx14wZHwWLETBVbNDGX3uqyCnTWU
|
23
|
+
JUKh3ydiZShXpNHoV/NW7hhEYvNsDcBAjYTmbvXOhuYCo0Tz/0N2Oiun/0wIICtP
|
24
|
+
vytY9TY0/lklWjAbsqJjNOu3o8IYkJBAN/rU96E/6WhFwjnxLcTnV9RfFRXdjG5j
|
25
|
+
CughoB2xSwKX8gwbQ8fsnaZRmdyDGYNpz6sGF0zycfiLkTttbLA2nYATCALy98CH
|
26
|
+
nsyZNsTjb4WINCuY2yEDjwesw9f/ROkNC68EgQ5M+aMjp+D0WcYGfzojAgMBAAGj
|
27
|
+
dzB1MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRPgIwSVbeonua/
|
28
|
+
Ny/8576oxdUbrjAdBgNVHREEFjAUgRJhbGV4QHBvaW50bGVzcy5vbmUwHQYDVR0S
|
29
|
+
BBYwFIESYWxleEBwb2ludGxlc3Mub25lMA0GCSqGSIb3DQEBCwUAA4IBAQAzhGxF
|
30
|
+
M0bXJ9GWD9vdVHOyzBQBJcJAvnsz2yV3+r4eJBsQynFIscsea8lHFL/d1eHYP0mN
|
31
|
+
k0fhK+WDcPlrj0Sn/Ezhk2qogTIekwDOK6pZkGRQzD45leJqQMnYd+/TXK3ri485
|
32
|
+
Gi4oJ6NitnnUT59SQnjD5JcENfc0EcRzclmVRFE8W4O+ORgo4Dypq1rwYUzxeyUk
|
33
|
+
mP5jNBWtH+hGUph28GQb0Hph6YnQb8zEFB88Xq80PK1SzkIPHpbTBk9mwPf6ypeX
|
34
|
+
Un1TJEahAlgENVml6CyDXSwk0H8N1V3gm1mb9Fe1T2Z/kAzvjo0qTDEtMVLU7Bxh
|
35
|
+
uqMUrdETjTnRYCVq
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2020-
|
37
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
|
-
name:
|
40
|
+
name: prawn-dev
|
41
41
|
requirement: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
43
|
- - "~>"
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 0.1.0
|
46
46
|
type: :development
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: rspec
|
55
|
-
requirement: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
-
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '3.5'
|
60
|
-
type: :development
|
61
|
-
prerelease: false
|
62
|
-
version_requirements: !ruby/object:Gem::Requirement
|
63
|
-
requirements:
|
64
|
-
- - "~>"
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: '3.5'
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: rubocop
|
69
|
-
requirement: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - "~>"
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
version: '0.68'
|
74
|
-
type: :development
|
75
|
-
prerelease: false
|
76
|
-
version_requirements: !ruby/object:Gem::Requirement
|
77
|
-
requirements:
|
78
|
-
- - "~>"
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
version: '0.68'
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: rubocop-performance
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - "~>"
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '1.1'
|
88
|
-
type: :development
|
89
|
-
prerelease: false
|
90
|
-
version_requirements: !ruby/object:Gem::Requirement
|
91
|
-
requirements:
|
92
|
-
- - "~>"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '1.1'
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: rubocop-rspec
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
98
|
-
requirements:
|
99
|
-
- - "~>"
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '1.32'
|
102
|
-
type: :development
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
requirements:
|
106
|
-
- - "~>"
|
107
|
-
- !ruby/object:Gem::Version
|
108
|
-
version: '1.32'
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: yard
|
111
|
-
requirement: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - "~>"
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '0.9'
|
116
|
-
type: :development
|
117
|
-
prerelease: false
|
118
|
-
version_requirements: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - "~>"
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: '0.9'
|
52
|
+
version: 0.1.0
|
123
53
|
description: Font Metrics Parser for the Prawn PDF generator
|
124
54
|
email:
|
125
55
|
- gregory.t.brown@gmail.com
|
@@ -225,23 +155,23 @@ licenses:
|
|
225
155
|
- GPL-2.0
|
226
156
|
- GPL-3.0
|
227
157
|
metadata: {}
|
228
|
-
post_install_message:
|
158
|
+
post_install_message:
|
229
159
|
rdoc_options: []
|
230
160
|
require_paths:
|
231
161
|
- lib
|
232
162
|
required_ruby_version: !ruby/object:Gem::Requirement
|
233
163
|
requirements:
|
234
|
-
- - "
|
164
|
+
- - ">="
|
235
165
|
- !ruby/object:Gem::Version
|
236
|
-
version: '2.
|
166
|
+
version: '2.5'
|
237
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
238
168
|
requirements:
|
239
169
|
- - ">="
|
240
170
|
- !ruby/object:Gem::Version
|
241
171
|
version: '0'
|
242
172
|
requirements: []
|
243
|
-
rubygems_version: 3.
|
244
|
-
signing_key:
|
173
|
+
rubygems_version: 3.2.3
|
174
|
+
signing_key:
|
245
175
|
specification_version: 4
|
246
176
|
summary: TrueType Font Metrics Parser
|
247
177
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|