0.1.5 • Published 6 years ago

google-fonts-offline v0.1.5

Weekly downloads
391
License
Unlicense
Repository
github
Last release
6 years ago

Google Fonts Offline

NPM

Getting Started

Sometimes you just have to have fonts locally on your machine. The easiest way is to install package globally:

npm install -g google-fonts-offline

Then use links from Quick Use or your collection as an argument:

goofoffline "http://fonts.googleapis.com/css?family=Open+Sans"

All downloads will be saved in fonts directory by default and the CSS file with @font-face declarations will be named fonts.css. You can use outDir and outCss arguments to change this. For example:

goofoffline outDir=tmp outCss=gf.css "http://fonts.googleapis.com/css?family=Ubuntu:200italic"

With greatest HTML post-processing library for Grunt processhtml you may switch between local and hosted variants as simple as:

<!-- build:remove:release -->
        <link rel="stylesheet" href="fonts/fonts.css">
<!-- /build -->

<!-- build:remove:dev  -->
        <script src="//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script>
        <script>
            WebFont.load({
                google: {
                    families: ['Dosis:200', 'Smythe', 'Ubuntu']
                }
            });
        </script>
<!-- /build -->

Contributors