compass-fontcustom 1.2.0 → 1.3.0
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/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/README.md +17 -14
- data/compass-fontcustom.gemspec +2 -2
- data/lib/compass/fontcustom.rb +14 -3
- data/lib/compass/fontcustom/compass.rb +11 -0
- data/lib/compass/fontcustom/font_importer.rb +8 -8
- data/lib/compass/fontcustom/glyph_map.rb +12 -16
- data/lib/compass/fontcustom/version.rb +1 -1
- data/test/unit/font_importer_test.rb +1 -0
- metadata +20 -20
- data/lib/compass/fontcustom/rails.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea8fcaf8c9cf900531ee2cac60cc449e8a00ede5
|
4
|
+
data.tar.gz: fbaa31bc881a18dd35e367311ffc77abe4d66e33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e1095302fad3596b4b5d8c5ed102888f3188375730fa93fc604f17f94412f09e58f6fb939071149a236ac64fd1a5a16f432ff245f170d0bff4b1477577ac868
|
7
|
+
data.tar.gz: 45ac78f054e80a76419ea92665a25141ce58f5669b0eae8a79e1446bb004b1d58de243697b7d018798095484ced1b13d1accaa299fe723125360f656c5cb50b2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
**1.3.0** Major release
|
4
|
+
|
5
|
+
- Bundles Fontcustom 1.3.0 -- #10
|
6
|
+
- Fixes an issue where fonts are not regenerated -- #11
|
7
|
+
- Adds Compass configuration option `fontcustom_input_paths` -- #12
|
8
|
+
- Adds Compass configuration option `fontcustom_fonts_path` -- #13
|
9
|
+
- Officially supporting Compass 1.0
|
10
|
+
|
3
11
|
**1.2.0** Major release
|
4
12
|
|
5
13
|
- Bundles Fontcustom 1.2.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -3,13 +3,14 @@
|
|
3
3
|
[](https://travis-ci.org/glaszig/compass-fontcustom)
|
4
4
|
[](http://badge.fury.io/rb/compass-fontcustom)
|
5
5
|
[](https://coveralls.io/r/glaszig/compass-fontcustom)
|
6
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
6
7
|
[](https://coderwall.com/glaszig)
|
7
8
|
|
8
9
|
This is my attempt of integrating [Font Custom](http://fontcustom.com) with [Compass](http://compass-style.org).
|
9
10
|
|
10
11
|
## Requirements
|
11
12
|
|
12
|
-
Made for ruby 1.9+. Tested on 1.9.3
|
13
|
+
Made for ruby 1.9+. Tested on 1.9.3, 2.0.0 and 2.1.3.
|
13
14
|
You'll need to have fontforge and the [WOFF font toolset](http://people.mozilla.com/~jkew/woff) installed as outlined in the Font Custom [installation instructions](http://fontcustom.com/#installation).
|
14
15
|
|
15
16
|
## Installation
|
@@ -26,6 +27,18 @@ And then execute:
|
|
26
27
|
|
27
28
|
$ bundle
|
28
29
|
|
30
|
+
## Configuration
|
31
|
+
|
32
|
+
Compass::Fontcustom adds the following configuration options to Compass.
|
33
|
+
Just add these to your project's `config/compass.rb`.
|
34
|
+
|
35
|
+
- `fontcustom_hash`
|
36
|
+
Enables/disables Fontcustom file name hashing.
|
37
|
+
- `fontcustom_input_paths`
|
38
|
+
Array of paths where to search for SVG files to build custom fonts from.
|
39
|
+
- `fontcustom_fonts_path`
|
40
|
+
Path to put generated font files in.
|
41
|
+
|
29
42
|
## Usage
|
30
43
|
|
31
44
|
Syntactically it works like Compass' sprites feature.
|
@@ -63,19 +76,6 @@ which will result into CSS along the lines of:
|
|
63
76
|
> Generated CSS class names will be normalized and reserved characters removed.
|
64
77
|
> That means if you have a glyph file name of `a_R3ally-eXotic f1Le+Name.svg` the generated class name will be `.icon-myfont-a_R3ally-eXotic-f1Le-Name`.
|
65
78
|
|
66
|
-
## Configuration options
|
67
|
-
|
68
|
-
### Filename hashing
|
69
|
-
|
70
|
-
You can choose to disable file name hashes if you're already using an asset pipeline which handles this for you:
|
71
|
-
Use the `fontcustom_hash` option in `config.rb`
|
72
|
-
|
73
|
-
```ruby
|
74
|
-
compass_config do |config|
|
75
|
-
config.fontcustom_hash = false
|
76
|
-
end
|
77
|
-
```
|
78
|
-
|
79
79
|
## Contributing
|
80
80
|
|
81
81
|
1. Fork it
|
@@ -89,3 +89,6 @@ end
|
|
89
89
|
[MIT](https://raw.github.com/glaszig/compass-fontcustom/master/LICENSE)
|
90
90
|
|
91
91
|
[](http://githalytics.com/glaszig/compass-fontcustom)
|
92
|
+
|
93
|
+
|
94
|
+
|
data/compass-fontcustom.gemspec
CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.required_ruby_version = '>= 1.9.3'
|
22
22
|
|
23
|
-
spec.add_dependency "compass"
|
24
|
-
spec.add_dependency "fontcustom", "~> 1.
|
23
|
+
spec.add_dependency "compass", "~> 1.0.1"
|
24
|
+
spec.add_dependency "fontcustom", "~> 1.3.3"
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.3"
|
27
27
|
spec.add_development_dependency "rake"
|
data/lib/compass/fontcustom.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "compass"
|
2
2
|
require "compass/fontcustom/version"
|
3
|
+
require "compass/fontcustom/compass"
|
3
4
|
require "compass/fontcustom/sass_extensions"
|
4
5
|
require "compass/fontcustom/glyph_map"
|
5
6
|
require "compass/fontcustom/font_importer"
|
@@ -15,8 +16,18 @@ module Compass
|
|
15
16
|
true
|
16
17
|
end
|
17
18
|
|
19
|
+
Compass::Configuration.add_configuration_property(:fontcustom_input_paths, "Array of paths where to search for SVG files to build custom fonts from") do
|
20
|
+
if defined? Rails
|
21
|
+
Rails.application.config.assets.paths
|
22
|
+
else
|
23
|
+
[Compass.configuration.images_path.to_s]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Compass::Configuration.add_configuration_property(:fontcustom_fonts_path, "Path to put generated font files in") do
|
28
|
+
Compass.configuration.fonts_path.to_s
|
29
|
+
end
|
30
|
+
|
18
31
|
Sass.load_paths << FontImporter.new
|
19
32
|
end
|
20
|
-
end
|
21
|
-
|
22
|
-
require "compass/fontcustom/rails" if defined?(Rails)
|
33
|
+
end
|
@@ -2,7 +2,7 @@ require 'erb'
|
|
2
2
|
require 'tempfile'
|
3
3
|
require 'fontcustom/error'
|
4
4
|
require 'fontcustom/options'
|
5
|
-
require 'fontcustom/
|
5
|
+
require 'fontcustom/utility'
|
6
6
|
require 'fontcustom/generator/font'
|
7
7
|
|
8
8
|
module Compass
|
@@ -55,21 +55,20 @@ module Compass
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def search_paths
|
58
|
-
|
58
|
+
Compass.configuration.fontcustom_input_paths.to_a
|
59
59
|
end
|
60
60
|
|
61
61
|
# Returns all glyph names inside the folder at `uri`.
|
62
62
|
# @param uri [String] the uri to glob files from
|
63
63
|
# @return [Array]
|
64
64
|
def glyph_names(uri)
|
65
|
-
|
66
|
-
search_paths.each { |p| files.concat Dir[File.join(p, uri)] }
|
65
|
+
images = files(uri).sort
|
67
66
|
|
68
|
-
if
|
67
|
+
if images.empty?
|
69
68
|
raise Compass::SpriteException, %Q{No glyph images were found matching "#{uri}" in the images path. Your current images path is: #{folder}}
|
70
69
|
end
|
71
70
|
|
72
|
-
|
71
|
+
images.map { |f| File.basename(f)[0..-5] }
|
73
72
|
end
|
74
73
|
|
75
74
|
# Returns `Sass::Engine` options with defaults
|
@@ -118,8 +117,9 @@ module Compass
|
|
118
117
|
# @param uri [String] the uri to glob files from
|
119
118
|
# @return [Array]
|
120
119
|
def files(uri)
|
121
|
-
[].tap do |
|
122
|
-
|
120
|
+
[].tap do |ary|
|
121
|
+
ary.concat Dir[uri]
|
122
|
+
search_paths.each { |p| ary.concat Dir[File.join p, uri] }
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fontcustom'
|
2
2
|
require 'compass/fontcustom/configurable'
|
3
|
+
require 'thor'
|
3
4
|
|
4
5
|
module Compass
|
5
6
|
module Fontcustom
|
@@ -38,17 +39,16 @@ module Compass
|
|
38
39
|
|
39
40
|
# Starts the Fontcustom font generator to write font files to disk.
|
40
41
|
def generate
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
42
|
+
args = self.class.config.generator_options || {}
|
43
|
+
args.merge!(
|
44
|
+
:input => path,
|
45
|
+
:output => output_dir,
|
46
|
+
:font_name => @name,
|
47
|
+
:no_hash => !Compass.configuration.fontcustom_hash,
|
48
|
+
:quiet => true,
|
49
|
+
:fonts => []
|
50
|
+
)
|
51
|
+
::Fontcustom::Base.new(args).compile
|
52
52
|
end
|
53
53
|
|
54
54
|
def filename
|
@@ -56,12 +56,8 @@ module Compass
|
|
56
56
|
File.basename file, File.extname(file)
|
57
57
|
end
|
58
58
|
|
59
|
-
def exists?
|
60
|
-
not glob.empty?
|
61
|
-
end
|
62
|
-
|
63
59
|
def output_dir
|
64
|
-
Compass.configuration.
|
60
|
+
Compass.configuration.fontcustom_fonts_path
|
65
61
|
end
|
66
62
|
|
67
63
|
def to_s
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass-fontcustom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glaszig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: compass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: fontcustom
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.3.3
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.3.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: Fontcustom for Compass
|
@@ -94,10 +94,10 @@ files:
|
|
94
94
|
- Rakefile
|
95
95
|
- compass-fontcustom.gemspec
|
96
96
|
- lib/compass/fontcustom.rb
|
97
|
+
- lib/compass/fontcustom/compass.rb
|
97
98
|
- lib/compass/fontcustom/configurable.rb
|
98
99
|
- lib/compass/fontcustom/font_importer.rb
|
99
100
|
- lib/compass/fontcustom/glyph_map.rb
|
100
|
-
- lib/compass/fontcustom/rails.rb
|
101
101
|
- lib/compass/fontcustom/sass_extensions.rb
|
102
102
|
- lib/compass/fontcustom/templates/stylesheet.scss.erb
|
103
103
|
- lib/compass/fontcustom/version.rb
|
@@ -119,17 +119,17 @@ require_paths:
|
|
119
119
|
- lib
|
120
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 1.9.3
|
125
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
126
|
requirements:
|
127
|
-
- -
|
127
|
+
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
131
|
rubyforge_project:
|
132
|
-
rubygems_version: 2.
|
132
|
+
rubygems_version: 2.2.2
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Integrates Fontcustom with Compass
|