RE: Text layout in a GtkLabel
- From: "Ian Puleston" <ian underpressuredivers com>
- To: "'Milosz Derezynski'" <internalerror gmail com>
- Cc: gtk-list gnome org
- Subject: RE: Text layout in a GtkLabel
- Date: Wed, 29 Oct 2008 21:37:07 -0700
> -----Original Message-----
> From: Milosz Derezynski [mailto:internalerror gmail com]
> Sent: Wednesday, October 29, 2008 9:26 PM
> To: Ian Puleston
> Cc: gtk-list gnome org
> Subject: Re: Text layout in a GtkLabel
>
> What is the difference between "character formatting" and "layout
> formatting" here?
What I mean by that is that PangoLayout gives paragraph formatting (how the lines are laid out) and PangoAttrType attributes and the markup language give the character formatting (applied to characters/words in the paragraphs).
What I want to do is to set the indent for the first line of each paragraph (it’s a numbered list and I want to set the indent -ve so that the numbers are left of the text). There is no way to do that in the Pango attributes/markup - what I need is pango_layout_set_indent().
> On Thu, Oct 30, 2008 at 5:02 AM, Ian Puleston
> <ian underpressuredivers com> wrote:
> >> -----Original Message-----
> >> From: Milosz Derezynski [mailto:internalerror gmail com]
> >> Sent: Wednesday, October 29, 2008 5:24 PM
> >>
> >> You can use gtk_label_set_markup() and set the internal Layout of
> the
> >> Label using Pango markup, or use gtk_label_get_layout() (it's safe
> to
> >> call this function without realizing the widget first); that way
> >> actually have the Label's/a PangoLayout and can modify it as you
> were
> >> used to. There's also gtk_label_get/set_attributes() by which you
> >> don't need to get the actual Layout but that runs down to the same
> >> thing.
> >
> > Thanks, I'll look into using gtk_label_get_layout().
> >
> > But on the suggestion to use gtk_label_set_markup, that's actually
> what I meant below when I said "with Pango meta formatting" (sorry, was
> working on something else and got the terminology confused, I meant
> markup formatting). From what I see of the Pango Markup language it
> doesn't seem to provide for formatting the layout, just for character
> formatting, or am I missing something?
> >
> > Ian
> >
> >> 2008/10/30 Ian Puleston <ian underpressuredivers com>:
> >
> >> > The GtkLabel supports setting a Pango attributes list or text with
> >> Pango
> >> > meta formatting, but that is all character formatting. I think I
> >> could
> >> > achieve what I want using a Pango layout, but I can't see any way
> to
> >> use
> >> > that with a GtkLabel.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]