gkh-fontcustom 1.3.7 → 1.3.8
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/lib/fontcustom/generator/template.rb +1 -1
- data/lib/fontcustom/scripts/generate.py +4 -0
- data/lib/fontcustom/templates/fontcustom.yml +1 -1
- data/lib/fontcustom/version.rb +1 -1
- data/lib/fontcustom/watcher.rb +2 -1
- data/spec/fontcustom/generator/template_spec.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 055cc9dc89c2346d815f4771eb4893d073ebc55a
|
4
|
+
data.tar.gz: 5a146225fafc3bb7492178476b99ceead86e90ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30c728f379faa25c26db629cf93e91fbd28336d2abb8fd8fc17330c29e4dd0a98aa9c1253b0f25992cd5844df3e1149bfb38a97b741c59d9807b3fbd0d6b498e
|
7
|
+
data.tar.gz: 024f862716841f23d4a2abd9813fce9f587910efd61bcad5cf4c940f0ea8a3c4802a8fb285bae106cd97c9855201021c100ee14a6192bec1e8e4d1db55ea9ed0
|
@@ -100,7 +100,7 @@ module Fontcustom
|
|
100
100
|
end
|
101
101
|
|
102
102
|
if packaged.include?(base) && @options[:font_name] != DEFAULT_OPTIONS[:font_name]
|
103
|
-
target.sub
|
103
|
+
target = File.join(File.dirname(target), File.basename(target).sub(DEFAULT_OPTIONS[:font_name], @options[:font_name]))
|
104
104
|
end
|
105
105
|
|
106
106
|
target
|
@@ -79,6 +79,10 @@ def createGlyph( name, source, code ):
|
|
79
79
|
glyph.left_side_bearing = glyph.left_side_bearing - shift
|
80
80
|
glyph.right_side_bearing = glyph.right_side_bearing + shift
|
81
81
|
|
82
|
+
# Add valid space glyph to avoid "unknown character" box on IE11
|
83
|
+
glyph = font.createChar(32)
|
84
|
+
glyph.width = 200
|
85
|
+
|
82
86
|
for glyph, data in manifest['glyphs'].iteritems():
|
83
87
|
name = createGlyph(glyph, data['source'], data['codepoint'])
|
84
88
|
|
@@ -88,7 +88,7 @@
|
|
88
88
|
# The em size. Setting this will scale the entire font to the given size.
|
89
89
|
#font_em: 512
|
90
90
|
|
91
|
-
# The font's
|
91
|
+
# The font's ascent and descent. Used to calculate the baseline.
|
92
92
|
#font_ascent: 448
|
93
93
|
#font_descent: 64
|
94
94
|
|
data/lib/fontcustom/version.rb
CHANGED
data/lib/fontcustom/watcher.rb
CHANGED
@@ -96,4 +96,21 @@ describe Fontcustom::Generator::Template do
|
|
96
96
|
expect(gen.send(:font_face)).to match("x-font-woff")
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
context ".get_target_path" do
|
101
|
+
it "should generate the correct preview target when using default font_name" do
|
102
|
+
gen = Fontcustom::Generator::Template.new fixture("generators/.fontcustom-manifest.json")
|
103
|
+
options = gen.instance_variable_get :@options
|
104
|
+
options[:output] = {:fonts => fixture("sandbox/test/fonts"), :preview => fixture("sandbox/test")}
|
105
|
+
expect(gen.send(:get_target_path, "sandbox/test/fontcustom-preview.html")).to match("/sandbox/test/fontcustom-preview.html")
|
106
|
+
end
|
107
|
+
it "should generate the correct preview target when using custom font_name with output directory containing 'fontcustom'" do
|
108
|
+
gen = Fontcustom::Generator::Template.new fixture("generators/.fontcustom-manifest.json")
|
109
|
+
options = gen.instance_variable_get :@options
|
110
|
+
options[:font_name] = 'custom'
|
111
|
+
options[:output] = {:fonts => fixture("sandbox/test-fontcustom/fonts"), :preview => fixture("sandbox/test-fontcustom")}
|
112
|
+
expect(gen.send(:get_target_path, "sandbox/test/fontcustom-preview.html")).to match("/sandbox/test-fontcustom/custom-preview.html")
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
99
116
|
end
|