gkh-fontcustom 1.3.7
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 +7 -0
- data/.gitignore +21 -0
- data/.travis.yml +20 -0
- data/CHANGELOG.md +137 -0
- data/CONTRIBUTING.md +50 -0
- data/Gemfile +4 -0
- data/LICENSES.txt +60 -0
- data/README.md +112 -0
- data/Rakefile +8 -0
- data/bin/fontcustom +5 -0
- data/fontcustom.gemspec +28 -0
- data/gemfiles/Gemfile.listen_1 +6 -0
- data/lib/fontcustom.rb +43 -0
- data/lib/fontcustom/base.rb +54 -0
- data/lib/fontcustom/cli.rb +110 -0
- data/lib/fontcustom/error.rb +4 -0
- data/lib/fontcustom/generator/font.rb +109 -0
- data/lib/fontcustom/generator/template.rb +222 -0
- data/lib/fontcustom/manifest.rb +75 -0
- data/lib/fontcustom/options.rb +192 -0
- data/lib/fontcustom/scripts/eotlitetool.py +466 -0
- data/lib/fontcustom/scripts/generate.py +128 -0
- data/lib/fontcustom/scripts/sfnt2woff +0 -0
- data/lib/fontcustom/templates/_fontcustom-rails.scss +14 -0
- data/lib/fontcustom/templates/_fontcustom.scss +16 -0
- data/lib/fontcustom/templates/fontcustom-preview.html +174 -0
- data/lib/fontcustom/templates/fontcustom.css +14 -0
- data/lib/fontcustom/templates/fontcustom.yml +96 -0
- data/lib/fontcustom/utility.rb +117 -0
- data/lib/fontcustom/version.rb +3 -0
- data/lib/fontcustom/watcher.rb +90 -0
- data/spec/fixtures/example/_example-rails.scss +50 -0
- data/spec/fixtures/example/example-preview.html +253 -0
- data/spec/fixtures/example/example.css +50 -0
- data/spec/fixtures/example/example.eot +0 -0
- data/spec/fixtures/example/example.svg +75 -0
- data/spec/fixtures/example/example.ttf +0 -0
- data/spec/fixtures/example/example.woff +0 -0
- data/spec/fixtures/generators/.fontcustom-manifest-corrupted.json +25 -0
- data/spec/fixtures/generators/.fontcustom-manifest-empty.json +0 -0
- data/spec/fixtures/generators/.fontcustom-manifest.json +52 -0
- data/spec/fixtures/generators/fontcustom.yml +1 -0
- data/spec/fixtures/generators/mixed-output/another-font.ttf +0 -0
- data/spec/fixtures/generators/mixed-output/dont-delete-me.bro +0 -0
- data/spec/fixtures/generators/mixed-output/fontcustom.css +108 -0
- data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.eot +0 -0
- data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.svg +56 -0
- data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.ttf +0 -0
- data/spec/fixtures/generators/mixed-output/fontcustom_82a59e769bc60192484f2620570bbb59.woff +0 -0
- data/spec/fixtures/options/any-file-name.yml +1 -0
- data/spec/fixtures/options/config-is-in-dir/fontcustom.yml +1 -0
- data/spec/fixtures/options/fontcustom-empty.yml +1 -0
- data/spec/fixtures/options/fontcustom-malformed.yml +1 -0
- data/spec/fixtures/options/fontcustom.yml +1 -0
- data/spec/fixtures/options/no-config-here/.gitkeep +0 -0
- data/spec/fixtures/options/rails-like/config/fontcustom.yml +1 -0
- data/spec/fixtures/shared/not-a-dir +0 -0
- data/spec/fixtures/shared/templates/custom.css +4 -0
- data/spec/fixtures/shared/templates/regular.css +4 -0
- data/spec/fixtures/shared/vectors-empty/no_vectors_here.txt +0 -0
- data/spec/fixtures/shared/vectors/C.svg +14 -0
- data/spec/fixtures/shared/vectors/D.svg +15 -0
- data/spec/fixtures/shared/vectors/a_R3ally-eXotic f1Le Name.svg +6 -0
- data/spec/fontcustom/base_spec.rb +45 -0
- data/spec/fontcustom/cli_spec.rb +30 -0
- data/spec/fontcustom/generator/font_spec.rb +72 -0
- data/spec/fontcustom/generator/template_spec.rb +99 -0
- data/spec/fontcustom/manifest_spec.rb +17 -0
- data/spec/fontcustom/options_spec.rb +315 -0
- data/spec/fontcustom/utility_spec.rb +82 -0
- data/spec/fontcustom/watcher_spec.rb +121 -0
- data/spec/spec_helper.rb +103 -0
- metadata +252 -0
@@ -0,0 +1,117 @@
|
|
1
|
+
require "json"
|
2
|
+
require "thor/actions"
|
3
|
+
require "thor/shell"
|
4
|
+
require "thor/shell/basic"
|
5
|
+
require "thor/shell/color"
|
6
|
+
|
7
|
+
# Requires access to:
|
8
|
+
# @options or @cli_options
|
9
|
+
# @manifest
|
10
|
+
module Fontcustom
|
11
|
+
module Utility
|
12
|
+
include Thor::Actions
|
13
|
+
|
14
|
+
#
|
15
|
+
# Hacks that allow Thor::Actions and Thor::Shell to be used in Fontcustom classes.
|
16
|
+
#
|
17
|
+
|
18
|
+
def self.shell
|
19
|
+
@shell || Thor::Shell::Color.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def shell
|
23
|
+
Fontcustom::Utility.shell
|
24
|
+
end
|
25
|
+
|
26
|
+
def behavior
|
27
|
+
:invoke
|
28
|
+
end
|
29
|
+
|
30
|
+
def say_status(*args)
|
31
|
+
shell.say_status *args
|
32
|
+
end
|
33
|
+
|
34
|
+
def destination_root
|
35
|
+
@destination_stack ||= [project_root]
|
36
|
+
@destination_stack.last
|
37
|
+
end
|
38
|
+
|
39
|
+
def source_paths
|
40
|
+
@source_paths ||= [File.join(Fontcustom.gem_lib, "templates"), Dir.pwd]
|
41
|
+
end
|
42
|
+
|
43
|
+
#
|
44
|
+
# Options
|
45
|
+
#
|
46
|
+
|
47
|
+
module HashWithMethodAccess
|
48
|
+
def method_missing(method, arg = nil)
|
49
|
+
if method[-1, 1] == "="
|
50
|
+
self[method[0...-1].to_sym] = arg
|
51
|
+
else
|
52
|
+
self[method.to_sym]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def symbolize_hash(hash)
|
58
|
+
hash.inject({}) { |memo, (k, v)| memo[k.to_sym] = v; memo }
|
59
|
+
end
|
60
|
+
|
61
|
+
def methodize_hash(hash)
|
62
|
+
hash.extend HashWithMethodAccess
|
63
|
+
end
|
64
|
+
|
65
|
+
#
|
66
|
+
# Paths
|
67
|
+
#
|
68
|
+
|
69
|
+
def project_root
|
70
|
+
if @manifest.is_a? String
|
71
|
+
File.dirname @manifest
|
72
|
+
else
|
73
|
+
File.dirname @manifest.manifest
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
#
|
78
|
+
# File Manipulation
|
79
|
+
#
|
80
|
+
|
81
|
+
def write_file(file, content = "", message = nil, message_body = nil)
|
82
|
+
File.open(file, "w") { |f| f.write(content) }
|
83
|
+
if message
|
84
|
+
body = message_body || file
|
85
|
+
say_message message, body
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
#
|
90
|
+
# Messages
|
91
|
+
#
|
92
|
+
|
93
|
+
def say_message(status, message, color = nil)
|
94
|
+
return if options[:quiet] && status != :error && status != :debug
|
95
|
+
color = :red if [:error, :debug, :warn].include?(status)
|
96
|
+
say_status status, message, color
|
97
|
+
end
|
98
|
+
|
99
|
+
def say_changed(status, changed)
|
100
|
+
return if options[:quiet] || ! options[:debug] && status == :delete
|
101
|
+
say_status status, changed.join(line_break)
|
102
|
+
end
|
103
|
+
|
104
|
+
# magic number for Thor say_status line breaks
|
105
|
+
def line_break(n = 14)
|
106
|
+
"\n#{" " * n}"
|
107
|
+
end
|
108
|
+
|
109
|
+
def options
|
110
|
+
if @data
|
111
|
+
@data[:options]
|
112
|
+
else
|
113
|
+
@options || @cli_options || @config_options || {}
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require "fontcustom"
|
2
|
+
require "listen"
|
3
|
+
|
4
|
+
module Fontcustom
|
5
|
+
class Watcher
|
6
|
+
include Utility
|
7
|
+
|
8
|
+
def initialize(options, is_test = false)
|
9
|
+
@base = Fontcustom::Base.new options
|
10
|
+
@options = @base.options
|
11
|
+
@is_test = is_test
|
12
|
+
|
13
|
+
templates = @options[:templates].dup.map { |template| File.basename(template) }
|
14
|
+
packaged = %w|preview css scss scss-rails|
|
15
|
+
templates.delete_if { |template| packaged.include?(template) }
|
16
|
+
|
17
|
+
create_listener(templates)
|
18
|
+
end
|
19
|
+
|
20
|
+
def watch
|
21
|
+
compile unless @options[:skip_first]
|
22
|
+
start
|
23
|
+
rescue SignalException # Catches Ctrl + C
|
24
|
+
stop
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def create_listener(templates)
|
30
|
+
listen_options = {}
|
31
|
+
listen_options[:polling_fallback_message] = false if @is_test
|
32
|
+
|
33
|
+
listen_dirs = [@options[:input][:vectors]]
|
34
|
+
listen_dirs << @options[:input][:templates] unless templates.empty?
|
35
|
+
|
36
|
+
if listen_eq2
|
37
|
+
listen_options[:only] = /(#{templates.join("|")}|.+\.svg)$/
|
38
|
+
@listener = Listen.to(listen_dirs, listen_options, &callback)
|
39
|
+
else
|
40
|
+
listen_options[:filter] = /(#{templates.join("|")}|.+\.svg)$/
|
41
|
+
listen_options[:relative_paths] = true
|
42
|
+
@listener = Listen::Listener.new(listen_dirs, listen_options, &callback)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def start
|
47
|
+
if @is_test # Non-blocking listener
|
48
|
+
@listener.start
|
49
|
+
else
|
50
|
+
if listen_eq2
|
51
|
+
@listener.start.join
|
52
|
+
else
|
53
|
+
@listener.start!
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def stop
|
59
|
+
@listener.stop
|
60
|
+
shell.say "\nFont Custom is signing off. Good night and good luck.", :yellow
|
61
|
+
end
|
62
|
+
|
63
|
+
def callback
|
64
|
+
Proc.new do |modified, added, removed|
|
65
|
+
begin
|
66
|
+
say_message :changed, modified.join(", ") unless modified.empty?
|
67
|
+
say_message :added, added.join(", ") unless added.empty?
|
68
|
+
say_message :removed, removed.join(", ") unless removed.empty?
|
69
|
+
changed = modified + added + removed
|
70
|
+
compile unless changed.empty?
|
71
|
+
rescue Fontcustom::Error => e
|
72
|
+
say_message :error, e.message
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def compile
|
78
|
+
@base.compile
|
79
|
+
end
|
80
|
+
|
81
|
+
def listen_eq2
|
82
|
+
begin
|
83
|
+
require 'listen/version'
|
84
|
+
::Listen::VERSION =~ /^2\./
|
85
|
+
rescue LoadError
|
86
|
+
false
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
//
|
2
|
+
// Icon Font: example
|
3
|
+
//
|
4
|
+
|
5
|
+
@font-face {
|
6
|
+
font-family: "example";
|
7
|
+
src: font-url("../foo/bar/example.eot?") format("embedded-opentype");
|
8
|
+
font-weight: normal;
|
9
|
+
font-style: normal;
|
10
|
+
}
|
11
|
+
|
12
|
+
@font-face {
|
13
|
+
font-family: "example";
|
14
|
+
src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAgAAA0AAAAAC4QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAH5AAAABkAAAAccaH0x09TLzIAAAGgAAAASgAAAGBAoF1jY21hcAAAAgAAAABCAAABQgAP9K1jdnQgAAACRAAAAAQAAAAEABEBRGdhc3AAAAfcAAAACAAAAAj//wADZ2x5ZgAAAlgAAAQzAAAF/Pd0+9ZoZWFkAAABMAAAAC8AAAA2Ak7J+WhoZWEAAAFgAAAAHQAAACQD1AH6aG10eAAAAewAAAAUAAAAFAYSAKVsb2NhAAACSAAAAA4AAAAOBHwC1m1heHAAAAGAAAAAIAAAACAAUwD/bmFtZQAABowAAAEdAAAB+O5hv99wb3N0AAAHrAAAAC0AAABG3Z3qEXjaY2BkYGAA4raDayfE89t8ZeBmYgCBC7OOLIPTgv+/Mr5k3A3kcjCApQFxtQ2QAHjaY2BkYGDc/f8rgx4TAwgwvmRgZEAFLABnMQPRAAAAAAEAAAAGAM4ACwAAAAAAAgAAAAEAAQAAAEAALgAAAAB42mNgYWJgnMDAysDA6MOYxsDA4A6lvzJIMrQwMDAxsHIyw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../foo/bar/example.ttf") format("truetype"),
|
16
|
+
font-url("../foo/bar/example.svg#example") format("svg");
|
17
|
+
font-weight: normal;
|
18
|
+
font-style: normal;
|
19
|
+
}
|
20
|
+
|
21
|
+
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
22
|
+
@font-face {
|
23
|
+
font-family: "example";
|
24
|
+
src: font-url("../foo/bar/example.svg#example") format("svg");
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
[data-icon]:before { content: attr(data-icon); }
|
29
|
+
|
30
|
+
[data-icon]:before,
|
31
|
+
.icon-C:before,
|
32
|
+
.icon-D:before,
|
33
|
+
.icon-a_R3ally-eXotic-f1Le-Name:before {
|
34
|
+
display: inline-block;
|
35
|
+
font-family: "example";
|
36
|
+
font-style: normal;
|
37
|
+
font-weight: normal;
|
38
|
+
font-variant: normal;
|
39
|
+
line-height: 1;
|
40
|
+
text-decoration: inherit;
|
41
|
+
text-rendering: optimizeLegibility;
|
42
|
+
text-transform: none;
|
43
|
+
-moz-osx-font-smoothing: grayscale;
|
44
|
+
-webkit-font-smoothing: antialiased;
|
45
|
+
font-smoothing: antialiased;
|
46
|
+
}
|
47
|
+
|
48
|
+
.icon-C:before { content: "\f100"; }
|
49
|
+
.icon-D:before { content: "\f101"; }
|
50
|
+
.icon-a_R3ally-eXotic-f1Le-Name:before { content: "\f102"; }
|
@@ -0,0 +1,253 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>example glyphs preview</title>
|
5
|
+
|
6
|
+
<style>
|
7
|
+
/* Page Styles */
|
8
|
+
|
9
|
+
* {
|
10
|
+
-moz-box-sizing: border-box;
|
11
|
+
-webkit-box-sizing: border-box;
|
12
|
+
box-sizing: border-box;
|
13
|
+
margin: 0;
|
14
|
+
padding: 0;
|
15
|
+
}
|
16
|
+
|
17
|
+
body {
|
18
|
+
background: #fff;
|
19
|
+
color: #444;
|
20
|
+
font: 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
|
21
|
+
}
|
22
|
+
|
23
|
+
a,
|
24
|
+
a:visited {
|
25
|
+
color: #888;
|
26
|
+
text-decoration: underline;
|
27
|
+
}
|
28
|
+
a:hover,
|
29
|
+
a:focus { color: #000; }
|
30
|
+
|
31
|
+
header {
|
32
|
+
border-bottom: 2px solid #ddd;
|
33
|
+
margin-bottom: 20px;
|
34
|
+
overflow: hidden;
|
35
|
+
padding: 20px 0;
|
36
|
+
}
|
37
|
+
|
38
|
+
header h1 {
|
39
|
+
color: #888;
|
40
|
+
float: left;
|
41
|
+
font-size: 36px;
|
42
|
+
font-weight: 300;
|
43
|
+
}
|
44
|
+
|
45
|
+
header a {
|
46
|
+
float: right;
|
47
|
+
font-size: 14px;
|
48
|
+
}
|
49
|
+
|
50
|
+
.container {
|
51
|
+
margin: 0 auto;
|
52
|
+
max-width: 1200px;
|
53
|
+
min-width: 960px;
|
54
|
+
padding: 0 40px;
|
55
|
+
width: 90%;
|
56
|
+
}
|
57
|
+
|
58
|
+
.glyph {
|
59
|
+
border-bottom: 1px dotted #ccc;
|
60
|
+
padding: 10px 0 20px;
|
61
|
+
margin-bottom: 20px;
|
62
|
+
}
|
63
|
+
|
64
|
+
.preview-glyphs { vertical-align: bottom; }
|
65
|
+
|
66
|
+
.preview-scale {
|
67
|
+
color: #888;
|
68
|
+
font-size: 12px;
|
69
|
+
margin-top: 5px;
|
70
|
+
}
|
71
|
+
|
72
|
+
.step {
|
73
|
+
display: inline-block;
|
74
|
+
line-height: 1;
|
75
|
+
position: relative;
|
76
|
+
width: 10%;
|
77
|
+
}
|
78
|
+
|
79
|
+
.step .letters,
|
80
|
+
.step i {
|
81
|
+
-webkit-transition: opacity .3s;
|
82
|
+
-moz-transition: opacity .3s;
|
83
|
+
-ms-transition: opacity .3s;
|
84
|
+
-o-transition: opacity .3s;
|
85
|
+
transition: opacity .3s;
|
86
|
+
}
|
87
|
+
|
88
|
+
.step:hover .letters { opacity: 1; }
|
89
|
+
.step:hover i { opacity: .3; }
|
90
|
+
|
91
|
+
.letters {
|
92
|
+
opacity: .3;
|
93
|
+
position: absolute;
|
94
|
+
}
|
95
|
+
|
96
|
+
.characters-off .letters { display: none; }
|
97
|
+
.characters-off .step:hover i { opacity: 1; }
|
98
|
+
|
99
|
+
|
100
|
+
.size-12 { font-size: 12px; }
|
101
|
+
|
102
|
+
.size-14 { font-size: 14px; }
|
103
|
+
|
104
|
+
.size-16 { font-size: 16px; }
|
105
|
+
|
106
|
+
.size-18 { font-size: 18px; }
|
107
|
+
|
108
|
+
.size-21 { font-size: 21px; }
|
109
|
+
|
110
|
+
.size-24 { font-size: 24px; }
|
111
|
+
|
112
|
+
.size-36 { font-size: 36px; }
|
113
|
+
|
114
|
+
.size-48 { font-size: 48px; }
|
115
|
+
|
116
|
+
.size-60 { font-size: 60px; }
|
117
|
+
|
118
|
+
.size-72 { font-size: 72px; }
|
119
|
+
|
120
|
+
|
121
|
+
.usage { margin-top: 10px; }
|
122
|
+
|
123
|
+
.usage input {
|
124
|
+
font-family: monospace;
|
125
|
+
margin-right: 3px;
|
126
|
+
padding: 2px 5px;
|
127
|
+
text-align: center;
|
128
|
+
}
|
129
|
+
|
130
|
+
.usage .point { width: 150px; }
|
131
|
+
|
132
|
+
.usage .class { width: 250px; }
|
133
|
+
|
134
|
+
footer {
|
135
|
+
color: #888;
|
136
|
+
font-size: 12px;
|
137
|
+
padding: 20px 0;
|
138
|
+
}
|
139
|
+
|
140
|
+
/* Icon Font: example */
|
141
|
+
|
142
|
+
@font-face {
|
143
|
+
font-family: "example";
|
144
|
+
src: url("./example.eot?") format("embedded-opentype");
|
145
|
+
font-weight: normal;
|
146
|
+
font-style: normal;
|
147
|
+
}
|
148
|
+
|
149
|
+
@font-face {
|
150
|
+
font-family: "example";
|
151
|
+
src: url("data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAgAAA0AAAAAC4QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAH5AAA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u2xRIwo89WQov8ADu6qvgB42nWPwWrCQBRF72hUupHuup1CFwomTAbduKwQCu5cSJcdZIiBmIQxgv5UP6I/00/osr0Tx0UXBibvvJeXe+8AGOMTAtfnCSqwwAjvgXvkJnAfL/gKHHH+E3iAR/EceIiReOWmiB7YJd1fngW93gL3yB+B+5yeA0ecfwceQOI38BBjobFCzSQXOBTIsUfLjQl2mLJqZk8xx4y8huEGVnVzcUW+b+VkN5VapfOZXBt+sPQzOFCrJMOezaEpCRt2OU6cGnpgY/NTaQgZfSu6+eq4YTu/hI4SS57/eteZxgIxE6V837Ihq6s2q11upU6UXMrgTNKLOE1jn/F+vC07hyOv5uNIinrZpKs+CrbWHYu6kkqliVJK3pX6A9Z1SrEAAAB42mNgYgCD/wcYJIEUIwM6YAOLMjEyMTIzsrCX5mW6GRoYQGlDKG0EAMecCHIAAAAAAAAB//8AAnjaY2BgYGQAggs52VVgetaRZTAaAE0xB8sAAAA=") format("woff"),
|
152
|
+
url("./example.ttf") format("truetype"),
|
153
|
+
url("./example.svg#example") format("svg");
|
154
|
+
font-weight: normal;
|
155
|
+
font-style: normal;
|
156
|
+
}
|
157
|
+
|
158
|
+
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
159
|
+
@font-face {
|
160
|
+
font-family: "example";
|
161
|
+
src: url("./example.svg#example") format("svg");
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
[data-icon]:before { content: attr(data-icon); }
|
166
|
+
|
167
|
+
[data-icon]:before,
|
168
|
+
.icon-C:before,
|
169
|
+
.icon-D:before,
|
170
|
+
.icon-a_R3ally-eXotic-f1Le-Name:before {
|
171
|
+
display: inline-block;
|
172
|
+
font-family: "example";
|
173
|
+
font-style: normal;
|
174
|
+
font-weight: normal;
|
175
|
+
font-variant: normal;
|
176
|
+
line-height: 1;
|
177
|
+
text-decoration: inherit;
|
178
|
+
text-rendering: optimizeLegibility;
|
179
|
+
text-transform: none;
|
180
|
+
-moz-osx-font-smoothing: grayscale;
|
181
|
+
-webkit-font-smoothing: antialiased;
|
182
|
+
font-smoothing: antialiased;
|
183
|
+
}
|
184
|
+
|
185
|
+
.icon-C:before { content: "\f100"; }
|
186
|
+
.icon-D:before { content: "\f101"; }
|
187
|
+
.icon-a_R3ally-eXotic-f1Le-Name:before { content: "\f102"; }
|
188
|
+
</style>
|
189
|
+
|
190
|
+
<!--[if lte IE 8]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
|
191
|
+
|
192
|
+
<script>
|
193
|
+
function toggleCharacters() {
|
194
|
+
var body = document.getElementsByTagName('body')[0];
|
195
|
+
body.className = body.className === 'characters-off' ? '' : 'characters-off';
|
196
|
+
}
|
197
|
+
</script>
|
198
|
+
</head>
|
199
|
+
|
200
|
+
<body class="characters-off">
|
201
|
+
<div id="page" class="container">
|
202
|
+
<header>
|
203
|
+
<h1>example contains 3 glyphs:</h1>
|
204
|
+
<a onclick="toggleCharacters(); return false;" href="#">Toggle Preview Characters</a>
|
205
|
+
</header>
|
206
|
+
|
207
|
+
|
208
|
+
<div class="glyph">
|
209
|
+
<div class="preview-glyphs">
|
210
|
+
<span class="step size-12"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-14"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-16"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-18"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-21"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-24"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-36"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-48"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-60"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span><span class="step size-72"><span class="letters">Pp</span><i id="icon-C" class="icon-C"></i></span>
|
211
|
+
</div>
|
212
|
+
<div class="preview-scale">
|
213
|
+
<span class="step">12</span><span class="step">14</span><span class="step">16</span><span class="step">18</span><span class="step">21</span><span class="step">24</span><span class="step">36</span><span class="step">48</span><span class="step">60</span><span class="step">72</span>
|
214
|
+
</div>
|
215
|
+
<div class="usage">
|
216
|
+
<input class="class" type="text" readonly="readonly" onClick="this.select();" value=".icon-C" />
|
217
|
+
<input class="point" type="text" readonly="readonly" onClick="this.select();" value="&#xf100;" />
|
218
|
+
</div>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="glyph">
|
222
|
+
<div class="preview-glyphs">
|
223
|
+
<span class="step size-12"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-14"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-16"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-18"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-21"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-24"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-36"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-48"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-60"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span><span class="step size-72"><span class="letters">Pp</span><i id="icon-D" class="icon-D"></i></span>
|
224
|
+
</div>
|
225
|
+
<div class="preview-scale">
|
226
|
+
<span class="step">12</span><span class="step">14</span><span class="step">16</span><span class="step">18</span><span class="step">21</span><span class="step">24</span><span class="step">36</span><span class="step">48</span><span class="step">60</span><span class="step">72</span>
|
227
|
+
</div>
|
228
|
+
<div class="usage">
|
229
|
+
<input class="class" type="text" readonly="readonly" onClick="this.select();" value=".icon-D" />
|
230
|
+
<input class="point" type="text" readonly="readonly" onClick="this.select();" value="&#xf101;" />
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
<div class="glyph">
|
235
|
+
<div class="preview-glyphs">
|
236
|
+
<span class="step size-12"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-14"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-16"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-18"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-21"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-24"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-36"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-48"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-60"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span><span class="step size-72"><span class="letters">Pp</span><i id="icon-a_R3ally-eXotic-f1Le-Name" class="icon-a_R3ally-eXotic-f1Le-Name"></i></span>
|
237
|
+
</div>
|
238
|
+
<div class="preview-scale">
|
239
|
+
<span class="step">12</span><span class="step">14</span><span class="step">16</span><span class="step">18</span><span class="step">21</span><span class="step">24</span><span class="step">36</span><span class="step">48</span><span class="step">60</span><span class="step">72</span>
|
240
|
+
</div>
|
241
|
+
<div class="usage">
|
242
|
+
<input class="class" type="text" readonly="readonly" onClick="this.select();" value=".icon-a_R3ally-eXotic-f1Le-Name" />
|
243
|
+
<input class="point" type="text" readonly="readonly" onClick="this.select();" value="&#xf102;" />
|
244
|
+
</div>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
<footer>
|
249
|
+
Made with love using <a href="http://fontcustom.com">Font Custom</a>.
|
250
|
+
</footer>
|
251
|
+
</div>
|
252
|
+
</body>
|
253
|
+
</html>
|