Re: Use Pango Layouts with GooCanvas Text
- From: Damon Chaplin <damon karuna eclipse co uk>
- To: Aditya Rajgarhia <adityar7 gmail com>
- Cc: goocanvas-list gnome org
- Subject: Re: Use Pango Layouts with GooCanvas Text
- Date: Mon, 24 Aug 2009 10:12:44 +0100
On Sun, 2009-08-23 at 17:05 -0700, Aditya Rajgarhia wrote:
> Damon, thanks for the reply. I have tried to split the text using
> newline characters in several ways, but the problem is that the number
> of characters in each line depends on the size of text, which the user
> can select. Using Pango Layouts in the Gnome Canvas code, this could be
> done by using a Pango::LayoutLine which would simply return this number
> through the get_length() method.
>
> I have spent a lot of time on this and have gone through all the
> examples, but don't see the Goocanvas::Text class providing similar
> functionality. Please let me know if I am missing something.
You're right. GooCanvasText doesn't provide direct access to the
PangoLayout, so you can't manipulate it.
I think you'll probably need to create a custom canvas item.
> On a somewhat related note, how can I manipulate *just* the size of text
> in Goocanvas without modifying the font family?
You could try using the "font-desc" property of the GooCanvasText, and
only setting the size with pango_font_description_set_size().
Or use Pango markup and set the "use-markup" property, and use something
like: "<span size="x-large">Some text</span>"
Damon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]