No commit activity in last 3 years
No release in over 3 years
Download and extract font-kits from fontsquirrel easily with a rake tasks.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 3.1
>= 1.0
 Project Readme

Fontsquirrel::Download

Gem Version

Download and extract font-kits from fontsquirrel easily with a rake tasks.

Installation

Add this line to your application's Gemfile:

gem 'fontsquirrel-download', group: "development"

And then execute:

$ bundle

Add to your application.css/application.css.scss:

//= require fonts

Because the download will append the necessary changes to app/assets/stylesheets/_fonts.scss.

Usage

Use Rake task, specify the Font name as written in the URL from font-squirrel, e.g. the well-known LaTeX-Font:

rake font:download NAME=TeX-Gyre-Bonum

This will download the fonts to app/assets/fonts and append the style rules to app/assets/stylesheets/_fonts.scss.

After that, you can use that style definition in your css rules, like:

body {
  font-family: "TeXGyreBonumRegular", serif;
}

The names always vary a little, just look them up in the _fonts.scss

Webfont-Kits

You can also create font-kits with Fontsquirrel's great Webfont-generator and extract+apply that zipfile and merge a meaningful scss-file with correct font weight and style:

rake font:install FILE=/tmp/webfontkit-123.zip

Limitations

  • Until know, it will download the normal subset of the font. Some fonts have no special chars (like German Umlauts) at all, some have them in a subset. Maybe specifying the subset comes in handy.