[HarfBuzz] Ligatures and color changes

Lóránt Pintér lorant.pinter at prezi.com
Tue Feb 19 15:35:53 PST 2013


Using ZWNJ would be a great way of fixing it. And indeed it splits the ligature all right, but it also destroys the kerning. Here's a little test I did with HarfBuzz @ e0486fc1affd3796fb8f664e2e7fc208f1d2106c: (the font has an "fi" ligature, and has some kerning between "F" and ",")

Splitting the ligature with the ZWNJ works:

Shaped "fif\u200Ci" with features: [  ]
Glyph: #682, x_advance: 652
Glyph: #71, x_advance: 380
Glyph: #3, x_advance: 0
Glyph: #74, x_advance: 292

Kerning across the ZWNJ does not:

Shaped "F,F\u200C," with features: [  ]
Glyph: #39, x_advance: 483
Glyph: #13, x_advance: 242
Glyph: #39, x_advance: 563
Glyph: #3, x_advance: 0
Glyph: #13, x_advance: 242


Is it possible that doing this will be supported later in HarfBuzz?

--  
Lóránt Pintér
Developer at Prezi (http://prezi.com)



On Wednesday, February 20, 2013 at 12:09 AM, Jonathan Kew wrote:

> Another possible approach to "disabling" ligatures at the color change -
> given that harfbuzz doesn't know anything about color, that must be
> something that your application is maintaining - might be to insert a
> ZWNJ character at that position in the text. With the latest harfbuzz
> code, I believe kerning would still apply correctly across this, but it
> should prevent the ligature.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20130220/a8565e17/attachment.html>


More information about the HarfBuzz mailing list