Re: Pango/Cairo circular problem



Andrei Vasiliu wrote:

Hello all,

I've run into a sort of brick wall here, and I can't go on with my project until I pass it. I'm using GTK, Cairo, and Pango... I need to "cache" some GUI elements, that will be displayed numerous times and at various places on a big widget. So I'm using Cairo memory surfaces for this.

The problem: The size of these memory surfaces depend on their contents, so I need to determine the size before creating one. The contents include Pango layouts. In order to create a Pango layout for Cairo and get its size, I need a Cairo context. In order to create a Cairo context, I need the size of several Pango layouts.

Anyone ever had this problem before?

You just have to create a surface (size 1x1) and layout the text on
that surface. Then you can determine the required size. This is the
way it's done ATM I believe.

Theo



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