Re: Pango and Printing with GTK#



On Sun, 2008-04-20 at 01:06 -0600, John M. Anderson wrote:
> I'm trying to do some printing with a mix of pango and cairo within
> GTK#. My big issue right now is I can't find a
> way to reliable measure a font so I can figure out how many characters
> will fit inside the Layout so I can manage how
> many pages will need to be printed and wrap the text properly.

The only way to see how many pages a text would take is to put the text
into a layout, get an iterator for the layout, go over the lines, get
line heights, and stuff pages with lines.  There's no such thing as "how
many characters will fit inside the layout".

> Right now I can get it to wrap the text automatically for me by giving
> the layout a width but then I can't figure out a way
> to measure the strings to know how many pages i'm going to have.
> 
> Is there standard functionality in Pango to do all this?

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759



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