[HarfBuzz] A few HarfBuzz-ng questions

Ed ed.trager at gmail.com
Wed Nov 17 14:25:05 PST 2010


Hi, Behdad and everyone,

I'm just now starting to look at and think about HarfBuzz-ng and have
some questions:

1. LICENSE:

   1.1. The COPYING file starts out:

        "Permission is hereby granted, without written agreement and without
        license or royalty fees, to use, copy, modify, and distribute this
        software and its documentation for any purpose, provided that the
        above copyright notice and the following two paragraphs appear in
        all copies of this software."

... but there isn't actually any "above copyright notice".  Shouldn't
this COPYING file start out with something like "Copyright (C) 2010
Google, Inc." or "Copyright (C) 2009  Red Hat, Inc." ?

   1.2.  Also, what IS the license?  OK, actually I did read
http://www.mail-archive.com/devel-announce-list@gnome.org/msg00273.html
so I see that this license
is commonly called "Old Style MIT".  It would be nice if at least the
COPYING file said this, or included a link to the "Relicensing
HarfBuzz" message URL.

2. SHAPERS: In void hb_shape(...) in hb-shape.cc, I see this:

      #if 0 && defined(HAVE_GRAPHITE)
      ...
      #endif

OK, please correct me if I am wrong, but looking here and at other
files (i.e., hb-graphite.cc),  it looks to me like Martin Hosken has
provided a way to tie Graphite into HarfBuzz and that "hb_shape()"
will eventually be the wrapper function that switches between either a
Graphite shaper or the HarfBuzz OpenType shaper.  And for the time
being somebody has just commented out processing with Graphite via the
"#if 0" statement.

But in the future, wouldn't it be nicer if a user could CHOOSE which
backend shaping engine to use instead of being forced to only use
Graphite because the compiler saw "#if defined(HAVE_GRAPHITE)"?

In other words, something more like the following, which would default
to HarfBuzz but would optionally allow any number of alternative
shapers when available:

void
hb_shape (
          hb_font_t    *font,
	  hb_face_t    *face,
	  hb_buffer_t  *buffer,
	  hb_feature_t *features,
	  unsigned int  num_features
          hb_shaper_engine_enum_t shaper)
{
          switch(shaper){
          case GRAPHITE_ENGINE:
               ... call Graphite stuff ...
               break;
          case UNISCRIBE_ENGINE:
               ... call Uniscribe stuff ...
               break;
          case AAT_ENGINE:
               ... call AAT stuff ...
               break;
          default:
               hb_ot_shape (font, face, buffer, features, num_features);
               break;
          }
}

Wouldn't something like the above make it convenient to do testing
across different shaping engines?

And I guess if you didn't want or need the flexibility of hb_shape(),
then you could always just use hb_ot_shape directly, right?

But as it currently is written, I don't really get the point of
hb_shape() if it is only there so Graphite testers can test Graphite
with HB.  Graphite is not the only alternative backend processor,
right?

Also, as I understand it, it is now common for font developers to test
their fonts on multiple platforms and to provide not only OpenType but
also AAT-specific features in their fonts.  Danh Hong's work on the
Khmer fonts comes to mind.  Wouldn't it be nice if a font developer
could have a simple program based on HarfBuzz that would allow a font
developer to easily and quickly test font rendering using different
backends?  This would be especially useful for the complex text layout
scripts of India, South East Asia, etc.  It would also be useful for
Harfbuzz script module developers.  For example, I might want to take
an SIL Graphite-based Burmese font which I know will render correctly
using Graphite, and use it while actually writing the HarfBuzz shaper
code for Burmese ...

OK, well just those 2 questions for now.  I may have more questions
after I have had time to examine the code more closely ...

Best - Ed



More information about the HarfBuzz mailing list