woff 1.0.0 → 1.1.0
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/.codeclimate.yml +24 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +1156 -0
- data/.travis.yml +13 -0
- data/README.md +25 -4
- data/Rakefile +5 -0
- data/bin/rake +17 -0
- data/lib/woff.rb +8 -1
- data/lib/woff/builder.rb +66 -15
- data/lib/woff/file.rb +152 -0
- data/lib/woff/version.rb +1 -1
- data/requirements.txt +1 -0
- data/spec/builder_spec.rb +49 -0
- data/spec/data/font-with-no-metadata.woff +0 -0
- data/spec/spec_helper.rb +7 -0
- data/woff.gemspec +9 -2
- data/woffTools/Lib/woffTools/__init__.py +1176 -0
- data/woffTools/Lib/woffTools/test/__init__.py +0 -0
- data/woffTools/Lib/woffTools/test/test_validate.py +2657 -0
- data/woffTools/Lib/woffTools/tools/__init__.py +0 -0
- data/woffTools/Lib/woffTools/tools/css.py +292 -0
- data/woffTools/Lib/woffTools/tools/info.py +296 -0
- data/woffTools/Lib/woffTools/tools/proof.py +210 -0
- data/woffTools/Lib/woffTools/tools/support.py +417 -0
- data/woffTools/Lib/woffTools/tools/validate.py +2504 -0
- data/woffTools/License.txt +21 -0
- data/woffTools/README.txt +31 -0
- data/woffTools/setup.py +35 -0
- data/woffTools/woff-all +28 -0
- data/woffTools/woff-css +5 -0
- data/woffTools/woff-info +5 -0
- data/woffTools/woff-proof +5 -0
- data/woffTools/woff-validate +5 -0
- metadata +94 -9
- data/lib/woff/data.rb +0 -44
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2009 Type Supply LLC
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Forked by ftw to:
|
2
|
+
* add exit code non-zero if any errors
|
3
|
+
* add an `-f` option to choose html vs text format (that was already there)
|
4
|
+
* add a `-q` option for quiet output
|
5
|
+
|
6
|
+
woffTools is a collection of command line tools for verifying and
|
7
|
+
examining WOFF files. This is also a Python package that can be used
|
8
|
+
to manipulate and examine WOFF files just as you can examine SFNT files
|
9
|
+
with FontTools.
|
10
|
+
|
11
|
+
Dependencies
|
12
|
+
FontTools: https://github.com/behdad/fonttools/
|
13
|
+
Numpy: http://numpy.scipy.org/
|
14
|
+
|
15
|
+
Installation
|
16
|
+
Run setup.py in your preferred Python interpreter.
|
17
|
+
|
18
|
+
Command Line Tools
|
19
|
+
woff-validate - Validate a WOFF file and output an HTML report.
|
20
|
+
woff-info - Generate an HTML file containing information about a WOFF file.
|
21
|
+
woff-proof - Generate an HTML file that shows a WOFF file.
|
22
|
+
woff-css - Generate a CSS @font-face rule based on the content of a WOFF file.
|
23
|
+
woff-all - Run all of the tests above.
|
24
|
+
|
25
|
+
Python Objects
|
26
|
+
Refer to the documentation in woffTools.__init__ for information
|
27
|
+
about using the available Python objects.
|
28
|
+
|
29
|
+
Bugs? Suggestions?
|
30
|
+
If you notice bugs or have any suggestions, please contact me
|
31
|
+
at tal@typesupply.com.
|
data/woffTools/setup.py
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
|
3
|
+
import sys
|
4
|
+
from setuptools import setup
|
5
|
+
|
6
|
+
try:
|
7
|
+
import fontTools
|
8
|
+
except:
|
9
|
+
print "*** Warning: woffTools requires FontTools, see:"
|
10
|
+
print " fonttools.sf.net"
|
11
|
+
|
12
|
+
|
13
|
+
setup(
|
14
|
+
name="woffTools",
|
15
|
+
version="0.1beta",
|
16
|
+
description="A set of tools for working with WOFF files.",
|
17
|
+
author="Tal Leming",
|
18
|
+
author_email="tal@typesupply.com",
|
19
|
+
url="https://github.com/typesupply/woffTools",
|
20
|
+
license="MIT",
|
21
|
+
packages=[
|
22
|
+
"",
|
23
|
+
"woffTools",
|
24
|
+
"woffTools.tools",
|
25
|
+
"woffTools.test"
|
26
|
+
],
|
27
|
+
package_dir={"":"Lib"},
|
28
|
+
scripts=[
|
29
|
+
"woff-all",
|
30
|
+
"woff-validate",
|
31
|
+
"woff-info",
|
32
|
+
"woff-proof",
|
33
|
+
"woff-css",
|
34
|
+
]
|
35
|
+
)
|
data/woffTools/woff-all
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
#! /usr/bin/env python
|
2
|
+
|
3
|
+
doc = """woff-all [options] fontpath1 fontpath2"
|
4
|
+
|
5
|
+
This tool runs woof-validate, woff-info, woff-proof
|
6
|
+
and woff-css in their default modes. The only allowed
|
7
|
+
argument is -d for specifying the output directory.
|
8
|
+
Refer to the other tools for details about what
|
9
|
+
they do."""
|
10
|
+
|
11
|
+
import sys
|
12
|
+
from woffTools.tools import validate
|
13
|
+
from woffTools.tools import info
|
14
|
+
from woffTools.tools import proof
|
15
|
+
from woffTools.tools import css
|
16
|
+
|
17
|
+
if len(sys.argv) > 1 and sys.argv[1] == "-h":
|
18
|
+
print doc
|
19
|
+
sys.exit()
|
20
|
+
|
21
|
+
for i in sys.argv:
|
22
|
+
if i.startswith("-") and not i == "-d":
|
23
|
+
print "Only the -d argument may be used with this tool."
|
24
|
+
sys.exit()
|
25
|
+
|
26
|
+
modules = [validate, info, proof, css]
|
27
|
+
for module in modules:
|
28
|
+
module.main()
|
data/woffTools/woff-css
ADDED
data/woffTools/woff-info
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Hepworth
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -24,23 +24,105 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.3'
|
27
|
-
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: brotli
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '11.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '11.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.5'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.5'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.4'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.4'
|
83
|
+
description: Handles the management and modification of WOFF and WOFF2 formatted files.
|
28
84
|
email:
|
29
85
|
- josh@friendsoftheweb.com
|
30
|
-
executables:
|
86
|
+
executables:
|
87
|
+
- rake
|
31
88
|
extensions: []
|
32
89
|
extra_rdoc_files: []
|
33
90
|
files:
|
91
|
+
- ".codeclimate.yml"
|
34
92
|
- ".gitignore"
|
93
|
+
- ".rubocop.yml"
|
94
|
+
- ".travis.yml"
|
35
95
|
- Gemfile
|
36
96
|
- LICENSE.txt
|
37
97
|
- README.md
|
38
98
|
- Rakefile
|
99
|
+
- bin/rake
|
39
100
|
- lib/woff.rb
|
40
101
|
- lib/woff/builder.rb
|
41
|
-
- lib/woff/
|
102
|
+
- lib/woff/file.rb
|
42
103
|
- lib/woff/version.rb
|
104
|
+
- requirements.txt
|
105
|
+
- spec/builder_spec.rb
|
106
|
+
- spec/data/font-with-no-metadata.woff
|
107
|
+
- spec/spec_helper.rb
|
43
108
|
- woff.gemspec
|
109
|
+
- woffTools/Lib/woffTools/__init__.py
|
110
|
+
- woffTools/Lib/woffTools/test/__init__.py
|
111
|
+
- woffTools/Lib/woffTools/test/test_validate.py
|
112
|
+
- woffTools/Lib/woffTools/tools/__init__.py
|
113
|
+
- woffTools/Lib/woffTools/tools/css.py
|
114
|
+
- woffTools/Lib/woffTools/tools/info.py
|
115
|
+
- woffTools/Lib/woffTools/tools/proof.py
|
116
|
+
- woffTools/Lib/woffTools/tools/support.py
|
117
|
+
- woffTools/Lib/woffTools/tools/validate.py
|
118
|
+
- woffTools/License.txt
|
119
|
+
- woffTools/README.txt
|
120
|
+
- woffTools/setup.py
|
121
|
+
- woffTools/woff-all
|
122
|
+
- woffTools/woff-css
|
123
|
+
- woffTools/woff-info
|
124
|
+
- woffTools/woff-proof
|
125
|
+
- woffTools/woff-validate
|
44
126
|
homepage: https://github.com/friendsoftheweb/woff-rb
|
45
127
|
licenses:
|
46
128
|
- MIT
|
@@ -53,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
135
|
requirements:
|
54
136
|
- - ">="
|
55
137
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
138
|
+
version: 2.2.0
|
57
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
140
|
requirements:
|
59
141
|
- - ">="
|
@@ -61,8 +143,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
143
|
version: '0'
|
62
144
|
requirements: []
|
63
145
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.5.
|
146
|
+
rubygems_version: 2.5.2
|
65
147
|
signing_key:
|
66
148
|
specification_version: 4
|
67
|
-
summary: Reading and modifying binary WOFF files.
|
68
|
-
test_files:
|
149
|
+
summary: Reading and modifying binary WOFF and WOFF2 files.
|
150
|
+
test_files:
|
151
|
+
- spec/builder_spec.rb
|
152
|
+
- spec/data/font-with-no-metadata.woff
|
153
|
+
- spec/spec_helper.rb
|
data/lib/woff/data.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
module WOFF
|
2
|
-
class Data < ::BinData::Record
|
3
|
-
endian :big
|
4
|
-
count_bytes_remaining :bytes_remaining
|
5
|
-
|
6
|
-
uint32 :signature
|
7
|
-
uint32 :flavor
|
8
|
-
uint32 :data_length
|
9
|
-
uint16 :num_tables
|
10
|
-
uint16 :reserved
|
11
|
-
uint32 :total_s_fnt_size
|
12
|
-
uint16 :major_version
|
13
|
-
uint16 :minor_version
|
14
|
-
uint32 :meta_offset
|
15
|
-
uint32 :meta_length
|
16
|
-
uint32 :meta_orig_length
|
17
|
-
uint32 :priv_offset
|
18
|
-
uint32 :priv_length
|
19
|
-
|
20
|
-
array :table_directory, :initial_length => :num_tables do
|
21
|
-
uint32 :tag
|
22
|
-
uint32 :table_offset
|
23
|
-
uint32 :comp_length
|
24
|
-
uint32 :orig_length
|
25
|
-
uint32 :orig_checksum
|
26
|
-
end
|
27
|
-
|
28
|
-
string :fonts, :read_length => lambda {
|
29
|
-
dir = table_directory.sort_by { |entry| entry["table_offset"] }
|
30
|
-
|
31
|
-
first_table_start = dir.first["table_offset"]
|
32
|
-
last_table_end = dir.last["table_offset"] + dir.last["comp_length"]
|
33
|
-
|
34
|
-
table_length = last_table_end - first_table_start
|
35
|
-
|
36
|
-
# Next largest number divisible by 4
|
37
|
-
(table_length / 4.0).ceil * 4
|
38
|
-
}
|
39
|
-
|
40
|
-
string :metadata, :read_length => :meta_length
|
41
|
-
|
42
|
-
rest :private_data
|
43
|
-
end
|
44
|
-
end
|