Thanks for the answear.<br><br>I found that Freetype and Harfbuzz don't give the same advance for some glyph. Since I guess it's only looking to the font setting, how is that possible? <br><br>I guess Harfbuzz is doing more than just looking to the font, I should use his advance then.<br>
<br><br><br><div class="gmail_quote">2009/12/4 Lars Knoll <span dir="ltr"><<a href="mailto:lars.knoll@nokia.com">lars.knoll@nokia.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Friday 04 December 2009 08:21:16 am Nicolas Lacombe wrote:<br>
> problem solved:<br>
<br>
[snip]<br>
<div class="im"><br>
> I'm still having problem rendering complexe sentances, but it looks like<br>
> working fine on small letter... I'm wondering if I have to take into<br>
> account the advances given by the shaper... for now I'm just letting<br>
> freetype taking care of it for me... need some test.<br>
<br>
</div>There's a reason harfbuzz delivers you advances and positions for the glyphs<br>
;-) You'll need to use them to get correct layout.<br>
<div class="im"><br>
> Are you aware of any problem in the arabic/syriac translation module, or is<br>
> it suppose to work fine?<br>
<br>
</div>We're using the code directly in Qt and haven't gotten any bug reports about<br>
problems with arabic or syriac for quite some time.<br>
<br>
Cheers,<br>
Lars<br>
<div><div></div><div class="h5"><br>
><br>
> Behdad answear to this question with:<br>
><br>
> "Supposed to work fine. Though you need a bidi engine also. Try setting<br>
> bidi level to 1 instead of 0..."<br>
><br>
><br>
> Wich does not appear to change a lot of things. However I resolved my<br>
> problem by changing font... they are very important, and I'm having trouble<br>
> to find good Persian and Syriac font.<br>
><br>
><br>
><br>
> 2009/12/2 Nicolas Lacombe <<a href="mailto:n.lacombe@gmail.com">n.lacombe@gmail.com</a>><br>
><br>
> > Hi,<br>
> ><br>
> > I'm using HarfBuzz with freetype to render arabic text. I must say that<br>
> > this library was exactly what I was looking for, great job!<br>
> ><br>
> > Anyway I spotted something strange, I don't know if it's a bug or if it's<br>
> > me that didn't understand correctly the spirit behind Harfbuzz.<br>
> ><br>
> > When rendering arabic letter equivalent of la , it should give me only<br>
> > one glyph (لا).<br>
> ><br>
> > However, Harfbuzz render me correctly the glyph, but do not get rid of<br>
> > the a. See screenshot here:<br>
> ><br>
> > <a href="http://img522.yfrog.com/i/21856341.png/" target="_blank">http://img522.yfrog.com/i/21856341.png/</a><br>
> ><br>
> ><br>
> > Here's my (simplified) render loop:<br>
> ><br>
> > HB_ShaperItem shaper_item;<br>
> ><br>
> > shaper_item.string = (HB_UChar16 *) g_utf8_to_utf16((gchar*)txt, -1,<br>
> > NULL, &numberOfWords, NULL);<br>
> ><br>
> > shaper_item.kerning_applied = 0;<br>
> > shaper_item.stringLength = 0;<br>
> > shaper_item.shaperFlags = 0;<br>
> > shaper_item.font = &hbFont;<br>
> > shaper_item.face = hbFace;<br>
> > shaper_item.glyphIndicesPresent = 0;<br>
> > shaper_item.initialGlyphCount = 0;<br>
> ><br>
> > shaper_item.item.bidiLevel = 0;<br>
> ><br>
> > out_glyphs = (HB_Glyph*)malloc(numberOfWords * sizeof(HB_Glyph));<br>
> > memset(out_glyphs, 0, numberOfWords * sizeof(HB_Glyph));<br>
> > out_attrs = (HB_GlyphAttributes*)malloc(numberOfWords *<br>
> > sizeof(HB_GlyphAttributes));<br>
> > memset(out_attrs, 0, numberOfWords * sizeof(HB_GlyphAttributes));<br>
> > out_advs = (HB_Fixed*)malloc(numberOfWords * sizeof(HB_Fixed));<br>
> > memset(out_advs, 0, numberOfWords * sizeof(HB_Fixed));<br>
> > out_offsets = (HB_FixedPoint*)malloc(numberOfWords *<br>
> > sizeof(HB_FixedPoint));<br>
> > memset(out_offsets, 0, numberOfWords * sizeof(HB_FixedPoint));<br>
> > out_logClusters = (unsigned short*)malloc(numberOfWords *<br>
> > sizeof(unsigned short));<br>
> > memset(out_logClusters, 0, numberOfWords * sizeof(unsigned short));<br>
> ><br>
> > shaper_item.glyphs = out_glyphs;<br>
> > shaper_item.attributes = out_attrs;<br>
> > shaper_item.advances = out_advs;<br>
> > shaper_item.offsets = out_offsets;<br>
> > shaper_item.log_clusters = out_logClusters;<br>
> > shaper_item.num_glyphs = numberOfWords;<br>
> > shaper_item.stringLength = numberOfWords;<br>
> ><br>
> > int l = 0;<br>
> > while(1){<br>
> ><br>
> > shaper_item.num_glyphs = numberOfWords;<br>
> > if (!hb_utf16_script_run_next(NULL, &shaper_item.item,<br>
> > shaper_item.string, numberOfWords , &iterator))<br>
> > break;<br>
> ><br>
> > memset(out_glyphs, 0, numberOfWords * sizeof(HB_Glyph));<br>
> > HB_ShapeItem(&shaper_item);<br>
> > for (unsigned int j = 0; j < shaper_item.item.length; j++)<br>
> > {<br>
> > ind[l++] = out_glyphs[j];<br>
> > }<br>
> > }<br>
> ><br>
> > so at the end, ind contains all the index of the glyph I need to draw.<br>
> ><br>
> > Is there a way harfbuzz can tell me to get rid of a glyph?<br>
> ><br>
> > Thanks, Nico.<br>
><br>
</div></div>_______________________________________________<br>
HarfBuzz mailing list<br>
<a href="mailto:HarfBuzz@lists.freedesktop.org">HarfBuzz@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/harfbuzz" target="_blank">http://lists.freedesktop.org/mailman/listinfo/harfbuzz</a><br>
</blockquote></div><br>