Re: wrong pixel extents retrieved from PangoLayout of arabic text



Hello Behdad,

I guess that the width rendered in PangoLayout is probably target-dependent. Hence, I have modified the previous code, so that, it runs for various width values ( ranging from 50 to 250 ). I hope that this will be able to help reproduce the issue.

I still encounter the same issue, i.e., the pango_layout_get_pixel_extents()  return a width value which is greater than the width value I have set. 

The test code,  output images and output log file are attached here: (https://sites.google.com/site/fontengine/issue1)

The attached log file suggests that almost all the widths are different from the width I have set.

If the issue gets reproduced, how do you think we can resolve it?
If not, then how can I check if my line-breaking is failing ?

Thanks and regards,
Parth


On Mon, Apr 22, 2013 at 11:17 PM, Behdad Esfahbod <behdad behdad org> wrote:
On 13-04-22 01:31 AM, Parth Kanungo wrote:
> Hello Behdad,
>
> Which version of Pango are you using ?  (I'm using pango-1.29.4)

1.33.7.  Shouldn't make any difference.

> Moreover, do I need to make any changes in configuration to enable the
> line-breaking algorithm in Arabic? Or, it is enabled by default?

Nope.  It should all just work.

> Thanks.
>
> On Sat, Apr 20, 2013 at 1:18 AM, Behdad Esfahbod <behdad behdad org
> <mailto:behdad behdad org>> wrote:
>
>     Your code works just fine for me.  Have no idea how it may behave that way for
>     you.  Looks like the line-breaking algorithm is somehow failing.  That's
>     extremely suspect.  I don't have much else to add.
>
>     behdad
>
>     On 13-04-19 07:32 AM, Parth Kanungo wrote:
>     > Hello,
>     >
>     > I am facing an issue related to the pixel extents of PangoLayout.
>     > Here is what I have done.
>     >
>     >
>     > I am rendering Arabic Text.
>     >
>     >          gunichar2 text[] = {  0x0644, 0x0627, 0x0020, 0x064A, 0x0648,
>     0x062C,
>     > 0x062F, 0x0020, 0x0645, 0x0644, 0x0641, 0x0020, 0x0641, 0x064A, 0x062F,
>     > 0x064A, 0x0648, 0x0020, 0x0645, 0x062A, 0x0627, 0x062D, 0x0020, 0x062D,
>     > 0x0627, 0x0644, 0x064A, 0x064B, 0x0627, 0x002E, 0 };
>     >
>     > char* inputStr = g_utf16_to_utf8(text, 28, &itemsRead, &itemsWritten,
>     &error);
>     > pango_layout_set_text(layout, (const char*)inputStr, -1);
>     >
>     > I have set the height, width and other parameters of PangoLayout.
>     >
>     > pango_layout_set_height(layout,100*PANGO_SCALE);
>     > pango_layout_set_width(layout,215*PANGO_SCALE);
>     > pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER);
>     > pango_layout_set_wrap(layout, PANGO_WRAP_CHAR);
>     >
>     > On output, it appeared to me as if the left-most portion of the text was
>     > getting clipped. Hence, I printed the pixel-extents of the PangoLayout.
>     > (Output image:  https://sites.google.com/site/fontengine/issue)
>     >
>     >
>     > This is what I got:
>     >
>     > logical_rect:
>     > x: -6
>     > y:  0
>     > w:  227
>     > h:  72
>     >
>     > ink_rect
>     > x: -5
>     > y:  8
>     > w: 226
>     > h:  64
>     >
>     > I don't understand how can I get a negitive x OR, a width greater than the
>     > width that I have manually set on PangoLayout
>     > Moreover, I found that this issue occurs only in case of arabic text.
>     >
>     > Is this a known bug? OR, have I done some mistake here?
>     >
>     > My source code (test.cpp) has been shared here:
>     >  https://sites.google.com/site/fontengine/issue/
>     > <https://sites.google.com/site/fontengine/issue>
>     >
>     > Thanks a lot.
>     >
>     > --
>     > Parth
>
>     --
>     behdad
>     http://behdad.org/
>
>
>
>
> --
> Parth

--
behdad
http://behdad.org/



--
Parth 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]