Hi,<br><br>I have attached the screenshot with email. As you can see the last word has 2 characters separate which should be attached.<br><br>A part of code that renders the text in attached images is:<br><br>hb_buffer_t *buff = hb_buffer_create();<br>
hb_buffer_set_unicode_funcs(buff, hb_icu_get_unicode_funcs());<br>hb_buffer_set_direction(buff, HB_DIRECTION_RTL);<br>hb_buffer_set_script(buff,HB_SCRIPT_ARABIC);<br>hb_buffer_set_language(buff, hb_language_from_string("ar", 2));<br>
hb_buffer_add_utf32(buff, text,-1 , 0, -1);<br>hb_shape(hb_font, buff, NULL, 0);<br><br>int num_chars = hb_buffer_get_length(buff);<br>hb_glyph_info_t *glyphInfos = hb_buffer_get_glyph_infos(buff, &num_chars);<br>hb_glyph_position_t *glyphPos = hb_buffer_get_glyph_positions(buff, &num_chars);<br>
<br>int count = 0;<br>int dst_ptr = 0;<br>int dst_x = 0;<br><br>for (;count < num_chars;++count)<br>{<br> int src_y;<br> unsigned int dst_y;<br><br> glyph_index = glyphInfos[count].codepoint;<br><br> if (FT_Load_Glyph(ft_face, glyph_index, FT_LOAD_RENDER))<br>
continue;<br><br> if (FT_Get_Glyph(ft_face->glyph, ft_glyph))<br> continue;<br><br> // render glyph at dst_x + glyph_bitmap->left<br> renderGlyph(ft_glyph, dst_x + glyph_bitmap->left);<br>
<br> dst_x += ((glyphPos[count].x_advance) >> 6);<br>}<br><br>Regards,<br>Sami<br><br><div class="gmail_quote">On Thu, Jul 12, 2012 at 1:05 AM, Behdad Esfahbod <span dir="ltr"><<a href="mailto:behdad@behdad.org" target="_blank">behdad@behdad.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 07/11/2012 12:10 PM, Samiullah Khawaja wrote:<br>
> Hi,<br>
><br>
> I am trying to render Arabic text using harfbuzz. The problem is that when i<br>
> glue the glyphs using the x_advance most of the glyphs are glued correctly.<br>
> but in some cases there is 1 or 2 pixel distance between glyphs.<br>
><br>
> I debugged through the harfbuzz code and was able to confirm that the GPOS<br>
> table is present in the font face. But the GPOS data doesn't seem to be<br>
> applied to the buffer. That is why when i get glyph positions only x_advance<br>
> values are there but the x_offset and y_offset values are always 0.<br>
><br>
> Am I missing something here? Please help.<br>
<br>
</div>Easiest if you post sample code and output. I don't think anyone can help you<br>
based on the description of the problem.<br>
<br>
behdad<br>
<div class="im"><br>
> Thanks,<br>
> Sami<br>
><br>
> On Thu, Jul 5, 2012 at 7:43 PM, Samiullah Khawaja <<a href="mailto:sami.khawaja@gmail.com">sami.khawaja@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:sami.khawaja@gmail.com">sami.khawaja@gmail.com</a>>> wrote:<br>
><br>
> Thanks guys.<br>
><br>
> I am trying to link ICU with harfbuzz... will update you guys with it.<br>
><br>
> Regards,<br>
> Sami<br>
><br>
><br>
> On Thu, Jul 5, 2012 at 7:37 PM, Behdad Esfahbod <<a href="mailto:behdad@behdad.org">behdad@behdad.org</a><br>
</div><div class="im">> <mailto:<a href="mailto:behdad@behdad.org">behdad@behdad.org</a>>> wrote:<br>
><br>
> On 07/05/2012 08:51 AM, Tom Hacohen wrote:<br>
> > As for the unicode functions: I think they are used in harfbuzz only for<br>
> > script detection, wide-characters and mirrored characters (probably<br>
> more),<br>
><br>
> More. Fallback mark positioning, cluster formation, normalization. If<br>
> you are<br>
> willing to give those all up, well, you may as well not use HarfBuzz<br>
> to begin<br>
> with :). Not exactly that, but close.<br>
><br>
> behdad<br>
><br>
><br>
><br>
><br>
> --<br>
> Samiullah Khawaja<br>
> Software Engineer<br>
</div>> email: <a href="mailto:sami.khawaja@gmail.com">sami.khawaja@gmail.com</a> <mailto:<a href="mailto:sami.khawaja@gmail.com">sami.khawaja@gmail.com</a>><br>
> voice: <a href="tel:%2B%2892%29%200321-4184324" value="+923214184324">+(92) 0321-4184324</a> <tel:%2B%2892%29%200321-4184324><br>
<div class="im">><br>
><br>
><br>
><br>
> --<br>
> Samiullah Khawaja<br>
> Software Engineer<br>
</div>> email: <a href="mailto:sami.khawaja@gmail.com">sami.khawaja@gmail.com</a> <mailto:<a href="mailto:sami.khawaja@gmail.com">sami.khawaja@gmail.com</a>><br>
> voice: <a href="tel:%2B%2892%29%200321-4184324" value="+923214184324">+(92) 0321-4184324</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Samiullah Khawaja<br>Software Engineer<br>email: <a href="mailto:sami.khawaja@gmail.com">sami.khawaja@gmail.com</a><br>voice: +(92) 0321-4184324<br>