Skip to content

Commit

Permalink
Fixes #181 - Adds optimizeLegibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizau committed Feb 20, 2014
1 parent 4bdb97e commit e8d6eee
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 40 deletions.
15 changes: 15 additions & 0 deletions lib/fontcustom/generator/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ def glyph_selectors
output.join ",\n"
end

def glyph_properties
%Q| display: inline-block;
font-family: "#{font_name}";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-rendering: optimizeLegibility;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-smoothing: antialiased;|
end

def glyphs
output = @glyphs.map do |name, value|
%Q|#{@options[:css_selector].sub('{{glyph}}', name.to_s)}:before { content: "\\#{value[:codepoint].to_s(16)}"; }|
Expand Down
11 changes: 1 addition & 10 deletions lib/fontcustom/templates/_fontcustom-rails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@

[data-icon]:before,
<%= glyph_selectors %> {
display: inline-block;
font-family: "<%= font_name %>";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
<%= glyph_properties %>
}

<%= glyphs %>
11 changes: 1 addition & 10 deletions lib/fontcustom/templates/_fontcustom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@

[data-icon]:before,
<%= glyph_selectors %> {
display: inline-block;
font-family: "<%= font_name %>";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
<%= glyph_properties %>
}

<%= glyphs %>
11 changes: 1 addition & 10 deletions lib/fontcustom/templates/fontcustom-preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,7 @@

[data-icon]:before,
<%= glyph_selectors %> {
display: inline-block;
font-family: "<%= font_name %>";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
<%= glyph_properties %>
}

<%= glyphs %>
Expand Down
11 changes: 1 addition & 10 deletions lib/fontcustom/templates/fontcustom.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@

[data-icon]:before,
<%= glyph_selectors %> {
display: inline-block;
font-family: "<%= font_name %>";
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
text-decoration: inherit;
text-transform: none;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
<%= glyph_properties %>
}

<%= glyphs %>

0 comments on commit e8d6eee

Please sign in to comment.