font-stacks 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ # 1.0.0
2
+
3
+ * Initial version ready for development and testing (likely to be solid enough for 1.0.0)
@@ -0,0 +1,9 @@
1
+ require 'compass'
2
+ Compass::Frameworks.register("font-stacks", :path => "#{File.dirname(__FILE__)}/..")
3
+
4
+ module FontStacks
5
+
6
+ VERSION = "0.1.0"
7
+ DATE = "2011-11-22"
8
+
9
+ end
@@ -0,0 +1,170 @@
1
+ // FONT STACKS
2
+
3
+ // Initial idea based on Bedrock's font-stacks partial
4
+ // Large re-factor based on "Revised Font Stacks" by Amrinder Sandhu - http://www.awayback.com/revised-font-stack/
5
+
6
+ // Notes:
7
+ //
8
+ // Some of the fonts, like: Garamond, Baskerville and Didot are not as readable on screen as Georgia. Feel free to make your own selection.
9
+ // Due to smaller x-height; Caslon, Didot, Garamond, Baskerville and Hoefler Text should be set at minimum of 14 pixels or above.
10
+ // Lucida Grande, Futura and Tahoma are mechanically obliqued to fake an italic.
11
+ // Geneva, Baskerville Old Face and Big Caslon has no bold and italic. They are faked to bold and italic.
12
+ // Avoid using Helvetica or Helvetica Neue for body text, especially below 14px.
13
+ // Futura, Gill Sans and Franklin Gothic Medium should be carefully stacked and used because of their unusual weight.
14
+
15
+ @function font-family($family) {
16
+
17
+ //
18
+ // Serif
19
+ //
20
+
21
+ // BASKERVILLE ( 88.60% on Mac, 49.10% on Windows)
22
+ @if $family == "Baskerville" {
23
+ @return Baskerville, "Baskerville old face", "Hoefler Text", Garamond, "Times New Roman", serif;
24
+ }
25
+
26
+ // BIG CASLON (85.10% on Mac)
27
+ @else if $family == "Big Caslon" {
28
+ @return "Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif;
29
+ }
30
+
31
+ // BODONI (47.89% on Windows)
32
+ @else if $family == "Bodoni MT" {
33
+ @return "Bodoni MT", Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif;
34
+ }
35
+
36
+ // BOOK ANTIQUA (86.09% on Mac)
37
+ @else if $family == "Book Antiqua" {
38
+ @return "Book Antiqua", Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
39
+ }
40
+
41
+ // CAMBRIA (54.51% on Windows)
42
+ @else if $family == "Cambria" {
43
+ @return Cambria, Georgia, serif;
44
+ }
45
+
46
+ // CONSTANTIA (53.81% on Windows)
47
+ @else if $family == "Constantia" {
48
+ @return Constantia, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
49
+ }
50
+
51
+ // DIDOT (87.72% on Mac)
52
+ @else if $family == "Didot" {
53
+ @return Didot, "Didot LT STD", "Hoefler Text", Garamond, "Times New Roman", serif;
54
+ }
55
+
56
+ // GARAMOND (23.84% on Mac, 86.24% on Windows)
57
+ @else if $family == "Garamond" {
58
+ @return Garamond, Baskerville, "Baskerville Old Face", "Hoefler Text", "Times New Roman", serif;
59
+ }
60
+
61
+ // GOUDY OLD STYLE (51.30% on Windows)
62
+ @else if $family == "Goudy Old Style" {
63
+ @return "Goudy Old Style", Garamond, "Big Caslon", "Times New Roman", serif;
64
+ }
65
+
66
+ // HOEFLER TEXT (88.70% on Mac, 1.16% on Windows)
67
+ @else if $family == "Hoefler Text" {
68
+ @return "Hoefler Text", "Baskerville old face", Garamond, "Times New Roman", serif;
69
+ }
70
+
71
+ // LUCIDA BRIGHT (64.90% on Mac, 33.84% on Windows) - huge x-height
72
+ @else if $family == "Lucida Bright" {
73
+ @return "Lucida Bright", Georgia, serif;
74
+ }
75
+
76
+ // PALATINO (79.71% on Mac, 98.04% on Windows)
77
+ @else if $family == "Palatino" {
78
+ @return Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
79
+ }
80
+
81
+ //
82
+ // Sans-serif
83
+ //
84
+
85
+ // CALIBRI (54.76% on Windows)
86
+ @else if $family == "Calibri" {
87
+ @return Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
88
+ }
89
+
90
+ // CANDARA (54.31% on Windows)
91
+ @else if $family == "Candara" {
92
+ @return Candara, Calibri, Segoe, "Segoe UI", Optima, Arial, sans-serif;
93
+ }
94
+
95
+ // FRANKLIN GOTHIC MEDIUM (97.89% on Windows)
96
+ @else if $family == "Franklin Gothic Medium" {
97
+ @return "Franklin Gothic Medium", Arial, sans-serif;
98
+ }
99
+
100
+ // FUTURA (91.01% on Mac)
101
+ @else if $family == "Futura" {
102
+ @return Futura, "Trebuchet MS", Arial, sans-serif;
103
+ }
104
+
105
+ // GENEVA (98.84% on Mac)
106
+ @else if $family == "Geneva" {
107
+ @return Geneva, Tahoma, Verdana, sans-serif;
108
+ }
109
+
110
+ // GILL SANS (91.52% on Mac, 51.74% on Windows)
111
+ @else if $family == "Gill Sans" {
112
+ @return "Gill Sans", "Gill Sans MT", Calibri, sans-serif;
113
+ }
114
+
115
+ // HELVETICA NEUE (94.74% on Mac)
116
+ @else if $family == "Helvetica Neue" {
117
+ @return "Helvetica Neue", Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
118
+ }
119
+ // Alias to "helvetica-neue"
120
+ @else if $family == "Helvetica" { @return font-family("Helvetica Neue"); }
121
+
122
+ // LUCIDA GRANDE (99.13% on Mac, 98.25% on Windows)
123
+ @else if $family == "Lucida Grande" {
124
+ @return "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
125
+ }
126
+
127
+ // OPTIMA (90.14% on Mac)
128
+ @else if $family == "Optima" {
129
+ @return Optima, Segoe, "Segoe UI", Candara, Calibri, Arial, sans-serif;
130
+ }
131
+
132
+ // SEGOE (45.04% on Windows)
133
+ @else if $family == "Segoe" {
134
+ @return Segoe, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
135
+ }
136
+
137
+ // TAHOMA (99.30% on Windows)
138
+ @else if $family == "Tahoma" {
139
+ @return Tahoma, Geneva, Verdana, sans-serif;
140
+ }
141
+
142
+ // TREBUCHET (94.20% on Mac, 99% on Windows)
143
+ @else if $family == "Trebuchet MS" {
144
+ @return "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
145
+ }
146
+
147
+ // VERDANA (96.81% on Mac, 99.40% on Windows)
148
+ @else if $family == "Verdana" {
149
+ @return Verdana, Geneva, sans-serif;
150
+ }
151
+
152
+ //
153
+ // Monospace
154
+ //
155
+
156
+ @else if $family == "Monospace" {
157
+ @return "DejaVu Sans Mono", Menlo, Monaco, Consolas, Courier, monospace;
158
+ }
159
+ // Alias to "Monospace"
160
+ @else if $family == "monospace" { @return font-family("Monospace"); }
161
+
162
+ @else {
163
+ @return sans-serif;
164
+ }
165
+
166
+ }
167
+
168
+ @function ff($family) {
169
+ @return font-family($family);
170
+ }
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: font-stacks
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Author Name
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-11-22 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: compass
16
+ requirement: &70359387102000 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.11.5
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70359387102000
25
+ description: Compass extension description
26
+ email:
27
+ - author@email.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - CHANGELOG.mdown
33
+ - lib/font-stacks.rb
34
+ - stylesheets/_font-stacks.scss
35
+ homepage: http://font-stacks.com/
36
+ licenses: []
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ segments:
48
+ - 0
49
+ hash: -2398772740170960313
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 1.3.6
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 1.8.10
59
+ signing_key:
60
+ specification_version: 3
61
+ summary: Compass extension summary
62
+ test_files: []