Skip to content

Instantly share code, notes, and snippets.

@vectorsize
Created February 27, 2013 18:17
Show Gist options
  • Save vectorsize/5050170 to your computer and use it in GitHub Desktop.
Save vectorsize/5050170 to your computer and use it in GitHub Desktop.
/* url sets the path */
font-url(file)
return '/public/stylesheets/fonts/' + file
/* abstracts all the specifics*/
webfont(family, file, style, weight)
@font-face
font-family family
font-weight weight
font-style style
src font-url(file + '.eot')
src font-url(file + '.eot?#iefix') format('embedded-opentype'), font-url(file + '.woff') format('woff'), font-url(file + '.ttf') format('truetype'), font-url(file + '.svg#'+ family) format('svg')
/* usage */
webfont("PT serif", "PTSerifRegular", normal, 400)
webfont("PT serif", "PTSerifRegularItalic", italic, 400)
webfont("PT serif", "PTSerifBold", normal, 700)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment