diTii.com Digital News Hub

Sign up with your email address to be the first to know about latest news and more.

I agree to have my personal information transfered to MailChimp (more information)


Introducing “text=” Beta to Google Web Fonts API to Streamline Web Font Requests

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.

Google recently introduced a new beta feature to the Google Web Fonts API, callled “text=”, that allows you to specify which characters you’ll need. To use it, simply add “text=” to your Google Web Fonts API requests.

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.

Here’s an example:

“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’ve a longer string, you can shorten the request by removing duplicate characters, as the order of characters in the string doesn’t matter. Of course, the font you get back is optimized even if there are duplicate character in the request,” Google explained.

“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,” added Google.

[Source: Web Font Blog]

Share This Story, Choose Your Platform!

Get Latest News

Subscribe to Digital News Hub

Get our daily newsletter about the latest news in the industry.
First Name
Last Name
Email address
Secure and Spam free...