Pango and Printing with GTK#

View: New views
2 Messages — Rating Filter:   Alert me  

Pango and Printing with GTK#

by John M. Anderson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

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?
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

Re: Pango and Printing with GTK#

by Behdad Esfahbod-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list
LightInTheBox - Buy quality products at wholesale price