[HarfBuzz] hb-view

Adam Twardoch (List) list.adam at twardoch.com
Wed Mar 30 10:43:21 PDT 2011


> In general, turning off is =0, turning on is =1.  Default action (no
+, no -,
> no =) is to turn on.

...and =1 also means "1st alternate" while =2 would mean 2nd alternate
etc. Very good!

> What I probably do is add a --features as you propose, and later on
add an XML
> markup alternative to do more advanced stuff (probably like pango-view's
> --markup).

I think it's safe to assume that hb-view (at least from commandline)
should act *as if there is only ONE glyph run*, i.e. there is ONE font +
directionality + script + language + set of features. Just ONE (declared
externally, using the commandline parameters -- so there should be a
commandline switch to declare --direction).

This is the most basic case, and very common. Also, by doing this, you
allow testing to focus on Harfbuzz itself.

The only one interesting addition would be an option to output not the
PNG but instead it would output to stdout a simple string in the form of
something like:

((gid,x,y),(gid,x,y),(gid,x,y))

That is, the glyph ID, the x offset and the y offset for each glyph.
Nothing fancier. This could be fed into any other custom rasterizing
service that could do the imaging. Of course, the actual syntax could be
Json, XML or something like that.

If you're going to support some more complex markup on input, with mixed
directionality, mixed feature sets etc., this means you'd be doing
multiple glyph runs. Then you need to pull in FriBidi, XML input markup,
also some more refined output markup probably etc. This would still be
working within one line, I assume, but would be potentially be more
dependant on other libs. In such case, perhaps even multiple fonts,
multiple sizes? :)

In such case, I'd propose to make this other thing into a second tool
(something like hb-layout). Please keep hb-view simple -- one glyph run
only, and minimal dependancy on other libraries! (Right now it's glib,
cairo and libpng, and I'd like to keep it that way). This way, the
hb-view code can also be a MINIMAL EXAMPLE for coding (in fact, I just
showed hb-view.c to one of our developers, and he finally understood how
it works).

Then, hb-layout could be the more advanced thing, but this really sounds
like a somewhat separate project. Please keep hb-view simple, and if you
want, make another tool hb-layout that does more fancy stuff. :)

Best,
Adam

-- 

May success attend your efforts,
-- Adam Twardoch
(Remove "list." from e-mail address to contact me directly.)




More information about the HarfBuzz mailing list