パッケージの詳細

webfontloader

typekit2.4mApache-2.01.6.28

Web Font Loader gives you added control when using linked fonts via @font-face.

web, fonts, webfonts, font

readme

Web Font Loader

Web Font Loader gives you added control when using linked fonts via @font-face. It provides a common interface to loading fonts regardless of the source, then adds a standard set of events you may use to control the loading experience. The Web Font Loader is able to load fonts from Google Fonts, Typekit, Fonts.com, and Fontdeck, as well as self-hosted web fonts. It is co-developed by Google and Typekit.

Build Status

Contents

Get Started

To use the Web Font Loader library, just include it in your page and tell it which fonts to load. For example, you could load fonts from Google Fonts using the Web Font Loader hosted on Google Hosted Libraries using the following code.

<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>
<script>
  WebFont.load({
    google: {
      families: ['Droid Sans', 'Droid Serif']
    }
  });
</script>

Alternatively, you can link to the latest 1.x version of the Web Font Loader by using https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js as the script source. Note that the version in this url is less specific. It will always load the latest 1.x version, but it also has a shorter cache time to ensure that your page gets updates in a timely manner. For performance reasons, we recommend using an explicit version number (such as 1.6.26) in urls when using the Web Font Loader in production. You can manually update the Web Font Loader version number in the url when you want to adopt a new version.

Web Font Loader is also available on the jsDelivr & CDNJS CDNs.

It is also possible to use the Web Font Loader asynchronously. For example, to load Typekit fonts asynchronously, you could use the following code.

<script>
   WebFontConfig = {
      typekit: { id: 'xxxxxx' }
   };

   (function(d) {
      var wf = d.createElement('script'), s = d.scripts[0];
      wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
      wf.async = true;
      s.parentNode.insertBefore(wf, s);
   })(document);
</script>

Using the Web Font Loader asynchronously avoids blocking your page while loading the JavaScript. Be aware that if the script is used asynchronously, the rest of the page might render before the Web Font Loader is loaded and executed, which can cause a Flash of Unstyled Text (FOUT).

The FOUT can be more easily avoided when loading the Web Font Loader synchronously, as it will automatically set the wf-loading class on the HTML element as soon as Webfont.load has been called. The browser will wait for the script to load before continuing to load the rest of the content, FOUT is avoided.

Web Font Loader is also available on npm as a CommonJS module. Just npm install webfontloader and then require it in your code.

  var WebFont = require('webfontloader');

  WebFont.load({
    google: {
      families: ['Droid Sans', 'Droid Serif']
    }
  });

Configuration

The Web Font Loader configuration is defined by a global variable named WebFontConfig, or passed directly to the WebFont.load method. It defines which fonts to load from each web font provider and gives you the option to specify callbacks for certain events. When using the asynchronous approach, you must define the global variable WebFontConfig before the code that loads the Web Font Loader (as in the example above).

Events

Web Font Loader provides an event system that developers can hook into. It gives you notifications of the font loading sequence in both CSS and JavaScript.

  • loading - This event is triggered when all fonts have been requested.
  • active - This event is triggered when the fonts have rendered.
  • inactive - This event is triggered when the browser does not support linked fonts or if none of the fonts could be loaded.
  • fontloading - This event is triggered once for each font that's loaded.
  • fontactive - This event is triggered once for each font that renders.
  • fontinactive - This event is triggered if the font can't be loaded.

CSS events are implemented as classes on the html element. The following classes are set on the html element:

.wf-loading
.wf-active
.wf-inactive
.wf-<familyname>-<fvd>-loading
.wf-<familyname>-<fvd>-active
.wf-<familyname>-<fvd>-inactive

The <familyname> placeholder will be replaced by a sanitized version of the name of each font family. Spaces and underscores are removed from the name, and all characters are converted to lower case. For example, Droid Sans becomes droidsans. The <fvd> placeholder is a Font Variation Description. Put simply, it's a shorthand for describing the style and weight of a particular font. Here are a few examples:

/* n4 */
@font-face { font-style: normal; font-weight: normal; }

/* i7 */
@font-face { font-style: italic; font-weight: bold; }

