gkh-fontcustom 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61c9dd42ef13b63af350912729b5fb688fde5ffe
4
- data.tar.gz: 88c91a34900c20d6b407c753bffcd35137de314d
3
+ metadata.gz: 055cc9dc89c2346d815f4771eb4893d073ebc55a
4
+ data.tar.gz: 5a146225fafc3bb7492178476b99ceead86e90ef
5
5
  SHA512:
6
- metadata.gz: 994a15d32c93f96cd34aaabda3004870d153653ac0218bf439d56556e5235097873adbdd5f97f093fd61d6d6899f2c9ff69c2ad8f348c8cd64a7e1588b6b6451
7
- data.tar.gz: dd68754f4ae309049b6f118d6382423b30d4f119d9bb3012cad35d0ad167d1388677b7d03d1e1734d7f228062d3b4a26fda47b98482c28b2897712295682f7b3
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! DEFAULT_OPTIONS[:font_name], @options[:font_name]
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 descent and descent. Used to calculate the baseline.
91
+ # The font's ascent and descent. Used to calculate the baseline.
92
92
  #font_ascent: 448
93
93
  #font_descent: 64
94
94
 
@@ -1,3 +1,3 @@
1
1
  module Fontcustom
2
- VERSION = "1.3.7"
2
+ VERSION = "1.3.8"
3
3
  end
@@ -48,7 +48,8 @@ module Fontcustom
48
48
  @listener.start
49
49
  else
50
50
  if listen_eq2
51
- @listener.start.join
51
+ @listener.start
52
+ sleep
52
53
  else
53
54
  @listener.start!
54
55
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gkh-fontcustom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kai Zau