fontcustom 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSES.txt CHANGED
@@ -24,12 +24,6 @@ fontcustom
24
24
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
25
 
26
26
 
27
- ttf2eot
28
-
29
- Author: taviso@sdf.lonestar.org 15-Mar-2009
30
- License: Derived from WebKit, so BSD/LGPL 2/LGPL 2.1.
31
-
32
-
33
27
  sfnt2woff
34
28
 
35
29
  Version: MPL 1.1/GPL 2.0/LGPL 2.1
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- FontCustom v0.0.2
1
+ FontCustom v0.1.1
2
2
  ==========
3
3
 
4
4
  **Generate custom icon webfonts from the comfort of the command line.**
@@ -12,7 +12,7 @@ Installation
12
12
 
13
13
  ```sh
14
14
  # Requires FontForge
15
- brew install fontforge
15
+ brew install fontforge eot-utils ttfautohint
16
16
  gem install fontcustom
17
17
  ```
18
18
 
@@ -3,7 +3,7 @@ import os
3
3
  import argparse
4
4
  import md5
5
5
  import json
6
- from subprocess import call
6
+ import subprocess
7
7
 
8
8
  parser = argparse.ArgumentParser(description='Convert a directory of svg and eps files into a unified font file.')
9
9
  parser.add_argument('dir', metavar='directory', type=unicode, nargs=2, help='directory of vector files')
@@ -53,7 +53,8 @@ f.fullname = args.name
53
53
  f.generate(fontfile + '.ttf')
54
54
  f.generate(fontfile + '.svg')
55
55
 
56
- # Fix SVG header for webkit (from: https://github.com/fontello/font-builder/blob/master/bin/fontconvert.py)
56
+ # Fix SVG header for webkit
57
+ # from: https://github.com/fontello/font-builder/blob/master/bin/fontconvert.py
57
58
  svgfile = open(fontfile + '.svg', 'r+')
58
59
  svgtext = svgfile.read()
59
60
  svgfile.seek(0)
@@ -61,8 +62,15 @@ svgfile.write(svgtext.replace('''<svg>''', '''<svg xmlns="http://www.w3.org/2000
61
62
  svgfile.close()
62
63
 
63
64
  scriptPath = os.path.dirname(os.path.realpath(__file__))
64
- call([scriptPath + '/sfnt2woff', fontfile + '.ttf'])
65
- call(scriptPath + '/ttf2eot ' + fontfile + '.ttf > ' + fontfile + '.eot', shell=True)
65
+ try:
66
+ subprocess.Popen([scriptPath + '/sfnt2woff', fontfile + '.ttf'], stdout=subprocess.PIPE)
67
+ except OSError:
68
+ # If the local version of sfnt2woff fails (i.e., on Linux), try to use the
69
+ # global version. This allows us to avoid forcing OS X users to compile
70
+ # sfnt2woff from source, simplifying install.
71
+ subprocess.call(['sfnt2woff', fontfile + '.ttf'])
72
+
73
+ subprocess.call('mkeot ' + fontfile + '.ttf > ' + fontfile + '.eot', shell=True)
66
74
 
67
75
  # Hint the TTF file
68
- call(scriptPath + '/ttfautohint -s -n ' + fontfile + '.ttf ' + fontfile + '-hinted.ttf && mv ' + fontfile + '-hinted.ttf ' + fontfile + '.ttf', shell=True)
76
+ subprocess.call('ttfautohint -s -n ' + fontfile + '.ttf ' + fontfile + '-hinted.ttf > /dev/null 2>&1 && mv ' + fontfile + '-hinted.ttf ' + fontfile + '.ttf', shell=True)
@@ -1,3 +1,3 @@
1
1
  module Fontcustom
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontcustom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-03 00:00:00.000000000 Z
13
+ date: 2012-12-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -212,8 +212,6 @@ files:
212
212
  - lib/fontcustom/generator.rb
213
213
  - lib/fontcustom/scripts/generate.py
214
214
  - lib/fontcustom/scripts/sfnt2woff
215
- - lib/fontcustom/scripts/ttf2eot
216
- - lib/fontcustom/scripts/ttfautohint
217
215
  - lib/fontcustom/templates/fontcustom.css
218
216
  - lib/fontcustom/version.rb
219
217
  - lib/fontcustom/watcher.rb
@@ -237,18 +235,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
237
235
  - - ! '>='
238
236
  - !ruby/object:Gem::Version
239
237
  version: '0'
240
- segments:
241
- - 0
242
- hash: 4274866861207866495
243
238
  required_rubygems_version: !ruby/object:Gem::Requirement
244
239
  none: false
245
240
  requirements:
246
241
  - - ! '>='
247
242
  - !ruby/object:Gem::Version
248
243
  version: '0'
249
- segments:
250
- - 0
251
- hash: 4274866861207866495
252
244
  requirements: []
253
245
  rubyforge_project:
254
246
  rubygems_version: 1.8.24
Binary file
Binary file