Let’s take a hop across the Atlantic for a British twist on this week’s sites we like.

Arsenal screenshot

The website for Arsenal features just the right level of intensity for this English football club, keeping energy high while providing clear, direct navigation. Agency Gothic CT, which was licensed from CastleType and is being served by Typekit, brings a bold attitude to the page, while FF Meta offers a soft but confident counterpart in the body text.

British Film Institute screenshot

Considering the stunning breadth of their collections and outreach initiatives, it’s appropriate that the website for the British Film Institute is such a visual pleasure to explore. Adelle is a great typographic choice here, as it has a lively character that plays strongly off the captivating screenshots without dominating the scene.

That’s it for this week; share sites you like in the comments!

We’ve added several new fonts to the Typekit library, including painterly wood type and a contemporary blackletter face.

cosmopolitan

Cosmopolitan from Wood Type Revival was first cut by Morgans & Wilcox Manufacturing Co. in the 1890s. Now, more than 120 years later, it flourishes beautifully on the web — try shading it with CSS text-shadows.

eskapade

Eskapade and Eskapade Fraktur from TypeTogether are a lovable serif and blackletter pair. Tall and sharp, these are fantastic for display use — and they make for smart, compact headings.

We hope you enjoy using these new typefaces. If you’ve never given Typekit a try, sign up (it’s free!) and upgrade to a paid plan whenever you’re ready.

We’re wrapping up this week with some music and games. Play on into the weekend with this week’s sites we like!

Festival of the North East screenshot

It may only be February, but doesn’t this page make you look forward to summer? Cubano‘s cheerful, subtly retro vibe sets the mood on this site for the Festival of the North East. Museo Sans cleanly provides information on festival details while maintaining the site’s lighthearted personality.

Governors Ball screenshot

This website for the Governors Ball Music Festival in New York is a fantastic example of how mixing the styles of a single typeface can make for powerfully dynamic typographic design. Proxima Nova shines here as both an iconic header and a modern, geometric body font, with Proxima Nova SC OSF Extra Condensed playing a perfect supporting role in subheads and navigation.

Settlers of Catan screenshot

Inspired by classical Renaissance typefaces, Minion is an appropriate choice for the official website of Settlers of Catan. With a studied tone enhanced by colorful illustration, this site has us ready to gather resources and build some settlements this weekend! Click the German flag to see how neatly the type translates across languages, too.

That’s it for this week! Share sites you like in the comments!

More reliable font events

February 5, 2013

We’re often asked by developers why Typekit uses JavaScript to load web fonts. Of the many advantages, one leading benefit is that JavaScript can monitor the page, detect the various stages of font loading, and provide the means for a developer to respond. This gives the developer the power to consistently control the Flash of Unstyled Text (or FOUT), measure web fonts for dynamic layouts, and more.

Typekit provides these capabilities through font events, which detect the state of fonts and allow developers to work with loading, active, and inactive CSS class names and JavaScript callbacks. While font events are fairly reliable, the WebKit rendering engine has had a long-standing bug which can cause the active event to fire too early. While the bug is fixed in recent versions, many browsers on mobile and desktop still have this problem.

Today we’re happy to announce that we’ve created a workaround which has been incorporated into the open-source webfontloader library as well as all newly-published Typekit kits. To take advantage of this fix in your kits, simply head to typekit.com and republish. To learn more about the bug, our workaround, and the future of web font loading detection, read on.

Font loading detection

Web browsers today don’t have a native API for telling the page when web fonts are loaded and ready for use. We work around this missing functionality by inserting an element into the DOM and retrieving its width and height. Then we add the font we are trying to load to the ‘font-family’ property of the element and set up a timer to periodically check the width and height of the element again. If at any point the width and height are different from the original size, we assume that the font has loaded. If no change is observed within five seconds, we assume the font has failed to load.

An additional complexity is the possibility of a metric compatible font being loaded. A metric compatible font is designed to have identical width and height for each glyph compared to another font. An example of this is the Liberation font family, which was designed to be metric compatible with Arial, Times New Roman, and Courier.

While metric compatible fonts are rare, they will actually cause a false negative in our detection strategy. From the perspective of our element, the width and height never change if the local font and the web font have identical metrics. The font detection code will wait until the timeout and then assume the font has failed to load.

To counteract metric compatible fonts, we introduce another element with a second local font fallback that has different metrics from the one we used before. This means that if the web font loads, both elements have the same size; if it doesn’t load, at least one of the elements will have a different size.

