Re: Writing an API that fixes the number of Rows of PangoLayout
- From: Parth Kanungo <kanungoparth gmail com>
- To: Behdad Esfahbod <behdad behdad org>
- Cc: gtk-i18n-list gnome org
- Subject: Re: Writing an API that fixes the number of Rows of PangoLayout
- Date: Wed, 17 Apr 2013 10:22:49 +0530
But, of course, it would be far better, if I can set the height in this scenario [ ellipsization mode = 0 & width = -1 ].
Do you have any suggestions ??
On Wed, Apr 17, 2013 at 10:11 AM, Parth Kanungo
<kanungoparth gmail com> wrote:
There is nothing wrong with pango_layout_set_height() or pango_layout_get_height();
I later figured that I was facing the issue because, I wanted to set the height of PangoLayout when ellipsization mode is 0 and width is -1.
But, that is impossible because the the Pango Reference Manual says, "
Height setting only has effect if a positive width is set on layout
and ellipsization mode of layout
is not PANGO_ELLIPSIZE_NONE
."
Hence, I have implemented the workaround.
On Wed, Apr 17, 2013 at 1:40 AM, Behdad Esfahbod
<behdad behdad org> wrote:
I don't understand your question. What's wrong with pango_layout_get_height()?
On 13-04-15 10:28 AM, Parth Kanungo wrote:
> Hi all,
>
> I found a work around by changing my render function. I am keeping track of
> the number of rows rendered so far, and breaking out of the loop, when that
> number reaches the maximum limit. This is a fix, but not an optimal one.
>
> I would like to keep my layout and render functions separate. Is there a way
> to ensure that the number of Rows can be adjusted in PangoLayout itself ??
>
> Thanks and regards,
> Parth
>
>
> On Mon, Apr 15, 2013 at 5:20 PM, Parth Kanungo <
kanungoparth gmail com
> <mailto:
kanungoparth gmail com>> wrote:
>
> Hi,
>
> In my application, I have assigned various parameters required by the
> PangoLayout, including the text. Now, I have to construct an API that can
> limit the number of maximum lines in this layout. Hence, if I say that
> maxLines = 3, only 3 lines should be present in the PangoLayout.
>
> I tried to do that by adjusting the height. But, it seems that the number
> of lines ( pango_layout_get_line_count() ) depends on the text set through
> pango_layout_set_text() and not on pango_layout_set_height().
>
> Can you provide some pointers on how such an API be written?
> Tell me, if I am wrong somewhere.
>
>
> Thanks and regards,
> --
> Parth
>
--
behdad
http://behdad.org/
--
Parth
--
Parth
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]