Keep in mind that font-weight: normal maps to font-weight: 400 and font-weight: bold maps to font-weight: 700. If no style/weight is specified, the default n4 (font-style: normal; font-weight: normal;) will be used.

If fonts are loaded multiple times on a single page, the CSS classes continue to update to reflect the current state of the page. The global wf-loading class is applied whenever fonts are being requested (even if other fonts are already active or inactive). The wf-inactive class is applied only if none of the fonts on the page have rendered. Otherwise, the wf-active class is applied (even if some fonts are inactive).

JavaScript events are implemented as callback functions on the WebFontConfig configuration object.

WebFontConfig = {
  loading: function() {},
  active: function() {},
  inactive: function() {},
  fontloading: function(familyName, fvd) {},
  fontactive: function(familyName, fvd) {},
  fontinactive: function(familyName, fvd) {}
};

The fontloading, fontactive and fontinactive callbacks are passed the family name and font variation description of the font that concerns the event.

It is possible to disable setting classes on the HTML element by setting the classes configuration parameter to false (defaults to true).

WebFontConfig = {
  classes: false
};

You can also disable font events (callbacks) by setting the events parameter to false (defaults to true).

WebFontConfig = {
  events: false
};

If both events and classes are disabled, the Web Font Loader does not perform font watching and only acts as a way to insert @font-face rules in the document.

Timeouts

Since the Internet is not 100% reliable, it's possible that a font will fail to load. The fontinactive event will be triggered after 5 seconds if the font fails to render. If at least one font successfully renders, the active event will be triggered, else the inactive event will be triggered.

You can change the default timeout by using the timeout option on the WebFontConfig object.

WebFontConfig = {
  google: {
    families: ['Droid Sans']
  },
  timeout: 2000 // Set the timeout to two seconds
};

The timeout value should be in milliseconds, and defaults to 3000 milliseconds (3 seconds) if not supplied.

Iframes

Usually, it's easiest to include a copy of Web Font Loader in every window where fonts are needed, so that each window manages its own fonts. However, if you need to have a single window manage fonts for multiple same-origin child windows or iframes that are built up using JavaScript, Web Font Loader supports that as well. Just use the optional context configuration option and give it a reference to the target window for loading:

WebFontConfig = {
  google: {
    families: ['Droid Sans']
  },
  context: frames['my-child']
};

This is an advanced configuration option that isn't needed for most use cases.

Modules

Web Font Loader provides a module system so that any web font provider can contribute code that allows their fonts to be loaded. This makes it possible to use multiple web font providers at the same time. The specifics of each provider currently supported by the library are documented here.

Adobe Edge Web Fonts

When using Adobe Edge Web Fonts, you can use the typekit module by passing in a catenated list of fonts in the id parameter and set the api parameter to point to the Edge Web Fonts URL.

WebFontConfig = {
  typekit: {
    id: 'adamina;advent-pro',
    api: '//use.edgefonts.net'
  }
};

Custom

To load fonts from any external stylesheet, use the custom module. Here you'll need to specify the font family names you're trying to load, and optionally the url of the stylesheet that provides the @font-face declarations for those fonts.

You can specify a specific font variation or set of variations to load and watch by appending the variations separated by commas to the family name separated by a colon. Variations are specified using FVD notation.

WebFontConfig = {
  custom: {
    families: ['My Font', 'My Other Font:n4,i4,n7'],
    urls: ['/fonts.css']
  }
};

In this example, the fonts.css file might look something like this:

@font-face {
  font-family: 'My Font';
  src: ...;
}
@font-face {
  font-family: 'My Other Font';
  font-style: normal;
  font-weight: normal; /* or 400 */
  src: ...;
}
@font-face {
  font-family: 'My Other Font';
  font-style: italic;
  font-weight: normal; /* or 400 */
  src: ...;
}
@font-face {
  font-family: 'My Other Font';
  font-style: normal;
  font-weight: bold; /* or 700 */
  src: ...;
}

If your fonts are already included in another stylesheet you can also leave out the urls array and just specify font family names to start font loading. As long as the names match those that are declared in the families array, the proper loading classes will be applied to the html element.

