[Cogl] Can you adjust the vertical line spacing for ClutterText?

Reza Ghassemi reza.robin1 at gmail.com
Thu Jun 26 12:15:21 PDT 2014


Hi Robert,
The way the PangoLayout is created and cached (up to 6 different cached
layouts for one actor cached based on width) makes it impossible to grab
the actual layout used to render the text using clutter_text_get_layout().
 I must change clutter_text_create_layout_no_cache() to get the spacing set
properly on all the cached versions.  I'm going to subclass clutter-text
and make minimal changes to the actual clutter code so upgrading will be
easier.

>From clutter-text.c:
/* We need at least three cached layouts to run the allocation without
 * regenerating a new layout. First the layout will be generated at
 * full width to get the preferred width, then it will be generated at
 * the preferred width to get the preferred height and then it might
 * be regenerated at a different width to get the height for the
 * actual allocated width
 *
 * since we might get multiple queries from layout managers doing a
 * double-pass allocations, like tabular ones, we should use 6 slots
 */


Reza


On Wed, Jun 25, 2014 at 3:52 PM, Robert Bragg <robert at sixbynine.org> wrote:

> The Cogl Pango renderer doesn't know about lines; it just gets told to
> draw glyphs and rectangles at a given position, so I can't think of
> anything at the Cogl level that could be affecting this.
>
> --
> Regards,
> Robert
>
> On Wed, Jun 25, 2014 at 2:32 AM, Reza Ghassemi <reza.robin1 at gmail.com>
> wrote:
> > There is function in pango to set the vertical line spacing,
> > pango_layout_set_spacing (), but it doesn't seem to work when used in
> > conjunction with a ClutterText object. Is it supposed to work?  Is there
> > another (simple) way to adjust the vertical line spacing?
> >
> > Reza
> >
> >
> >
> > _______________________________________________
> > Cogl mailing list
> > Cogl at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/cogl
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20140626/d35b43e6/attachment.html>


More information about the Cogl mailing list