[HarfBuzz] Using HarfBuzz to get final glyphs
Pierre Marchand
capparis at free.fr
Wed Mar 19 01:52:14 PDT 2008
Vous (Steve Mills) avez écrit :
> We're looking at options for updating a 3rd party library (AGL from
> Alphamask, now dead, so we maintain it ourselves) we use for cross-
> platform rendering of vector objects, bitmaps, and text. Right now it
> does not allow for any of the nice OpenType features such as
> ligatures, contextual glyph substitution, etc. This is because it only
> knows how to do 1:1 character->glyph lookups, then caches those
> glyphs. So what I need to do is possibly rip out this caching scheme
> it uses and find something that will give me a final list of glyphs
> with all possible glyph substitutions in place (depending on which
> options the user wants to use, of course). We can then either use our
> existing method of rendering the glyphs (get the path with ATS), or
> possibly let some other system such as HarfBuzz create and cache each
> glyph's bitmap that we'll then blit to our drawing surface.
>
> So, can HarfBuzz do this? We already use FreeType in our server
> products, but we need to handle the OpenType features on all platforms
> (Mac, Unix's, Solaris, Windoze, etc). It's very disappointing that
> they didn't extend FreeType to do this sort of thing. I've spent
> nearly an hour looking around the HarfBuzz site and being thoroughly
> confused by trying to learn how to use yet another wiki and yet
> another source repository, seeing lots of links that go nowhere
> helpful, and generally not finding a lot of documentation on how to
> use HarfBuzz, so I'm a bit burned out right now.
Hi,
If you are looking for raw OTF support, you can see Harfbuzz in use in
Fontmatrix in a simpler way (though not so much commented) than in Pango or
Qt. Raw support means here that it does not "shape" strings as required by
various languages. Although I use Harfbuzz for a while now I must admit that
some parts are stil black magic for me :) If you want to quickly start, you
might want to look into harfbuzz-gsub.h in Harfbuzz source where you’ll find
quite self-explanatory prototypes, considering you’re familiar with OTF
(else, you can’t save a tour at http://www.microsoft.com/typography/otspec/).
From my point of view, GPOS corresponding functions are not so easy because
they require that you setup a HB_Font (but at some point you have to manage
it in order to get at least "kern" feature).
If you’re looking for an actual internationalization solution, Harbuzz will be
the good horse. But as of today, if I have understood well, it’s not in its
definitive state nor taste :). In Fontmatrix, I have had good & not so good
results depending of scripts and fonts, e.g. Arabic seems to work with
ArialUni but Devanagari with Lohit Hindi makes it crashes (can’t know if it
comes from the fact that it interferes with HB in Qt or if I did something
wrong) or some other combination just does not work, etc.
Note: Reading your message again, I see that I missed the point. HB does not
manage glyphs (nor in vector nor in bitmap) itself but rather glyph indexes.
It’s up to the caller to pick up the corresponding shapes in the fontfile
(generally with the help of Freetype).
Note2: I hope some HB dev will come clarify things :)
--
Pierre Marchand
More information about the HarfBuzz
mailing list