Giter Club home page Giter Club logo

marmot's Introduction

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?

Marmot is only a couple days old, so this can happen. Please, report on the Issues page.

Or contact me on Twitter

githalytics.com alpha

Analytics

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.