gkh-fontcustom 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.travis.yml +20 -0
  4. data/CHANGELOG.md +137 -0
  5. data/CONTRIBUTING.md +50 -0
  6. data/Gemfile +4 -0
  7. data/LICENSES.txt +60 -0
  8. data/README.md +112 -0
  9. data/Rakefile +8 -0
  10. data/bin/fontcustom +5 -0
  11. data/fontcustom.gemspec +28 -0
  12. data/gemfiles/Gemfile.listen_1 +6 -0
  13. data/lib/fontcustom.rb +43 -0
  14. data/lib/fontcustom/base.rb +54 -0
  15. data/lib/fontcustom/cli.rb +110 -0
  16. data/lib/fontcustom/error.rb +4 -0
  17. data/lib/fontcustom/generator/font.rb +109 -0
  18. data/lib/fontcustom/generator/template.rb +222 -0
  19. data/lib/fontcustom/manifest.rb +75 -0
  20. data/lib/fontcustom/options.rb +192 -0
  21. data/lib/fontcustom/scripts/eotlitetool.py +466 -0
  22. data/lib/fontcustom/scripts/generate.py +128 -0
  23. data/lib/fontcustom/scripts/sfnt2woff +0 -0
  24. data/lib/fontcustom/templates/_fontcustom-rails.scss +14 -0
  25. data/lib/fontcustom/templates/_fontcustom.scss +16 -0
  26. data/lib/fontcustom/templates/fontcustom-preview.html +174 -0
  27. data/lib/fontcustom/templates/fontcustom.css +14 -0
  28. data/lib/fontcustom/templates/fontcustom.yml +96 -0
  29. data/lib/fontcustom/utility.rb +117 -0
  30. data/lib/fontcustom/version.rb +3 -0
  31. data/lib/fontcustom/watcher.rb +90 -0
  32. data/spec/fixtures/example/_example-rails.scss +50 -0
  33. data/spec/fixtures/example/example-preview.html +253 -0
  34. data/spec/fixtures/example/example.css +50 -0
  35. data/spec/fixtures/example/example.eot +0 -0
  36. data/spec/fixtures/example/example.svg +75 -0
  37. data/spec/fixtures/example/example.ttf +0 -0
  38. data/spec/fixtures/example/example.woff +0 -0
  39. data/spec/fixtures/generators/.fontcustom-manifest-corrupted.json +25 -0
  40. data/spec/fixtures/generators/.fontcustom-manifest-empty.json +0 -0
  41. data/spec/fixtures/generators/.fontcustom-manifest.json +52 -0
  42. data/spec/fixtures/generators/fontcustom.yml +1 -0
  43. data/spec/fixtures/generators/mixed-output/another-font.ttf +0 -0
  44. data/spec/fixtures/generators/mixed-output/dont-delete-me.bro +0 -0
  45. data/spec/fixtures/generators/mixed-output/fontcustom.css +108 -0
  46. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.eot +0 -0
  47. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.svg +56 -0
  48. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.ttf +0 -0
  49. data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.woff +0 -0
  50. data/spec/fixtures/options/any-file-name.yml +1 -0
  51. data/spec/fixtures/options/config-is-in-dir/fontcustom.yml +1 -0
  52. data/spec/fixtures/options/fontcustom-empty.yml +1 -0
  53. data/spec/fixtures/options/fontcustom-malformed.yml +1 -0
  54. data/spec/fixtures/options/fontcustom.yml +1 -0
  55. data/spec/fixtures/options/no-config-here/.gitkeep +0 -0
  56. data/spec/fixtures/options/rails-like/config/fontcustom.yml +1 -0
  57. data/spec/fixtures/shared/not-a-dir +0 -0
  58. data/spec/fixtures/shared/templates/custom.css +4 -0
  59. data/spec/fixtures/shared/templates/regular.css +4 -0
  60. data/spec/fixtures/shared/vectors-empty/no_vectors_here.txt +0 -0
  61. data/spec/fixtures/shared/vectors/C.svg +14 -0
  62. data/spec/fixtures/shared/vectors/D.svg +15 -0
  63. data/spec/fixtures/shared/vectors/a_R3ally-eXotic f1Le Name.svg +6 -0
  64. data/spec/fontcustom/base_spec.rb +45 -0
  65. data/spec/fontcustom/cli_spec.rb +30 -0
  66. data/spec/fontcustom/generator/font_spec.rb +72 -0
  67. data/spec/fontcustom/generator/template_spec.rb +99 -0
  68. data/spec/fontcustom/manifest_spec.rb +17 -0
  69. data/spec/fontcustom/options_spec.rb +315 -0
  70. data/spec/fontcustom/utility_spec.rb +82 -0
  71. data/spec/fontcustom/watcher_spec.rb +121 -0
  72. data/spec/spec_helper.rb +103 -0
  73. metadata +252 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 61c9dd42ef13b63af350912729b5fb688fde5ffe