<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.5.10/webfont.js"></script>
<script>
  WebFont.load({
    custom: {
      families: ['My Font']
    }
  });
</script>

<style type="text/css">
  @font-face {
    font-family:"My Font";
    src:url("assets/fonts/my_font.woff") format("woff");
  }
</style>

The custom module also supports customizing the test strings that are used to determine whether or not a font has loaded. This can be used to load fonts with custom subsets or glyphs in the private use unicode area.

WebFontConfig = {
  custom: {
    families: ['My Font'],
    testStrings: {
      'My Font': '\uE003\uE005'
    }
  }
};

Tests strings should be specified on a per font basis and contain at least one character. If not specified the default test string (BESbswy) is used.

Fontdeck

To use the Fontdeck module, specify the ID of your website. You can find this ID on the website page within your account settings.

WebFontConfig = {
  fontdeck: {
    id: 'xxxxx'
  }
};

Fonts.com

When using Fonts.com web fonts specify your Project ID.

WebFontConfig = {
  monotype: {
    projectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    version: 12345, // (optional, flushes the CDN cache)
    loadAllFonts: true //(optional, loads all project fonts)
  }
};

The Fonts.com module has an optional version option which acts as a cache-buster, optional loadAllFonts loads all project fonts. By default, Fonts.com module loads only fonts used on the page.

Google

Using Google's Font API, name the font families you'd like to load. You can use the same syntax as in the Font API to specify styles. Please note that the Google module does not support the FVD syntax that is used in the custom module.

WebFontConfig = {
  google: {
    families: ['Droid Sans', 'Droid Serif:bold']
  }
};

Sometimes the font you requested doesn't come in the default weight (e.g. 400) and you need to explicitly request the variation you want for font events to work (e.g. 300, 700, etc.):

WebFontConfig = {
  google: {
    families: ['Open Sans Condensed:300,700']
  }
};

If you need to specify character subsets other than the default (e.g.: greek script in addition to latin), you must append the subset string to the requested family string after a colon. The subset string should follow the Google documentation (subset names separated by commas):

WebFontConfig = {
  google: {
    families: ['Open Sans Condensed:300,700:latin,greek']
  }
};

You can also supply the text parameter to perform character subsetting:

WebFontConfig = {
  google: {
    families: ['Droid Sans', 'Droid Serif'],
    text: 'abcdefghijklmnopqrstuvwxyz!'
  }
};

The text subsetting functionality is only available for the Google module.

Typekit

When using Typekit, specify the Kit to retrieve by its ID. You can find the Kit ID within Typekit's Kit Editor interface.

WebFontConfig = {
  typekit: {
    id: 'xxxxxx'
  }
};

FYI: Typekit's own JavaScript is built using the Web Font Loader library and already provides all of the same font event functionality. If you're using Typekit, you should use their embed codes directly unless you also need to load web fonts from other providers on the same page.

Browser Support

Every web browser has varying levels of support for fonts linked via @font-face. Web Font Loader determines support for web fonts is using the browser's user agent string. The user agent string may claim to support a web font format when it in fact does not. This is especially noticeable on mobile browsers with a "Desktop" mode, which usually identify as Chrome on Linux. In this case a web font provider may decide to send WOFF fonts to the device because the real desktop Chrome supports it, while the mobile browser does not. The Web Font Loader is not designed to handle these cases and it defaults to believing what's in the user agent string. Web font providers can build on top of the basic Web Font Loader functionality to handle these special cases individually.

If Web Font Loader determines that the current browser does not support @font-face, the inactive event will be triggered.

When loading fonts from multiple providers, each provider may or may not support a given browser. If Web Font Loader determines that the current browser can support @font-face, and at least one provider is able to serve fonts, the fonts from that provider will be loaded. When finished, the active event will be triggered.

For fonts loaded from supported providers, the fontactive event will be triggered. For fonts loaded from a provider that does not support the current browser, the fontinactive event will be triggered.

For example:

WebFontConfig = {
  providerA: 'Family1',
  providerB: 'Family2'
};

If providerA can serve fonts to a browser, but providerB cannot, The fontinactive event will be triggered for Family2. The fontactive event will be triggered for Family1 once it loads, as will the active event.

