[Gtk-sharp-list] Calculating Pixel Size of text with Pango and Cairo

Manuel Alejandro Cerón Estrada ceronman at gmail.com
Mon Aug 13 17:56:42 EDT 2007


Hello.

I have this problem: I need to calculate the pixel size of a text that
is going to be rendered with Pango and Cairo. I need to do this before
obtaining a Cairo context or Pango context for this operation.
Pango.Layout has a method called GetPixelSize, but apparently I can
not create a Pango Layout without having a context. Is there any way
of creating a temporary Pango context in order to calculate the pixel
size?

In advance, thank you.

Manuel.


More information about the Gtk-sharp-list mailing list