Skip to content
PHP script for downloading remote fonts in CSS files generated by Google Fonts.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Google Fonts Downloader

A PHP script to download Google Fonts so you can use them in offline


  • Open the script in your browser and copy/paste the google <link ...> code in the input box and press "Download". A sample <link ...> for Open Sans is there by default.
  • After downloading, you can find the fonts in fonts directory and the css file as google-fonts.css file in the root directory.


I use assets directory structure like this:

├── css/
│   └── google-fonts.css
└── fonts/
    ├── cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf
    ├── DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf
    └── k3k702ZOKiLJc3WVjuplzInF5uFdDttMLvmWuJdhhgs.ttf

So the path in the font in the css file is url(../fonts/font-file.ttf). So if you use different directory structure to manage your assets, then change the line no 57 in downloader.php.

You can’t perform that action at this time.