<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I'm seeing strange bugs in my toolkit after converting my font layout engine to harfbuzz-ng shaping. While most fonts work alright, some have wrong X axis density as you can see on this (rather big) screenshot: <a href="http://meeloo.net/~meeloo/nui_harfbuzz.png">http://meeloo.net/~meeloo/nui_harfbuzz.png</a></div><div><br></div><div>At least two fonts have problems: Helvetica.dfont (from Mac OSX Snow Leopard), Meiryo.ttf (from OSX too) and the the open source Vera Sans Mono from bitstream.</div><div>As you can see on the screenshot, all sizes of Vera Sans Mono don't show the same problem, as the 8pt version looks alright.</div><div><br></div><div>My toolkit uses harfbuzz + freetype2 with the harfbuzz provided freetype glue code. The unicode callbacks are implemented via a mix of custom code (for script detection) and ucdata (for code point features).</div><div><br></div><div>You can have a look at the code here <a href="https://github.com/meeloo/nui3/tree/utf8/src/Font">https://github.com/meeloo/nui3/tree/utf8/src/Font</a> . I call harfbuzz only in one function: <a href="https://github.com/meeloo/nui3/blob/utf8/src/Font/nuiFontBase.cpp#L2114">https://github.com/meeloo/nui3/blob/utf8/src/Font/nuiFontBase.cpp#L2114</a></div><div><br></div><div>Before using harfbuzz I was using a very naive algorithm (that is just using glyph advances) but I was not having these problems (but I couldn't handle complex scripts either ;-) ).</div><div><br></div><div>I would like to know if this is a bug on my part (most likely) or a problem in the shaping algorithm.</div><div><br></div><div>Thank you very much if you've read this far.</div><br><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>-- </div><div>Sébastien Métrot</div><div>libnui author</div><div><a href="http://libnui.net">http://libnui.net</a></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></body></html>