[HarfBuzz] towards an OT debugger

Behdad Esfahbod behdad at behdad.org
Fri Dec 18 12:48:47 PST 2015


Hi Martin,

According to gmail, I've had four requests from you over the last four
years, to add debugging API to HarfBuzz.

Every time I sit down with Jonathan to debug something in HB, I wish I have
had added debugging API.  So when Jonathan had to leave early today, I
decided to spend the rest of the day adding debugging API.  And, while it's
nothing to brag about, I'm happy to say that I've done that now.

It's very simple library API: a single message() function that received
buffer, font, and the text message.  The debugger API will be fully defined
in terms of what's in the text message.  I believe this has the right
balance between simplicity, expressiveness, and extensibility.

Right now there are not many messages, just one.  But we can together
figure out what kind of message API is desired and patch towards that.

I already added "support" for this to hb-shape / hb-view as well as
sample.py.  I envision we can add a libharfbuzz-support library as well,
that adds a debugger object, colorful diff facilities, etc.  I also wonder
weather some other functionality (buffer serialization?) should also move
to the support library.

Let the discussion start!

Cheers,
behdad
On Mar 25, 2015 9:59 AM, "Martin Hosken" <mhosken at gmail.com> wrote:

> Dear Behdad,
>
> Thanks for your help in getting the debug output from hb. I've been
> playing and have some thoughts about how to use the existing debug
> framework to help with font development.
>
> 1. It would be great if the HB_DEBUG variable controlled which categories
> of debug are output, rather than the depth. For example, I don't need the
> SANITIZE debug (and pretty much anything else than APPLY).
>
> 2. It would be good if we can get the lookup index, somehow, into the
> debug report. I don't think it's stored in the lookup. But I may be wrong.
>
> 3. Is there a way to print out the whole buffer as per, perhaps, the
> output from hb-shape. And can we call that from when a lookup starts.
>
> These would be the basics. I'm sort of thinking about creeping up on the
> problem rather than building some massive implementation layer either to
> the side or inside. If we can get the debug system to print at least the
> info we need, we can have it call a side library to do the debug reporting
> later on.
>
> TIA,
> Yours,
> Martin
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20151218/c5498364/attachment.html>


More information about the HarfBuzz mailing list