-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsfnt2woff-zopfli.rb
24 lines (20 loc) · 2.01 KB
/
sfnt2woff-zopfli.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require "base64"
class Sfnt2woffZopfli < Formula
desc "WOFF utilities with Zopfli compression"
homepage "https://github.com/bramstein/sfnt2woff-zopfli"
url "https://github.com/bramstein/sfnt2woff-zopfli/archive/v1.1.0.tar.gz"
sha256 "86deae57d0bd0eb395f2797c370613e62c1f33dd86626a21e309b154c98efa6b"
def install
system "make"
bin.install "sfnt2woff-zopfli"
bin.install "woff2sfnt-zopfli"
end
test do
woff64_input = "d09GRgABAAAAAAHcAAoAAAAAAggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABTAAAABcAAABOBIQEIWNtYXAAAAFsAAAAJgAAACwADABzZ2x5ZgAAAZwAAAAUAAAAFAgBOQJoZWFkAAAA9AAAACwAAAA2A+TgRGhoZWEAAAEgAAAAFQAAACQIAQQDaG10eAAAAWQAAAAIAAAACAQAAABsb2NhAAABlAAAAAYAAAAGAAoAAG1heHAAAAE4AAAAEwAAACAABAACbmFtZQAAAbAAAAAeAAAAIAAjCF5wb3N0AAAB0AAAAAwAAAAgAAMAAHgBY2BkYADhHCfPyfH8Nl8ZmFgYQOBCWvVrMJ0pnwKiWYAQDJhABAD1VweUeAFjYGRgYGEAAjgJFEEFTAABkgARAAAAeAFjYGRgYGACQiCNDQAAAL4ABwB4AWMAgRQGRgZygQKDAguYASIBIFEArgAAAAAABAAAAHgBY2BgYGRgBmIGBh4GFgYFIM0ChCC+w///EPL/QTCfAQBNfgZ8AAAAAAAAAAoAAAABAAAAAAQABAAAAQAAMQEEAAQAeAFjYGBgYpBjYGZgZOFkYASyGaBsJjDbAQAGMwCKAAB4AWNgZsALAAB9AAQ="
ttf64_input = "AAEAAAAKAIAAAwAgT1MvMgSEBCEAAAEoAAAATmNtYXAADABzAAABgAAAACxnbHlmCAE5AgAAAbQAAAAUaGVhZAPk4EQAAACsAAAANmhoZWEIAQQDAAAA5AAAACRobXR4BAAAAAAAAXgAAAAIbG9jYQAKAAAAAAGsAAAABm1heHAABAACAAABCAAAACBuYW1lACMIXgAAAcgAAAAgcG9zdAADAAAAAAHoAAAAIAABAAAAAQAAbEJJk18PPPUAAgQAAAAAANBme+sAAAAA0GkfZAAAAAAEAAQAAAAAAAACAAAAAAAAAAEAAAQAAAAAAAQAAAAAAAQAAAEAAAAAAAAAAAAAAAAAAAACAAEAAAACAAIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAIAQAAAAAAAQAAAAAAAAAAAAEAAAAAAAAAQADAAEAAAAMAAQAIAAAAAQABAABAAAAQP//AAAAQP///8EAAQAAAAAAAAAAAAoAAAABAAAAAAQABAAAAQAAMQEEAAQAAAAAAgAeAAMAAQQJAAEAAgAAAAMAAQQJAAIAAgAAAEAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="
(testpath/"encode.ttf").write Base64.decode64(ttf64_input)
system bin/"sfnt2woff-zopfli", (testpath/"encode.ttf")
woff64_output = Base64.strict_encode64(File.read(testpath/"encode.woff"))
assert_equal woff64_input, woff64_output
end
end