Project

marmot

0.02
No commit activity in last 3 years
No release in over 3 years
Unofficial Font Squirrel webfont generator client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Marmot — Unofficial Font Squirrel Webfont Generator Client

Marmot automates font-face generation, making it easier and faster:

marmot Averia-Regular.ttf         # ls .   =>   webfontkit.zip

Marmot supports Font Squirrel configuration files:

marmot  -c generator-config.txt  font.otf

It is especially useful when it comes to your own icon fonts:

marmot  -c config.txt  my-icon-font.otf  my-icon-font.zip

Great, how do I install Marmot?

Marmot is a ruby gem:

gem install marmot

Okay, how do I configure it?

Font Squirrel Webfont Generator has a lot of options and by default Marmot will use default ones.

Every Font Squirrel webfont kit comes with a text file called generator_config.txt. Marmot can read it:

marmot  -c generator-config.txt  font.otf

Since the config is actually just a JSON file, you can write your own configs. I use this one for my icons:

{
  "formats":["ttf", "woff", "svg"],
  "fallback":"none",
  "subset_custom_range":"E000-F8FF",
  "emsquare":"1000"
}

You can do the same thing from the command line:

marmot  --no-add-hyphens  --formats=ttf,woff  font.otf

Here is a full list of options:

                         --mode <s>
                      --formats <s> 
                --tt-instructor <s> 
             --fix-vertical-metrics
                         --fix-gasp
                   --remove-kerning
                       --add-spaces
                      --add-hyphens
                     --fallback <s>
              --fallback-custom <i>
                          --webonly
               --options-subset <s>
                 --subset-range <s>
                --subset-custom <s>
          --subset-custom-range <s>
                           --base64
                       --style-link
               --css-stylesheet <s>
                  --ot-features <s>
              --filename-suffix <s>
                     --emsquare <i>
           --spacing-adjustment <i>
                        --agreement

Oh, this is great, but what is "tt-instuctor" or "subset-custom"?

Some option names can be confusing. Go to generator's page and run this in the console:

  $("input[value='expert'], input[value='advanced']").click();
  $("table input").each(function(){
    $(this).after($("<div style='color:red;'>"+$(this).attr("name")+" : "+$(this).attr("value")+"</div>"));
  });

Options

What else?

Since Marmot is a ruby gem, you can use it in your ruby projects:

require 'marmot'

client = Marmot::Client.new
client.convert File.new("font.ttf"), { 
  formats: ["ttf", "woff"] 
}

I found a lousy bug, what do I do?

Please, report it on the Issues page.

Or contact me on Twitter