cjk-subsetter 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rack/style.erb +2 -1
- data/lib/rack/subsetter.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce301c2cc33eb446ed7e7ea98db2750c2929fa7f
|
4
|
+
data.tar.gz: 4c10cd516d6658dea61c6ec2860e7bc3ab93d22d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff327850d2fd7ddd47e459566059e182863acf1df4e3b11399d00e82e167b4e3933bc813a3bf0d13b0b91c795ccf070ec5e32c9cf735ae272aa14dc9bc9bd02e
|
7
|
+
data.tar.gz: 1e3a8b92349a302ef91fa1c46ecd99e408fb7af1ab16771c10621bb40981aef34ce74389f1fa89aa0904ae6c33ed816d45b18775b385a7d9d59395002959cd5c
|
data/lib/rack/style.erb
CHANGED
data/lib/rack/subsetter.rb
CHANGED
@@ -70,8 +70,10 @@ module Rack
|
|
70
70
|
@subset_string_map.each do |font_key, chars_map|
|
71
71
|
subset_string = chars_map.map { |key, value| key }.join
|
72
72
|
font_name = @font_map[font_key].join
|
73
|
+
klass = '.%s-' % @prefix + font_key
|
74
|
+
font_url = {}
|
73
75
|
|
74
|
-
['.ttf', '.
|
76
|
+
['.ttf', '.woff'].each do |file_type|
|
75
77
|
file_path = create_path(subset_string, font_name, file_type)
|
76
78
|
file_is_eot = file_type == '.eot'
|
77
79
|
|
@@ -80,7 +82,7 @@ module Rack
|
|
80
82
|
args = ["java", "-jar", "#{@sfnttool}"]
|
81
83
|
|
82
84
|
if file_is_eot
|
83
|
-
args.push "-
|
85
|
+
args.push "-w"
|
84
86
|
end
|
85
87
|
|
86
88
|
args.concat ["-s", "#{subset_string}",
|
@@ -90,11 +92,10 @@ module Rack
|
|
90
92
|
end
|
91
93
|
|
92
94
|
p_output = Pathname.new file_path
|
93
|
-
font_url = @relative_url_root + \
|
95
|
+
font_url[file_type] = @relative_url_root + \
|
94
96
|
p_output.relative_path_from(p_public).to_s
|
95
|
-
klass = '.%s-' % @prefix + font_key
|
96
|
-
new_body.gsub!(%r{</head>}, template.result(binding) + "</head>")
|
97
97
|
end
|
98
|
+
new_body.gsub!(%r{</head>}, template.result(binding) + "</head>")
|
98
99
|
end
|
99
100
|
|
100
101
|
response.write new_body
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cjk-subsetter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hxgdzyuyi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|