4
+ data.tar.gz: 88c91a34900c20d6b407c753bffcd35137de314d
5
+ SHA512:
6
+ metadata.gz: 994a15d32c93f96cd34aaabda3004870d153653ac0218bf439d56556e5235097873adbdd5f97f093fd61d6d6899f2c9ff69c2ad8f348c8cd64a7e1588b6b6451
7
+ data.tar.gz: dd68754f4ae309049b6f118d6382423b30d4f119d9bb3012cad35d0ad167d1388677b7d03d1e1734d7f228062d3b4a26fda47b98482c28b2897712295682f7b3
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ spec/fixtures/sandbox/*
19
+ spec/fixtures/.fontcustom-manifest.json
20
+ .DS_Store
21
+ .ruby-version
@@ -0,0 +1,20 @@
1
+ language: ruby
2
+ before_install:
3
+ - sudo apt-get update -qq
4
+ - sudo apt-get install -qq fontforge
5
+ - wget http://people.mozilla.com/~jkew/woff/woff-code-latest.zip
6
+ - unzip woff-code-latest.zip -d sfnt2woff && cd sfnt2woff && make && sudo mv sfnt2woff /usr/local/bin/
7
+ - bundle
8
+ rvm:
9
+ - 2.1.1
10
+ - 2.0.0
11
+ - 1.9.3
12
+ - 1.9.2
13
+ gemfile:
14
+ - Gemfile
15
+ - gemfiles/Gemfile.listen_1
16
+ matrix:
17
+ exclude:
18
+ - gemfile: Gemfile
19
+ rvm: 1.9.2
20
+ script: bundle exec rake
@@ -0,0 +1,137 @@
1
+ ## 1.3.4 (10/11/2014)
2
+
3
+ * Updates rspec tests to be compatible with rspec v3.1.6
4
+ * Add additional metrics to make it easier to have different size icon fonts ([#175](https://github.com/FontCustom/fontcustom/pull/175))
5
+ * Add woff data uri to generated CSS + template helper ([#182](https://github.com/FontCustom/fontcustom/pull/182))
6
+ * Support listen v1 and v2 ([#191](https://github.com/FontCustom/fontcustom/pull/191))
7
+ * Add multiple classes to config file ([#174](https://github.com/FontCustom/fontcustom/issues/174))
8
+ * Don't strip "%" symbol (and other potentially valid characters) from CSS selector ([#173](https://github.com/FontCustom/fontcustom/issues/173))
9
+ * Fix bug where custom template path appears in output filenames ([#198](https://github.com/FontCustom/fontcustom/pull/198), [#172](https://github.com/FontCustom/fontcustom/issues/172))
10
+ * SCSS content variables like Font Awesome ([#151](https://github.com/FontCustom/fontcustom/issues/151))
11
+ * Running compile on a folder containing directories shouldn't throw an error
12
+
13
+ ## 1.3.3 (2/20/2014)
14
+
15
+ * Removes ttfautohint ([#160c](https://github.com/FontCustom/fontcustom/pull/160#issuecomment-34593191))
16
+ * Fixes rails-scss template helper ([#185](https://github.com/FontCustom/fontcustom/issues/185))
17
+ * Adds `text-rendering: optimizeLegibility` ([#181](https://github.com/FontCustom/fontcustom/pull/181))
18
+
19
+ ## 1.3.2 (1/31/2014)
20
+
21
+ * Fixes `preprocessor_path` for Rails asset pipeline / Sprockets ([#162](https://github.com/FontCustom/fontcustom/pull/162), [#167](https://github.com/FontCustom/fontcustom/pull/167))
22
+ * Fixes bug where `preprocessor_path` was ignored by the scss template ([#171](https://github.com/FontCustom/fontcustom/issues/171))
23
+ * Fixes bug where relative output paths containing ".." would fail to compile
24
+
25
+ ## 1.3.1 (12/28/2013)
26
+
27
+ * Fixes syntax error in generate.py that affects Python 2.6
28
+
29
+ ## 1.3.0 (12/24/2013)
30
+
31
+ **If upgrading from 1.2.0, delete your old `.fontcustom-manifest.json` and output directories first.**
32
+
33
+ The big news: fixed glyph code points. Automatically assigned for now, but changing them by hand is just a matter of modifying the generated `.fontcustom-manifest.json`. A few breaking changes (`css_prefix`, custom template syntax, possibly others).
34
+
35
+ * Adds fixed glyph code points ([#56](https://github.com/FontCustom/fontcustom/issues/56))
36
+ * Drops bootstrap templates (maintenance overhead, unsure if anyone was using them)
37
+ * Stores relative paths for collaborative editing ([#149](https://github.com/FontCustom/fontcustom/pull/149))
38
+ * Changes `css_prefix` to `css_selector` to allow greater flexibility ([#126](https://github.com/FontCustom/fontcustom/pull/126))
39
+ * Skips compilation if inputs have not changed (and `force` option to bypass checks)
40
+ * Adds CSS template helpers for convenience and DRYness
41
+ * Improves rendering on Chrome Windows ([#143](https://github.com/FontCustom/fontcustom/pull/143))
42
+ * Improves Windows hinting ([#160](https://github.com/FontCustom/fontcustom/pull/160))
43
+ * Fixes Python 2.6 optsparse syntax ([#159](https://github.com/FontCustom/fontcustom/issues/159))
44
+ * Fixes bug where changes in custom templates were not detected by `watch`
45
+ * Improves error and debuggging messages
46
+
47
+ ## 1.2.0 (11/2/2013)
48
+
49
+ * Preparation for fixed glyph code points.
50
+ * Tweaks command line options (more semantic aliases)
51
+ * Renames :data_cache to :manifest
52
+ * Sets the stage for a more streamlined, predictable workflow
53
+ * Drops EPS support (was buggy and unused)
54
+ * Turns glyph width adjustment into an option (off by default) ([#137](https://github.com/FontCustom/fontcustom/pull/137))
55
+ * Relaxes all dependency version requirements ([#127](https://github.com/FontCustom/fontcustom/issues/127))
56
+
57
+ ## 1.1.1 (10/16/2013)
58
+
59
+ * Preview characters are turned off by default in the preview template.
60
+ * Relaxes JSON version requirement ([#125](https://github.com/FontCustom/fontcustom/pull/125))
61
+ * Fixes ttf hinting ([#124](https://github.com/FontCustom/fontcustom/pull/124))
62
+ * Cleans up README, fontcustom.yml template, .gitignore ([#123](https://github.com/FontCustom/fontcustom/pull/123), [#128](https://github.com/FontCustom/fontcustom/pull/128))
63
+
64
+ ## 1.1.0 (9/22/2013)
65
+
66
+ More customizable interface for vastly improved workflow.
67
+
68
+ * Specify where input vectors/templates are stored ([#89](https://github.com/FontCustom/fontcustom/issues/89))
69
+ * Specify where output fonts/templates are saved ([#89](https://github.com/FontCustom/fontcustom/issues/89))
70
+ * Stock templates are saved as `#{font_name}.css` instead of `_fontcustom.css`
71
+ * More robust path handling (relative paths, customizable `project_root`)
72
+ * User-friendly variables for usage in custom templates
73
+ * Rails-friendly template
74
+ * Enable HTML data-attributes usage ([#118](https://github.com/FontCustom/fontcustom/pull/118))
75
+ * Helper characters in preview ([#107](https://github.com/FontCustom/fontcustom/pull/107))
76
+ * More robust execution of fontforge command ([#114](https://github.com/FontCustom/fontcustom/pull/114))
77
+ * Allow captial letters in font names ([#92](https://github.com/FontCustom/fontcustom/issues/92))
78
+ * More helpful, colorful messages
79
+ * More intuitive flags (`--verbose=false` => `--quiet`, `--file-hash=false` => `--no-hash`)
80
+ * More intuitive version (`fontcustom version` => `fontcustom --version`) ([#115](https://github.com/FontCustom/fontcustom/issues/115))
81
+
82
+ ## 1.0.1 (7/21/2013)
83
+
84
+ Various bugfixes.
85
+
86
+ * Set glyph widths automatically ([#95](https://github.com/FontCustom/fontcustom/issues/95))
87
+ * Fixes Ruby 1.8.7 syntax error ([#94](https://github.com/FontCustom/fontcustom/issues/94))
88
+ * More robust fontforge error handling ([#99](https://github.com/FontCustom/fontcustom/issues/99))
89
+
90
+ ## 1.0.0 (4/18/2013)
91
+
92
+ Big changes, more flexibility, better workflow. Be sure to check out the [docs](http://fontcustom.com) to see how it all ties together.
93
+
94
+ * Improved preview html to show glyphs at various sizes
95
+ * Added support for fontcustom.yml config file ([#49](https://github.com/FontCustom/fontcustom/issues/49))
96
+ * Added support for .fontcustom-data file ([#55](https://github.com/FontCustom/fontcustom/pull/55))
97
+ * Added support for custom templates ([#39](https://github.com/FontCustom/fontcustom/pull/39), [#48](https://github.com/FontCustom/fontcustom/issues/48))
98
+ * Added support for custom CSS selector namespaces ([#32](https://github.com/FontCustom/fontcustom/issues/32))
99
+ * Added support for --verbose=false ([#54](https://github.com/FontCustom/fontcustom/pull/54))
100
+ * Improved ascent/decent heights ([#33](https://github.com/FontCustom/fontcustom/issues/33))
101
+ * Added clean Ruby API ([#62](https://github.com/FontCustom/fontcustom/issues/62))
102
+ * Workaround for Sprockets compatibility ([#61](https://github.com/FontCustom/fontcustom/pull/61))
103
+ * Added clean (bootstrap free) CSS and made it the default choice ([#59](https://github.com/FontCustom/fontcustom/pull/59))
104
+ * Added option to pass different path to @font-face for SCSS partials ([#64](https://github.com/FontCustom/fontcustom/issues/64))
105
+ * Addes SCSS versions of Bootstrap and IE7 stylesheets
106
+ * Fixed CSS bug on IE8 and IE9's compatibility mode
107
+ * Fixed gem bug where watcher could fall into an infinite loop
108
+ * Added error messages for faulty input
109
+ * Refactored gem internals to use Thor more sanely
110
+ * Refactored tests
111
+
112
+ ## 0.1.4 (2/19/2013)
113
+
114
+ * Instructions for stopping watcher ([#46](https://github.com/FontCustom/fontcustom/issues/46))
115
+ * Dev/contribution instructions ([#45](https://github.com/FontCustom/fontcustom/issues/45))
116
+
117
+ ## 0.1.3 (2/2/2013)
118
+
119
+ * Add --debug CLI option, which shows fontforge output ([#37](https://github.com/FontCustom/fontcustom/issues/37))
120
+ * Patch for Illustrator CS6 SVG output ([#42](https://github.com/FontCustom/fontcustom/pull/42))
121
+ * Generate IE7 stylesheet ([#43](https://github.com/FontCustom/fontcustom/pull/43))
122
+ * Option to set custom font path for @font-face ([#43](https://github.com/FontCustom/fontcustom/pull/43))
123
+ * Option to generate test HTML file showing all glyphs ([#43](https://github.com/FontCustom/fontcustom/pull/43))
124
+ * Use eotlite.py instead of mkeot ([#43](https://github.com/FontCustom/fontcustom/pull/43))
125
+
126
+ ## 0.1.0 (12/2/2012)
127
+
128
+ * Changed API to use Thor `class_option`s
129
+ * Added option to change the name of the font and generated files ([#6](https://github.com/FontCustom/fontcustom/issues/6))
130
+ * Added option to disable the file name hash ([#13](https://github.com/FontCustom/fontcustom/issues/13))
131
+ * `fontcustom watch` compiles automatically on the first run
132
+ * Better help messages
133
+
134
+ ## 0.0.2 (11/26/2012)
135
+
136
+ * Fixed gemspec dependency bug ([#2](https://github.com/FontCustom/fontcustom/pull/2))
137
+ * Fixed Windows Chrome PUA bug ([#1](https://github.com/FontCustom/fontcustom/issues/1))
@@ -0,0 +1,50 @@
1
+ ## Help make Font Custom better!
2
+
3
+ This project was born out of an overheard conversation between two devs in a
4
+ NYC coffee shop — it's come a long ways thanks to your support. Here's what's
5
+ on the menu:
6
+
7
+ * **Ruby on Rails integration**
8
+ * **Compass integration**
9
+ * Templates for LESS, stylus, etc.
10
+ * Ligature support
11
+ * Windows support
12
+ * Make better use of Thor
13
+
14
+ Just [file an issue](https://github.com/FontCustom/fontcustom/issues) if you
15
+ have an idea or would like to claim one.
16
+
17
+ ### Rules of Thumb
18
+
19
+ If you catch a typo or a block of code that could be more elegant — please let
20
+ us know. No such thing as too small of an improvement.
21
+
22
+ * Spaces instead of tabs, please.
23
+ * Develop in a topic branch.
24
+ * Include passing tests if applicable.
25
+ * Follow the [Github ruby styleguide](https://github.com/styleguide/ruby) as
26
+ much as possible.
27
+
28
+ ### Getting Started
29
+
30
+ You'll need:
31
+
32
+ * Fontforge with Python scripting (easiest via [Homebrew](http://brew.sh/) on Mac)
33
+ * Ruby 1.9.2+ (via [rbenv](https://github.com/sstephenson/rbenv), [RVM](https://rvm.io/), etc.)
34
+ * Rubygems
35
+ * Bundler
36
+ * Rake
37
+ * Rspec
38
+
39
+ Some helpful links:
40
+
41
+ * http://createdbypete.com/articles/ruby-on-rails-development-with-mac-os-x-mountain-lion/
42
+ * http://guides.rubygems.org/make-your-own-gem/
43
+
44
+ ---
45
+
46
+ That's all there is to it. Thanks again, and please don't hesitate to reach out:
47
+
48
+ [Github Issues](https://github.com/FontCustom/fontcustom/issues)<br>
49
+ [@kaizau](https://twitter.com/kaizau)<br>
50
+ [@endtwist](https://twitter.com/endtwist)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fontcustom.gemspec
4
+ gemspec
@@ -0,0 +1,60 @@
1
+ fontcustom
2
+
3
+ Copyright (c) 2013 Kai Zau, Joshua Gross
4
+
5
+ MIT License
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining
8
+ a copy of this software and associated documentation files (the
9
+ "Software"), to deal in the Software without restriction, including
10
+ without limitation the rights to use, copy, modify, merge, publish,
11
+ distribute, sublicense, and/or sell copies of the Software, and to
12
+ permit persons to whom the Software is furnished to do so, subject to
13
+ the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be
16
+ included in all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+
26
+
27
+ sfnt2woff
28
+
29
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
30
+
31
+ The contents of this file are subject to the Mozilla Public License Version
32
+ 1.1 (the "License"); you may not use this file except in compliance with
33
+ the License. You may obtain a copy of the License at
34
+ http://www.mozilla.org/MPL/
35
+
36
+ Software distributed under the License is distributed on an "AS IS" basis,
37
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
38
+ for the specific language governing rights and limitations under the
39
+ License.
40
+
41
+ The Original Code is WOFF font packaging code.
42
+
43
+ The Initial Developer of the Original Code is Mozilla Corporation.
44
+ Portions created by the Initial Developer are Copyright (C) 2009
45
+ the Initial Developer. All Rights Reserved.
46
+
47
+ Contributor(s):
48
+ Jonathan Kew <jfkthame@gmail.com>
49
+
50
+ Alternatively, the contents of this file may be used under the terms of
51
+ either the GNU General Public License Version 2 or later (the "GPL"), or
52
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
53
+ in which case the provisions of the GPL or the LGPL are applicable instead
54
+ of those above. If you wish to allow use of your version of this file only
55
+ under the terms of either the GPL or the LGPL, and not to allow others to
56
+ use your version of this file under the terms of the MPL, indicate your
57
+ decision by deleting the provisions above and replace them with the notice
58
+ and other provisions required by the GPL or the LGPL. If you do not delete
59
+ the provisions above, a recipient may use your version of this file under
60
+ the terms of any one of the MPL, the GPL or the LGPL.
@@ -0,0 +1,112 @@
1
+ [![Gem Version](https://badge.fury.io/rb/fontcustom.png)](http://badge.fury.io/rb/fontcustom)
2
+ [![Build Status](https://api.travis-ci.org/FontCustom/fontcustom.png)](https://travis-ci.org/FontCustom/fontcustom)
3
+ [![Code Quality](https://codeclimate.com/github/FontCustom/fontcustom.png)](https://codeclimate.com/github/FontCustom/fontcustom) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=32953)](https://www.bountysource.com/trackers/32953-endtwist-fontcustom?utm_source=32953&utm_medium=shield&utm_campaign=TRACKER_BADGE)
4
+
5
+ ## Font Custom
6
+
7
+ **Icon fonts from the command line.**
8
+
9
+ Generate cross-browser icon fonts and supporting files (@font-face CSS, etc.)
10
+ from a collection of SVGs
11
+ ([example](https://rawgit.com/FontCustom/fontcustom/master/spec/fixtures/example/example-preview.html)).
12
+
13
+ [Changelog](https://github.com/FontCustom/fontcustom/blob/master/CHANGELOG.md)<br>
14
+ [Bugs/Support](https://github.com/FontCustom/fontcustom/issues)<br>
15
+ [Contribute!](https://github.com/FontCustom/fontcustom/blob/master/CONTRIBUTING.md)
16
+
17
+ ### Installation
18
+
19
+ Requires **Ruby 1.9.2+**, **FontForge** with Python scripting.
20
+
21
+ ```sh
22
+ # On Mac
23
+ brew install fontforge --with-python
24
+ brew install eot-utils
25
+ gem install fontcustom
26
+
27
+ # On Linux
28
+ sudo apt-get install fontforge
29
+ wget http://people.mozilla.com/~jkew/woff/woff-code-latest.zip
30
+ unzip woff-code-latest.zip -d sfnt2woff && cd sfnt2woff && make && sudo mv sfnt2woff /usr/local/bin/
31
+ gem install fontcustom
32
+ ```
33
+
34
+ ### Quick Start
35
+
36
+ ```sh
37
+ fontcustom compile my/vectors # Compiles icons into `fontcustom/`
38
+ fontcustom watch my/vectors # Compiles when vectors are changed/added/removed
39
+ fontcustom compile # Uses options from `./fontcustom.yml` or `config/fontcustom.yml`
40
+ fontcustom config # Generate a blank a config file
41
+ fontcustom help # See all options
42
+ ```
43
+
44
+ ### Configuration
45
+
46
+ To manage settings between compiles, run `fontcustom config` to generate a
47
+ config file. Inside, you'll find a list of [**all possible options**](https://github.com/FontCustom/fontcustom/blob/master/lib/fontcustom/templates/fontcustom.yml).
48
+ Each option is also available as a dash-case command line flag (e.g.
49
+ `--css-selector`) that overrides the config file.
50
+
51
+ ### SVG Guidelines
52
+
53
+ * All colors will be rendered identically. Watch out for white fills!
54
+ * Use only solid colors. SVGs with transparency will be skipped.
55
+ * For greater precision in curved icons, use fills instead strokes and [try
56
+ these solutions](https://github.com/FontCustom/fontcustom/issues/85).
57
+ * Activating `autowidth` trims horizontal white space from each glyph. This
58
+ can be much easier than centering dozens of SVGs by hand.
59
+
60
+ ### Advanced
61
+
62
+ **For use with Compass and/or Rails**
63
+
64
+ Set `templates` to include `scss-rails` to generate a SCSS partial with the
65
+ compatible font-url() helper. You'll most likely also need to set
66
+ `preprocessor_path` as the relative path from your compiled CSS to your output
67
+ directory.
68
+
69
+ **Save CSS and fonts to different locations**
70
+
71
+ You can save generated fonts, CSS, and other files to different locations by
72
+ using `fontcustom.yml`. Font Custom can also read input vectors and templates
73
+ from different places.
74
+
75
+ Just edit the `input` and `output` YAML hashes and their corresponding keys.
76
+
77
+ **Tweak font settings**
78
+
79
+ By default, Font Custom assumes a square viewBox, 512 by 512, and 16 pica
80
+ points. Change `font_design_size`, `font_em`, `font_ascent`, `font_descent`,
81
+ and `autowidth` to suit your own needs.
82
+
83
+ **Generate LESS, Stylus, and other text files**
84
+
85
+ Custom templates give you the flexibility to generate just about anything you
86
+ want with Font Custom's output data.
87
+
88
+ Any non-SVG file in your input directory (or input:templates directory if you
89
+ set it in `fontcustom.yml`) will be available as a custom template to copy into
90
+ the output directory after compilation. You just need to specify the file name
91
+ under the `templates` hash.
92
+
93
+ Any embedded ruby in the templates will be processed, along with the following
94
+ helpers:
95
+
96
+ * `font_name`
97
+ * `font_face`: [FontSpring's Bulletproof @Font-Face Syntax](http://www.fontspring.com/blog/further-hardening-of-the-bulletproof-syntax)
98
+ * `glyph_selectors`: comma-separated list of all icon CSS selectors
99
+ * `glyphs`: all selectors and their codepoint assignments (`.icon-example:before { content: "\f103"; }`)
100
+ * `@options`: a hash of options used during compilation
101
+ * `@manifest`: a hash of options, generated file paths, code points, and just about everything else Font Custom knows.
102
+ * `@font_path`: the path from CSS to font files (without an extension)
103
+ * `@font_path_alt`: if `preprocessor_path` was set, this is the modified path
104
+
105
+ `font_face` accepts a hash that modifies the CSS url() function and the path of
106
+ the font files (`font_face(url: "font-url", path: @font_path_alt)`).
107
+
108
+ ---
109
+
110
+ [Licenses](https://github.com/FontCustom/fontcustom/blob/master/LICENSES.txt)
111
+
112
+ Brought to you by [@endtwist](https://github.com/endtwist) and [@kaizau](https://github.com/kaizau)
@@ -0,0 +1,8 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new "spec" do |s|
5
+ s.rspec_opts = "--color --format documentation"
6
+ end
7
+
8
+ task :default => :spec
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fontcustom/cli'
4
+
5
+ Fontcustom::CLI.start(ARGV)
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "fontcustom/version"
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "gkh-fontcustom"
8
+ gem.version = Fontcustom::VERSION
9
+ gem.authors = ["Kai Zau", "Joshua Gross"]
10
+ gem.email = ["kai@kaizau.com", "joshua@gross.is"]
11
+ gem.summary = "Generate icon fonts from the command line."
12
+ gem.description = "Font Custom makes using vector icons easy. Generate icon fonts and supporting templates (e.g. @font-face CSS) from a collection of SVGs."
13
+ gem.homepage = "http://fontcustom.com"
14
+ gem.post_install_message = ">> Thanks for installing Font Custom! Please ensure that fontforge is installed before compiling any icons. Visit <http://fontcustom.com> for instructions."
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+
21
+ gem.add_dependency "json", "~>1.4"
22
+ gem.add_dependency "thor", "~>0.14"
23
+ gem.add_dependency "listen", ">=1.0","<3.0"
24
+
25
+ gem.add_development_dependency "rake"
26
+ gem.add_development_dependency "bundler"
27
+ gem.add_development_dependency "rspec", "~>3.1.0"
28
+ end