Added utility for loading web fonts using @font-face.

This commit is contained in:
Andrew Vit 2009-10-14 23:04:12 -07:00 committed by Chris Eppstein
parent 5f32043c29
commit 5ea5d3d6f3
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
//**\\
@font-face loading utility
Provides custom web fonts that can be referenced by name for any font-family
declaration.
Set up the !font_path variable for where your font-files are stored. You
should have files in both .eot and .otf formats.
+font-face( "Compass Sans Regular", "compass_sans_reg", "CompassSans-Regular" )
!font_path ||= "/stylesheets/fonts"
=font-face(!family_name, !file_basename, !local_family_name)
!file_path = "#{!font_path}/#{!file_basename}"
@font-face
font-family= "'#{!family_name}'"
src= url(!file_path+".eot")
src= local("'#{!family_name}'"), local("'#{!local_family_name}'"), url(!file_path+".otf") format('opentype')

View File

@ -1,2 +1,3 @@
@import text/nowrap.sass @import text/nowrap.sass
@import text/replacement.sass @import text/replacement.sass
@import text/fonts.sass