[HarfBuzz] HB/FT intergration with Python and PHP?

Behdad Esfahbod behdad at behdad.org
Sat Dec 23 17:54:10 PST 2006

On Sat, 2006-12-16 at 00:24 -0500, Adam Twardoch wrote:
> I wonder if you guys have a clue what kinds of lightweight 
> implementations are available that would allow simple text imaging from 
> Python, and from PHP.

FreeType can be accessed from the gd PHP module.  The API takes Unicode
string though, not glyph indices IIRC.  There is no binding whatsoever
for HarfBuzz.  In fact, the only place it's used is in Pango and Qt

> I'm looking for opensource ways to implement something like this:
> http://www.bitstream.com/font_rendering/products/panorama/panowebdemo.html
> so I presume this would also need to integrate FreeType.

You sure can do that with HarfBuzz+FreeType.

I suggest using cairo [1] for the graphics (and font rendering) part,
and compile HarfBuzz into a shared library (which the current Makefiles
do), and use Python's ctype module (included in Python 2.5) to call into

> Is it possible to apply arbitrary OpenType Layout features in HB using 
> the feature tags ("smcp", "onum" etc.)? Also, is it possible to 
> explicitly apply features for specific languagesystems (e.g. latn/TRK or 
> cyrl/SRB)?

Yes, HarfBuzz just provides the implementation and leaves it to the user
to decide which features to apply.  It lets you scan scripts and
languagesystems, so everything on the Panorama webdemo site can be
implemented using it.

> Regards,
> Adam

Happy Holidays

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

More information about the HarfBuzz mailing list