Copyright and License

Web Font Loader Copyright (c) 2010-2017 Adobe Systems Incorporated, Google Incorporated.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

更新履歴

v1.6.28 (March 27, 2017)

  • Clear timer timeout when promise resolves.

v1.6.27 (November 29, 2016)

  • Disable native font loading for Safari 10

v1.6.26 (July 8, 2016)

  • Add support for latin extended in the Google Fonts module.

v1.6.25 (July 7, 2016)

  • Add "loadAllFonts" option to Monotype module.
  • Add documentation on how to use Web Font Loader with Edge Web Fonts.

v1.6.24 (March 20, 2016)

  • Fix type annotation in DomHelper.

v1.6.23 (March 20, 2016)

  • Add bower.json
  • Small code rewrite in order to workaround a bad type cast (Closure Compiler is correct, but reality doesn't always match).

v1.6.22 (February 29, 2016)

  • Fix bug that caused long loading fonts to get stuck on wf-loading because the timeout never fired (or took a really long time).

v1.6.21 (February 2, 2016)

  • Fix bug in Google module that caused non-latin to fail on browsers that support the native font loading API.
  • Fix bug in IE8 where font events sometimes failed due to a timing issue.

v1.6.20 (January 4, 2016)

  • Add all source files to the npm package.

v1.6.19 (January 4, 2016)

  • Add src/core files to npm package.

v1.6.18 (January 4, 2016)

  • Version bump.

v1.6.17 (January 4, 2016)

  • Upgrade closure compiler and base.js to latest version (no code changes).

v1.6.16 (December 8, 2015)

  • Add support for detecting font loads even if the font isn't in the CSSOM yet (workaround for a Chrome bug).

v1.6.15 (November 26, 2015)

  • Temporarily disable the native font loading API in Firefox 42 and below due to a bug.

v1.6.14 (November 24, 2015)

  • Change media type check to be more reliable on old IE.

v1.6.13 (November 24, 2015)

  • Fix media type check in IE/Edge.

v1.6.12 (November 23, 2015)

  • Fix bug that sometimes caused wf-inactive to show when asynchronously loading CSS.

v1.6.11 (November 17, 2015)

  • Only include production build in npm package
  • Fix bug that caused duplicate font loads to fail (using the native font loading code)

v1.6.10 (October 9, 2015)

  • Fix compile warning

v1.6.9 (October 9, 2015)

  • Fix native font load detection when combined with asynchronous CSS loading
  • Fix support for font family names starting with a number

v1.6.8 (October 1, 2015)

  • Add support for the native font loading API.

v1.6.7 (September 24, 2015)

  • Update Monotype module

v1.6.6 (August 7, 2015)

  • Fix weird check in insertInto that disallowed adding a link to an empty head element.
  • Load fonts asynchronously for the Typekit module.
  • Remove font rulers and trigger callback asynchronously to avoid unnecessary reflows.

v1.6.5 (July 25, 2015)

  • Optimise layout calculations
  • Fix Rubygems source
  • Simplify internal Google module code

v1.6.4 (July 9, 2015)

  • Optimise reflows when setting up test spans.

v1.6.3 (June 1, 2015)

  • Fix invalid references to global this (window).

v1.6.2 (May 29, 2015)

  • No changes.

v1.6.1 (May 29, 2015)

  • Automatically update npm version.

v1.6.0 (May 28, 2015)

  • Remove user agent string sniffing. From now on the Web Font Loader will always try to load fonts.

v1.5.21 (May 26, 2015)

  • No changes.

v1.5.20 (May 26, 2015)

  • Use setTimeout instead of window.setTimeout

v1.5.19 (May 24, 2015)

  • Add UMD wrapper

v1.5.18 (April 15, 2015)

  • Add configuration option to enable asynchronous CSS (internal API)

v1.5.17 (April 14, 2015)

  • Load CSS files asynchronously

v1.5.16 (March 30, 2015)

  • Optimise DOM performance in the font watcher.

v1.5.15 (March 25, 2015)

  • Increase offset position for ruler so scrollbars are less likely to be triggered by large test strings

v1.5.14 (January 23, 2015)

  • Refactor EventDispatcher

v1.5.13 (January 20, 2015)

  • Remove unused exports
  • Move definition of FontTestStrings to where it is first used

v1.5.12 (January 19, 2015)

  • Revert using visibility hidden (caused strange artifacts on some sites on iOS browsers)
  • Fix compiler warnings

v1.5.11 (January 7, 2015)

  • Add support for explicitly setting the protocol

v1.5.10 (December 18, 2014)

  • Fix parameters passed to Typekit KitJS

v1.5.9 (December 18, 2014)

  • Use visibility hidden instead of off-screen positioning
  • Decouple Typekit internal API
  • Disable native font loading (see comment)

v1.5.8 (November 17, 2014)

  • Add prebuilt library to repository

v1.5.7 (November 17, 2014)

  • Decrease default timeout to 3 seconds
  • Add support for native font loading

v1.5.6 (September 3, 2014)

  • Fix double inactive event when all modules fail to load

v1.5.5 (June 5, 2014)

  • Add support for the Chromecast browser

v1.5.4 (May 2, 2014)

  • Add support for the PlayStation 4 browser

v1.5.3 (April 8, 2014)

  • Prevent a potential FOUT when setting the font event classes.
  • Add "display:block" to test rulers so "* { display: none; }" doesn't override it

v1.5.2 (January 3, 2014)

  • Add Copyright, License and Version to the compiled output file(s)
  • Fix small bug in Google Font module that rejected font variations with dashes

v1.5.1 (October 15, 2013)

  • Dispatch wf-loading event synchronously instead of waiting for asynchronous modules
  • Update README explaining how to use custom fonts without a stylesheet
  • Add license information to gemspec

v1.5.0 (September 9, 2013)

  • Correctly categorize Internet Explorer 11 as an Internet Explorer version.
  • Add support for custom test strings in the custom module.
  • Various small bug fixes to the test suite so it runs on all browsers automatically.

v1.4.12 (August 21, 2013)

  • Cleared up initialization code and made all modules optional and configurable at compile time

v1.4.11 (August 8, 2013)

  • Remove Ascender module (according to Monotype the service has now been shutdown completely.)
  • Switch Monotype module to use fast.fonts.net instead of fast.fonts.com
  • Update license

v1.4.10 (July 31, 2013)

  • Add loadStylesheet method with optional callback that replaces createCssLink
  • Remove supportForStyle check because it breaks XHTML/SVG and is no longer necessary
  • Fix inactive never called when script loading times out
  • Move test assets into fixtures directory

v1.4.9 (July 24, 2013)

  • Disable terminal spec report when not using PhantomJS
  • Remove obsolete namespace declaration

v1.4.8 (June 24, 2013)

  • Add support for the Chromium based Opera browser
  • Change the debug task to do a Closure Compiler debug build
  • Fix a global variable leak in the compiled output
  • Add support for the PhantomJS user agent string

v1.4.7 (June 6, 2013)

  • Fix backwards compatibility with version strings for Chrome
  • Restore specs that test against version strings for backwards compatibility with the old UserAgent API.

v1.4.6 (May 29, 2013)

  • Merge font watching strategies from core and the Google module
  • Add support for the Samsung Galaxy S4 user agent string

v1.4.5 (May 23, 2013)

  • Move modules into their own namespace
  • Add new methods into DomHelper and add specs for all DomHelper methods
  • Rename watch method so as not to conflict with Firefox Object.prototype.watch

v1.4.4 (May 22, 2013)

  • Change the UserAgent API so that it is backwards compatible with older Typekit kits.

v1.4.3 (May 16, 2013)

  • UserAgent now maintains version numbers as instances of the Version class.

v1.4.2 (April 11, 2013)

  • Namespace is now configurable at compile time
  • BrowserInfo and UserAgent are exported so Typekit KitJS and the standalone webfontloader can share data
  • Add "aria-hidden=true" to test spans so screen readers do not read test spans
  • Fix passing the test strings from the modules to core.

v1.4.1 (April 8, 2013)

  • Internal rewrite of font and variations
  • Fix for the configurable timeout on the Google module

v1.4.0 (March 28, 2013)

  • Stop exporting the addModule API to dynamically add modules (it didn't work anyway.)
  • Stop checking the height when monitoring for font load. This turned out to be inconsistent across platforms.

v1.3.2 (March 27, 2013)

  • Add support for the Amazon 1 and 2+ browsers.

v1.3.1 (March 14, 2013)

  • Change code to use explicit dependencies
  • Fix unit tests in older browsers
  • Fix google/FontApiParser.js to work in IE <= 8

v1.3.0 (February 28, 2013)

  • New optional configuration parameter timeout which lets you customize the default timeout.
  • Change the Typekit module to use use.typekit.net instead of use.typekit.com.
  • Disable height check on OSX and iOS WebKit based browsers which suffer from a metrics bug when loading web fonts.

v1.2.1 (February 26, 2013)

  • Fix the possibility of test strings wrapping to a new line and thereby breaking font watching.
  • Change the FontWatchRunner to not create DOM elements until it is started.
  • Fix the possibility of extraneous whitespace in class names.
  • Add a cache buster parameter to the Monotype/Fonts.com module.
  • Fix the case where there are no fonts to load. Webfontloader will now fire the inactive event correctly.
  • Test suite now uses the active browser to test font watching in addition to the mocked font watching tests.
  • Test suite is now using Jasmine instead of JSTestDriver.

v1.2.0 (January 30, 2013)

  • Improved font watching for browsers with the WebKit web font fallback bug
  • Improved font watching in general by comparing both width and height
  • UserAgent user interface has changed with the introduction of a BrowserInfo object that contains information derived from the user agent string
  • The custom module now supports loading font variations

v1.1.2 (January 21, 2013)

  • Added parameter to Google module to do character based subsetting.
  • Made WebKit useragent check less strict about capitalization for LG L160 phones that apparently use 'AppleWebkit' instead of 'AppleWebKit' in their useragent strings.

v1.1.1 (December 12, 2012)

  • Added the ability to recognize BlackBerry devices, which have web font support (WOFF) in platform version 10+
  • Added a new browser name "BuiltinBrowser" to recognize built-in browsers on mobile platforms which we previously called "Safari" (applies to Android's "Browser" app and BlackBerry's built-in browser)
  • Fixed a bug in the Monotype module which caused a double active event in IE9 and no active event in IE8 (reported in issue #64)
  • Fixed some typos in the demo pages

v1.1.0 (December 5, 2012)

  • Adds the ability to load fonts into a same-origin child window or iframe using the new optional context configuration option (thanks to @ryanwolf of Google).
  • Updates the demos to fix broken stuff and demonstrate the new context option in action.
  • DomHelper interface changed to take the main window and an optional separate window for loading.
  • Methods added to retrieve both windows and get the correct protocol for assets from the location's protocol.

v1.0.31 (September 11, 2012)

  • Improvements to Google's module to recognize more variation descriptor formats (such as 100italic and 200n).

v1.0.30 (August 17, 2012)

  • Added support for detecting the Windows Phone platform in UserAgentParser, which supports web fonts at version 8 and above.
  • Changes to make the global namespace of the library easier to configure when used in 3rd-party projects. (Thanks cbosco!)

v1.0.29 (July 26, 2012)

  • Added test to ensure Firefox for Android is properly detected as "Firefox" by UserAgentParser.
  • Added test to ensure Opera Mobile for Android is properly detected as "Opera" by UserAgentParser.
  • Changed detection so that Chrome for iOS is detected as "Chrome" instead of "Safari".
  • Changed detection so that Opera Mini is correctly detected as "OperaMini" (without font support) instead of "Opera" (with font support).
  • Fixed a bug in Google Web Fonts module when requesting a font family with character sets and no variations.
  • Scaled back the number of fall back fonts used in the Google Web Fonts font watching code.

v1.0.28 (June 4, 2012)

  • Added support for detecting the Chrome OS platform ("CrOS") in the UserAgentParser.

v1.0.27 (April 20, 2012)

  • Updated DomHelper to not require a UserAgent instance. Feature-detection is not used instead of UA detection for switching DOM methods.

v1.0.26 (February 8, 2012)

  • Updated the included version of the Closure JS compiler jar to 1741, to handle newer annotation styles.
  • Added a missing param annotation for the new FontWatcher.watch argument.
  • Added param annotations for Google's custom FontWatchRunner implementation.
  • Updated the Google Web Fonts API parser to accept family names with a plus sign.

v1.0.25 (February 7, 2012)

  • Updated the user agent parser to recognize Chrome for Android properly as a Chrome browser.

v1.0.24 (January 9, 2012)

  • Updated the standard test string from "BESs" to "BESbswy" for more width variability.
  • Improved Google's custom FontWatchRunner implementation for Webkit to work around an issue where the browser reports the 400 weight's width when it is already loaded.

v1.0.23 (November 29, 2011)

  • Made the FontWatchRunner implementation configurable on a module-by-module basis.
  • Added a new .start() method to FontWatchRunner to actually kick off font loading detection.
  • Added a different FontWatchRunner implementation that Google's module uses to work around a Webkit browser bug. This implementation won't trigger active early, but may trigger active much later, so it's not the default for all modules.
  • Updated the implementation of Fontdeck's module to defer loading responsibility to their JS.

v1.0.22 (July 1, 2011)

  • Fixed a bug in Webkit-based browsers with font detection where active would trigger without the font actually being active yet.
  • Increased the frequency of checking the widths of the font watcher spans.

v1.0.21 (June 17, 2011)

  • Added a protocol detect for the Typekit module so JS is loaded securely on secure pages. Thanks to bee525 for the pull request.

v1.0.20 (March 30, 2011)

  • Changed CSS style for hidden span so it's not affected by inline or floated elements at the end of the body

v1.0.19 (March 3, 2011)

  • Add a module for Monotype.

v1.0.18 (January 24, 2011)

  • Improve behavior of CSS classes over multiple loads on a single page. (Documented in docs/EVENTS.md)
  • Add support for international subsets in the Google module.
  • Add a module for Fontdeck.

v1.0.17 (December 1, 2010)

  • Changed CSS style for hidden span in order to be less affected by environment
  • Removed restriction on iPhone/iPad/iPod in the google modules

v1.0.16 (November 18, 2010)

  • Fix a bug where we fail to detect that fonts have loaded if they have the same width as the fallback font.

v1.0.15 (October 14, 2010)

  • Fix an error parsing platform version in IE, when it has no items following the platform in the UA string.

v1.0.14 (October 14, 2010)

  • Bugfix: fixed IE issue in google module.

v1.0.13 (September 30, 2010)

  • Added support for detecting Adobe Air.

v1.0.12 (September 30, 2010)

  • Bugfix: google module, change the url builder to handle integrations.

v1.0.10 (September 24, 2010)

  • Bugfix: extra alert

v1.0.10 (September 22, 2010)

  • Add support for customizable FontWatcher test string, for international fonts.

v1.0.9 (September 10, 2010)

  • Bugfix: of the bug fix

v1.0.8 (September 10, 2010)

  • Bugfix: fix type definitions

v1.0.7 (August 31, 2010)

  • Fix that wf-loading was not removed in the case of wf-inactive because of a timeout.
  • Add UserAgent#getDocumentMode to aid in determining font support in IE.

v1.0.6 (July 20, 2010)

  • Add JsDoc comments and type annotations for the Closure compiler. Fixes several small bugs caught by the compiler in doing so.

v1.0.5 (July 12, 2010)

  • webfont.UserAgent now provides getPlatformVersion. WebFont Loader is now packaged as a ruby gem.

v1.0.4 (June 14, 2010)

  • Add a module for Ascender's Fonts Live.

v1.0.3 (June 6, 2010)

  • IE fixes.

v1.0.2 (June 1, 2010)

  • Added a way of loading the WebFont Loader script asynchronously.

v1.0.1 (May 20, 2010)

  • Fix namespace pollution by wrapping all of the code in a closure.

v1.0.0 (May 19, 2010)

  • Initial release!
  • Modules: google, typekit, custom
  • Events: loading, active, inactive, fontloading, fontactive, fontintactive