Saucy – use any font on your website

Fonts can be a developer’s nightmare if they’re not one of the ones installed on the user’s machine. There are alternatives such as sIFR and typeface.js but they’re quite resource intensive – we had to remove sIFR for that reason.

What some people end up doing is using images, cutting them up manually; quite a time intensive way of doing things. Saucy is Rails plugin developed by Jonah Fox to generate the text server side, using RMagick, so you can use any font you want.

<%= saucy_tag "h2 tag",
                :style => {
                    :font => { :size => 100, :font => "bauhausl.ttf"  }
                },
                :tag => :h2,
                :html => {:id => "myid"} %>

I’ve recently been extending Saucy to support Sprites, so you can do rollover images easily. It’s as simple as this:

  <%= saucy_tag("I am a red/blue sprite",
                  :style => {:font => {:color => 'red'}},
                  :hover => {:font => {:color => 'blue'}}
                ) %>

You can get Saucy here until Jonah merges the changes.

Next up is rounded corners (don’t even mention drop shadows) ;)

See also:

  • No similar posts

About the author

Leave a comment

Our latest tweets

Categories

Recent comments

  • Gary Moneysmith: I was @ the SXSW keynote presentation with Ev Williams and had to leave after 40-minutes. I left a ...
  • Isaac Pinnock: Thanks for the comment Sara - all points very well made. Not wanting to be held accountable is an i...
  • Sara: Thanks for the post. I find this really interesting as a media student. While not at sxsw, I frequen...
  • David: I like this app and agree that it seems to be accurate. Where I differ from Justin is that it actual...
  • Mark Bernstein: Your MBM colleague Elin Sjursen tweeted this url to me over the weekend, but I've been onstage nonst...