[HarfBuzz] Question about zero width glyphs in shaping output

Khaled Hosny khaledhosny at eglug.org
Tue Dec 8 03:14:40 PST 2015


On Mon, Dec 07, 2015 at 09:13:23PM +0530, Deepak Jois wrote:
> Maybe this is a bit related to Khaled’s question earlier about control
> characters inside ligatures, but I wanted to start a new thread.
> 
> When I shape text with Noto Nastaliq, I notice a bunch of zero-width
> glyphs generated
> 
> $> hb-unicode-encode U+06CC,U+06C1 |  hb-shape notonastaliq.ttf
> [HehFin=1+472|TwoDotsBelowNS=0 at 310,-383+0|sp2=0+0|BehxIni.outS1=0 at 0,-68+731]
> 
> 1. What is the purpose of these zero-width glyphs?

That is something internal to the font, they are not glyphs inserted by
HarfBuzz.

> 2. If I am rendering the shaped output to a PDF file (for e.g. when
> using Harfbuzz with LuaTeX), do I need to care about these zero-width
> glyphs at all? How will they affect rendering

You should just output the glyph as returned by HarfBuzz,
second-guessing it is likely to be wrong. If a character should be
invisible HarfBuzz will replace it by the space glyph, so you need not
worry about this, unless you really know what you are doing.

Regards,
Khaled


More information about the HarfBuzz mailing list