font-measuringA pair of elements used for font detection. The red borders show the boundaries of each span, which is where width and height are measured. Serif and sans-serif fallback fonts are used to counteract metric compatible fonts.

WebKit bug

While this size detection scheme works smoothly in most browsers, a bug in older WebKit versions makes it unreliable. WebKit versions that have this bug will switch to a “last-resort” font while loading web fonts. The last-resort font is the font you get when the browser does not know which font to use. This means it will not use the normal font fallback stack, and instead choose a platform-specific font.

Further complicating matters, on some platforms the browser will also try to choose a last-resort font based on the last item in the font stack that first references the web font. Other platforms may hard-code a default last-resort font, or use a strategy for selecting a last-resort font where selected unicode ranges map to different fonts.

This means that in our DOM element monitoring scheme, we’ll perceive up to two different changes in width and height. If we happen to measure the element while the last-resort font is in use, and the width or height is different, we’ll interpret that the web font has been loaded before it’s actually ready.

Workaround

We work around the bug by maintaining a list of last-resort fonts and measuring the width and height of each. If a change in width and height occurs on the DOM element and the bug is present, we’ll compare the width and height with each entry in our list of last-resort fonts. If a match is found, we know that the size change is probably not due to the web font loading, but rather to the WebKit bug switching the font to the last-resort font.

However, there is a problem with this approach when the web font we’re trying to load is metric compatible with one of the last-resort fonts. In this case, we’ll see the first change in width and height when the last-resort font becomes active, but never a second when the web font is ready.

To mitigate this problem, we’ve added a special case to the timeout. If the bug is present, and the font detection code times out while the width and height match the last-resort width and height, the webfontloader will assume the timeout is due to the last-resort font and web font having identical metrics.

Looking ahead: Native font events

The CSS3 Fonts Module recently introduced a new interface on the document object called fontloader. This interface can be used to explicitly load web fonts, or to notify when a font has loaded (or failed to load). This means that going forward, as browsers more regularly feature built-in support for detecting all the phases of web font loading, our workaround won’t be a required step.

The fontloader interface is pretty straightforward, and it will appear familiar as it was partly influenced by the design of the open-source webfontloader library that Typekit collaborates on and uses in kits. It has three properties called onloadstart, onload and onerror for when a font starts loading, when it finishes loading, and when it has failed to load.

document.fontloader.onloadstart = function (e) {
  console.log(e.fontface + ‘ has started loading’);
};

document.fontloader.onload = function (e) {
  console.log(e.fontface + ‘ has finished loading’);
};

document.fontloader.onerror = function (e) {
  console.log(e.fontface + ‘ has failed to load’);
};

It is also possible to use the fontloader interface to manually trigger loading a font from JavaScript. There is currently no browser support for the fontloader interface, but we’ll update webfontloader to use the native font events as soon as it is implemented in browsers.

Today, BlackBerry (formerly known as Research In Motion) officially launched their new BlackBerry 10 operating system for mobile devices. It includes numerous improvements over the previous version, but here at Typekit, we’re most excited about the new web browser. Built on top of the WebKit rendering engine, it brings support for the standard WOFF web font format to BlackBerry devices. We’re celebrating this advancement by announcing official Typekit support for BlackBerry 10 and up.

Screenshot of Typekit fonts rendering on a BlackBerry 10 device.
Screenshot of Typekit fonts rendering on a BlackBerry 10 device.

BlackBerry joins iOS, Android, and Windows Phone as the fourth major mobile operating system with support for WOFF, further boosting the share of mobile devices that have support for web fonts and the latest web standards.

In order to get BlackBerry 10 support with your own kits, just head to typekit.com and republish. If any of your kits were published on or after December 15, 2012 (when we first implemented experimental support for BlackBerry 10), then they should already work on the platform without any action on your part.

As with the rest of our supported mobile platforms, we’ve added an option to disable support for BlackBerry in kits. You’ll find this option in the Kit Editor under Kit Settings > Mobile Settings. Uncheck the box for BlackBerry and republish your kit to turn off support. This option is useful if you’re building a site that doesn’t require web fonts to be loaded on mobile platforms, or if you run into issues on BlackBerry and just want to turn the fonts off.

Settings for enabling and disabling support for mobile platforms, including BlackBerry.
Settings for enabling and disabling support for mobile platforms, including BlackBerry.

As always, if you encounter issues with web fonts on BlackBerry or another officially supported platform, contact us at support@typekit.com and we’ll be happy to help.

