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?

Please, report it on the Issues page.

Or contact me on Twitter

marmot's People

Contributors

johnnyshields avatar petethepig avatar thomasbachem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

marmot's Issues

can't find header files for ruby at /usr/share/include/ruby.h

Здраствуйте Дмитрий. Подскажите, что делать с такой штукой?
Никогда до этого не работал с руби

 Building native extensions.  This could take a while...  
  ERROR:  Error installing marmot:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb 
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h

Gem files will remain installed in /usr/local/share/gems/gems/json-1.8.3 for inspection.
Results logged to /usr/local/share/gems/gems/json-1.8.3/ext/json/ext/generator/gem_make.out

Library is broken

  • HTTPS is now required #7
  • After the file upload step, Font Squirrel gives a message that the file length is zero. Probably an API parameter changed?

Please release a new gem version

Need the ::Logger fix; the gem isn't working out of the box.

Also I recommend to make a Github tag of the version so laypeople like me can tell what's going on.

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.