HelloWorld123456789
HelloWorld123456789

Reputation: 5359

Harfbuzz - Text to Glyph to Text

Recently, I came across Harfbuzz for text shaping, specifically for Indic texts. In my previous experience, I used ArabicShaping for shaping Arabic characters. In this case, the input is the pre-shaped text and the output is the shaped one.

In Harfbuzz, however, I can see the shape method shapes the text and returns the glyphs and the clusters instead. My objective is to convert the pre-shaped text to a shaped one. I don't want to draw/view the text. I just want a char[] which will contain the shaped one (just like in case of ArabicShaping).

  1. Is there any way the above can be achieved using Harfbuzz? If not, is there any workaround?
  2. Am I using Harfbuzz for solving the correct problem? Is there any other library that I can use to achieve this?

Upvotes: 0

Views: 623

Answers (1)

behdad
behdad

Reputation: 376

ArabicShaping must have confused you. There's no such thing as "pre-shaped text" in general. What do you mean "convert the pre-shaped text to a shaped one"? Shaping, what HarfBuzz does, converts from characters to glyphs. The reverse is a non-deterministic process that HarfBuzz does NOT provide.

Upvotes: 2

Related Questions