We’re delighted to announce a new partnership with Squarespace, the beautiful and intuitive website publishing platform that allows you to design and maintain a professional website without touching a line of code. Starting today, you can use Typekit fonts in your Squarespace site, pairing the quality and reliability of Typekit fonts with the sophisticated style editing tools in Squarespace. This powerful combination makes innovative web design and typography accessible to more people than ever before.

The integration is simple to use. Just go to the Preview section of your Squarespace site, open the Style Editor, click on a text element to bring up its Typography options, and choose a Typekit font to apply:

Squarespace Style Editor

As you select different fonts, you’ll see your site’s Preview update on the fly. When you’ve found the perfect font, just click Save, and you’re done. That’s all there is to it.

You don’t need to have a Typekit account to benefit from this partnership, but if you do have one and you’d like to use a specific kit from your Typekit account on your Squarespace site, you can do that, too. Just enter your kit ID in the General Settings area of your Squarespace site:

Kit ID setting

Once you save the setting, the fonts from that kit will show up in the Style Editor’s font menus, where you can use them as described above.

If you have any questions about how to use Typekit in your Squarespace site, just head on over to Squarespace to learn more.

Do you run a platform that would benefit from a Typekit-powered web font integration like the one described here? Drop us a line at support+partners@typekit.com to learn how to get started.

We’re celebrating the art of language and letters in this week’s sites we like.

Erik Marinovich screenshot

Leading with a homepage that attractively displays a gallery of his recent projects, Erik Marinovich‘s website keeps the focus on his beautiful lettering work, but does not disappoint when it comes to web type. Chaparral brings light, deliberate form to the main body text, while JAF Herb, a distinctively approachable blackletter, adds its blocky but stylish character to headers. Learning Curve adds a perfect flourish of color and swirl.

seanwes screenshot

Sean McCabe‘s website employs Le Monde Courrier STD throughout, its relaxed but orderly shape establishing a friendly, conversational tone for his neatly-organized lettering portfolio. The resulting feel is as close to a personal tour of his lovely lettering projects as we could ask for from behind a screen.

distil screenshot

“The right words in the right order can do great things,” opens the Distil Copywriting webpage. We think there’s also something to be said for the right words in the right typeface, and Distil nails this as well, pairing fresh Freight Sans with subtle Skolar on this well-paced site.

That’s all for this week; share sites that you like in the comments!

James Todd Design

Please join us in welcoming James Todd – and his typeface Garvis – to Typekit. Garvis is a mid-contrast text serif with a lively rhythm and good texture, and it works well across platforms thanks to manual TrueType hinting from James himself. Be sure to let James know that his hard work is appreciated.

text
Garvis Pro Book, with Italic heading (source text)

Garvis is available in four styles (Book, Italic, Semibold, and Bold). Upgrade to a Portfolio plan or higher to use it. If you’ve never tried Typekit, sign up (it’s free!) and upgrade when you’re ready.

Isn’t everything better with a friend? Pairing things up in this week’s sites we like.

Type Twins screenshot

Daniel Eden has pulled together another gorgeous collection of font profiles, this time featuring a catalogue of serif and sans pairings from Typekit. As educational as it is effective, this site explores how “twin” fonts such as Freight Text and Freight Sans naturally balance one another when used on the same page.

Karma screenshot

On the clean, appealing Karma website, FF Din lends an upbeat style to the body text, with Proxima Nova Alt neatly punctuating each section. Karma’s mobile hotspots are designed to be shared with friends, and they express this simple idea effectively and with optimism on this smoothly designed site.

Harmonizr screenshot

As Harmonizr aims to make modern group collaborations simpler and more fun to manage, their website leads by example, balancing the distinct personalities of FF Meta, Myriad, and Bello into one cohesive and dynamic message.

That’s all for this week; share sites that you like in the comments!

All manner of animals in this week’s sites we like.

Mandrill

Mandrill is MailChimp’s email notification platform for apps. Freight Sans, set in all caps with generous letter spacing, exemplifies the sleek and contemporary aesthetic of the site.

Stonehenge Veterinary Hospital

If the Stonehenge Veterinary Hospital puts as much care into their services as they do their website, your pet should be in good hands. Friendly, informative, and tasteful, they utilize FF Dax Compact, Museo Slab, and cute silhouetted critters to great effect.

Little Goat Chicago

If it’s true that you first eat with your eyes, you might take a bite out of your laptop. Little Goat Diner’s charming illustrated and animated splash screens are a clever prelude to their numerous and extensive menus, set in the appropriately playful Brandon Grotesque.

That’s all for this week; share sites that you like in the comments!