Build great font tools and services with sfntly
By Stuart Gill, sfntly ArchitectToday we’re
releasing the
sfntly font
programming library as open source. Created by the Google Internationalization Engineering
team, the sfntly Java and C++ library makes it easy for programmers to build high performance
font manipulation applications and services. sfntly is really, really fast: Raph Levien,
Google Web Fonts Engineer, says, "Using sfntly we can subset a large font in a millisecond.
It’s faster than gzip'ing the result."
Starting today, both Java and
C++ programmers can use sfntly to quickly and easily develop code to read, edit, and subset
OpenType and TrueType fonts. The
Google Web
Fonts team uses the Java version to dynamically subset fonts, and the
Chrome/Chromium browser uses the C++ version to subset fonts for PDF printing.
sfntly (\s-’font-lē\) was built from the ground up to provide high
performance, an easy to use API, and both high-level and low-level access to font data. Font
objects are both thread safe and high performance while still providing access for editing.
After about a year of internal development sfntly is stable enough to move it into open source
and share with others.
Currently, sfntly has editing support for most
core TrueType and OpenType tables, with support for more tables being added. Using sfntly’s
basic sfnt table read and write capability, programmers can do basic manipulation of any of
the many font formats that use the sfnt container, including TrueType, OpenType, AAT/GX, and
Graphite. Tables that aren’t specifically supported can still be handled and round-tripped by
the library without risk of corruption.
sfntly is already capable of
allowing many really exciting things to be done with fonts, but there is much more planned:
expanding support for the rest of the OpenType spec and other sfnt-container font formats,
other serialization forms, better higher level abstractions, and more.
I encourage you to you join us on our journey as a user or a contributor.
Stuart Gill is a Software Engineer in the
Internationalization Engineering team at Google where he focuses on fonts and text. When not
doing that he is playing the blues on his guitar, studying Japanese, or puttering about the
house and garage.Posted by Scott Knaster,
Editor