[HarfBuzz] HarfBuzz-JS?
Behdad Esfahbod
behdad at behdad.org
Tue Sep 4 11:50:39 PDT 2012
On 09/04/2012 07:36 AM, Lóránt Pintér wrote:
> Hi Behdad,
>
> Thanks for the quick response. We were also considering using emscripten, but
> with FreeType it looked too slow. With only HarfBuzz it might just work,
> though. Will look into this.
Right. Last time I played with it (got GLyphy running), it was too slow too,
but I hear they're making progress there. Plus, HarfBuzz is not as demanding
as FreeType.
> Having the UCDN project is really cool. When do you plan to integrate it with
> HarfBuzz? Is there a way I can make HarfBuzz use it already?
Just toss it in there and update hb_unicode_funcs_get_default(). I should do
that some time. Alternatively, at run time, you can use
hb_buffer_set_unicode_funcs().
The reason I have not integrated UCDN yet is that I think I can make a version
that is much smaller (say, ~50k instead of ~200k).
> I have a few other questions about how to use HarfBuzz for our needs:
>
> * Are there best practices to layout rich text, where
> fonts/colors/underlines/etc. can mix?
Nope. That's what PangoLayout is. But Pango is a different beast. When I'm
done with HarfBuzz I may look at doing an extensible paragraph layout library
on top of it (similar to ICU ParagraphLayout), but I don't know of any right
now. Alternatively, you may want to look into using ICU ParagraphLayout. But
then you have to wait for icu-le-hb, the shim layer that implements ICU
LayoutEngine API on top of HarfBuzz.
> * Is HarfBuzz capable of breaking lines at a certain width? Or is this
> something that I would have to do?
HarfBuzz only shapes a single run of text in one script, language, direction,
font. Everything else is higher level. For line breaking, etc, you need even
more Unicode properties :(.
> * Does it support OpenType features like Optical Bounds that work with
> line bounds?
Yes, but you have to instruct it to apply them (only the application knows
when a run is at line boundary).
> * Is there a list of features/languages/scripts supported by HarfBuzz
> somewhere?
As of now HarfBuzz supports all documented OpenType scripts as well as a few
undocumented ones. The only script missing that I know of is Myanmar that
seems to have a shaper in Windows 8. I will be working on that soon. Other
than that, there are few other South-East Asian scripts that need to be hooked
up, but those are mostly minority scripts and not supported by any other
system as far as I know.
As for languages and features, everything is supported, you just need to pass
them to HarfBuzz.
behdad
More information about the HarfBuzz
mailing list