cdowdy / webfontloader

Bolt CMS Web Font Loader Extension
1 stars 2 forks source link

NO LONGER MAINTAINED. NO FIXES OR UPDATES WILL BE DONE FOR THE CURRENT SUPPORTED VERSION BOLT OR ANY FUTURE VERSIONS OF BOLT CMS

Bolt Webfont Loader

A Bolt Extension using TypeKit's Webfont loader to load fonts from a Font Service or your own Stylesheet.

This extension allows you to use a twig tag in the head of your templates to load fonts.

Getting Started

In the head of your base template or your header include place this tag just above the closing </head> tag.

{{ webfont() }}  

You can then move on to setting the rest of your available options in the config file.

Options

async: Load the TypeKit Loader script Async. This defaults to false. Using the script async results in better performance but you have to take into account a Flash of Unstyled Text FOUT. To Enable this change it to true.

async: false  

use_cdn: Use a CDN to deliver the TypeKit script. CDN options are below.

use_cdn: false  

cdn Three CDN's are available to use:
Certain areas of the World may block the Google CDN version. You now have the option of using two additional CDN's which are as follows:

cdn: Google  

font_service: The Font Service you would like to use. Options are:

font_service: Google

font_family: The font families you would like to use.
example single font family:

font_family: [ Droid Sans ]  

multiple fonts - separate each font with a comma:

font_family: [ Montserrat, Lato ]

custom_url: if using a custom font_service ( your own fonts ) and are loading a separate stylesheet for the fonts put the URL here. This file must be located in your current themes directory

custom_url: css/custom-fonts.css

font_deck_id: The ID for your fontdeck account and kit

font_deck_id: xxxxx  

Settings for Fonts.com:

projectID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
version:  12345 // (optional, flushes the CDN cache)