ttfunk 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b26efe5c04617356a8a8fdcc35a89bb20c995dd8
4
- data.tar.gz: 117c4486162e7ef29d4f7f517005a733250affe1
3
+ metadata.gz: 901b4b6c09e1f0dfb7c327b51321af55a3f75237
4
+ data.tar.gz: 504c1cc9444c543617c02963df1df04cc662d211
5
5
  SHA512:
6
- metadata.gz: 45ce04b7124a8ccea39d8bbe06094ccaf09039f4a55f24f31ed676a397373ffd2dafb930d72c6e97cbf3c6ea5bc99f5877f83de46cec5db19b9ac55844c37722
7
- data.tar.gz: a3ab18306f52ec8bd0c6bbe163458236b3e4ba4c4713fe19eb9aa1e9d50bd42b291ed4e41ebac21ef17e224f90b09b49598d758d17114d6088efe2391721b324
6
+ metadata.gz: 767f9103f60beee020c5a36ff5efb448326f94ea23650eb4cd6c09e497e3194e0692340aeee60519b2dab3e92ac7d751cecb805b240fa87cf5247d9bebef2f12
7
+ data.tar.gz: 92c600ec5bfcf601261f3c8b50df01fce414c8208451d491b359338057fccd372cf7a8ef7c655238914ae067af30e50d89df88dd6b69708754b0e2493bbfbb78
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -7,6 +7,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.5.1]
11
+
12
+ ### Fixed
13
+
14
+ * loca table corruption during subsetting. The loca table serialization code
15
+ didn't properly detect suitable table format.
16
+
17
+ * Fixed checksum calculation for empty tables.
18
+
10
19
  ## [1.5.0] - 2017-02-13
11
20
 
12
21
  ### Added
@@ -102,7 +111,8 @@ Initial release as a standalone gem
102
111
 
103
112
 
104
113
 
105
- [Unreleased]: https://github.com/prawnpdf/ttfunk/compare/1.5.0...HEAD
114
+ [Unreleased]: https://github.com/prawnpdf/ttfunk/compare/1.5.1...HEAD
115
+ [1.5.1]: https://github.com/prawnpdf/ttfunk/compare/1.5.0...1.5.1
106
116
  [1.5.0]: https://github.com/prawnpdf/ttfunk/compare/1.4.0...1.5.0
107
117
  [1.4.0]: https://github.com/prawnpdf/ttfunk/compare/1.3.0...1.4.0
108
118
  [1.3.0]: https://github.com/prawnpdf/ttfunk/compare/1.2.2...1.3.0
@@ -1,5 +1,3 @@
1
- require 'ttfunk'
2
-
3
1
  module TTFunk
4
2
  class Collection
5
3
  include Enumerable
@@ -150,7 +150,7 @@ module TTFunk
150
150
 
151
151
  def checksum(data)
152
152
  data += "\0" * (4 - data.length % 4) unless data.length % 4 == 0
153
- data.unpack('N*').reduce(:+) & 0xFFFF_FFFF
153
+ data.unpack('N*').reduce(0, :+) & 0xFFFF_FFFF
154
154
  end
155
155
 
156
156
  def collect_glyphs(glyph_ids)
@@ -13,7 +13,12 @@ module TTFunk
13
13
  # * :table - the string representing the table's contents
14
14
  # * :type - the type of offset (to be encoded in the 'head' table)
15
15
  def self.encode(offsets)
16
- if offsets.any? { |ofs| ofs > 0xFFFF }
16
+ long_offsets = offsets.any? do |offset|
17
+ short_offset = offset / 2
18
+ short_offset * 2 != offset || short_offset > 0xffff
19
+ end
20
+
21
+ if long_offsets
17
22
  { type: 1, table: offsets.pack('N*') }
18
23
  else
19
24
  { type: 0, table: offsets.map { |o| o / 2 }.pack('n*') }
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.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Brown
@@ -34,7 +34,7 @@ cert_chain:
34
34
  wxx1aB3kGoI0T6JXywKpPnzUt/qji/qpzCNiVJ0RZxzDHyZuL8NEoA9ORZnAIGiW
35
35
  5u3JK+T0toNEYkMuV6W8NU+gVyo=
36
36
  -----END CERTIFICATE-----
37
- date: 2017-02-13 00:00:00.000000000 Z
37
+ date: 2017-04-11 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: rake
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.6.10
175
+ rubygems_version: 2.6.11
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: TrueType Font Metrics Parser
metadata.gz.sig CHANGED
Binary file