Family Mobile Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 26 April 2011

Streamline your web font requests. Introducing “text=”

Posted on 11:45 by Unknown
Oftentimes, when you want to use a web font on your website or application, you know in advance which letters you’ll need. This often occurs when you’re using a web font in a logo or heading.

That’s why we’re introducing a new beta feature to the Google Web Fonts API. The feature is called “text=”, and allows you to specify which characters you’ll need. To use it, simply add “text=” to your Google Web Fonts API requests. Here’s an example:
<link
href='http://fonts.googleapis.com/css?family=Special+Elite&text=MyText'
rel='stylesheet' type='text/css'>

Google will optimize the web font served based on the contents of this parameter. For example, if you only require a few letters for a logo, such as “MyText”, Google will return a font file that is optimized to those letters. Typically, that means Google will return a font file that contains only the letters you requested. Other times, Google might return a more complete font file, especially when that will lead to better caching performance.

The “text=” parameter has the potential to dramatically cut down web font file size. In some preliminary studies, web fonts can be cut from 35k down to just 5k (or even smaller), if only short strings of text are required. If you have a longer string, you can shorten the request by removing duplicate characters, as the order of characters in the string doesn’t matter.

The effect of this feature is even more pronounced on mobile devices, where connection speeds are limited. Using the text= parameter, you can ensure your users will have a great, quick loading experience.

We’re happy to say that the feature also works for international fonts. There’s no need to also specify the subset= parameter, as text= has access to all the characters in the original font. To access Unicode characters, use standard technique of url-encoding the UTF-8 representation of the string. Therefore, ¡Hola! is represented as: text=%c2%a1Hola! .

Enjoy!

Posted by Raph Levien, Engineer, Google Web Fonts
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • Navigate the font directory more easily and submit your fonts
    To make it easier for you to navigate all the tools and documentation that are part of the Font API we have created a unified navigation for...
  • Introducing the Ubuntu Font Family to the web
    Google and the Ubuntu project have today released the Ubuntu Font Family to the world through the Google Font Directory. The new Ubuntu Fon...
  • New Fonts for the New Year
    The Google Font team is excited to announce the addition of a handful of high-quality web fonts for you to use freely on your website or blo...
  • Web fonts go mobile
    Google Fonts now work for the vast majority of mobile devices, including Android 2.2+ devices, iPhone and iPad! And now with the recent rel...
  • A more fontastic Google Docs
    (Cross-posted from the Official Google Blog and the Google Docs Blog ) Documents without font choices are like photographs without colors. ...
  • Interview with Astigmatic
    We recently got a hold of Brian Bonislawsky, founder of the Astigmatic One Eye Typographic Institute , to describe his design process and mo...
  • Optimizing the use of the Google Font API
    At Google, we're absolutely obsessed with making the web faster, and delivering the lowest possible latency to users. Naturally, with th...
  • New! Web Font Statistics
    We're excited to announce the launch of two new features of the Google Font Directory . 1) Font level statistics Curious to see which fo...
  • International Fonts Launch Today
    Today is a big day for the Google Font API. We have officially added our first non-Latin fonts to the Google Font API and Google Font Direc...
  • Google documents, now with web fonts!
    (Cross-posted from the Google Docs Blog ) In the past month we’ve made updates both big and small to Google Docs, and today we’re announcing...

Categories

  • adobe
  • google documents
  • google fonts
  • halloween
  • interview
  • kickstarter
  • monotype
  • new fonts
  • ofl
  • omnibus type
  • rosario
  • typekit
  • ubuntu
  • web fonts

Blog Archive

  • ►  2013 (3)
    • ►  May (1)
    • ►  April (2)
  • ►  2012 (10)
    • ►  October (1)
    • ►  September (1)
    • ►  August (3)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ▼  2011 (13)
    • ►  November (2)
    • ►  October (2)
    • ►  September (1)
    • ►  July (1)
    • ►  June (2)
    • ▼  April (1)
      • Streamline your web font requests. Introducing “te...
    • ►  March (2)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (11)
    • ►  December (3)
    • ►  November (2)
    • ►  October (2)
    • ►  September (3)
    • ►  August (1)
Powered by Blogger.

About Me

Unknown
View my complete profile