Re: Pango::Layout::create ({ImageSurface Cairo Context})



On Fri, 2007-11-16 at 11:15 -0600, Jonathon Jongsma wrote:
> On Wed, 2007-11-14 at 05:35 +0000, Dale Mellor wrote:
> > I'm trying to use pango to write text into a PNG file.  I have a
> > Cairo::Context on a Cairo::ImageSurface which works perfectly well with
> > graphics, but when I do Pango::Layout::create from this I get a NULL
> > object.
> > 
> > I have seen in the cairofontmap.h header file that the wrapping around
> > pango_cairo_font_map_get_default is commented out, so I can't use that
> > from which to create a Pango::Context.
> > 
> > Ideas anybody?
> > Thanks in advance.
> 
> If you could provide a minimal test case to illustrate the issue, that might help people respond more easily.

Here you go.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include <cairomm/cairomm.h>
#include <pangomm.h>

int main ()
{
  Cairo::RefPtr<Cairo::ImageSurface> surface
              = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, 750,
600);
  
  Cairo::RefPtr<Cairo::Context> cairo = Cairo::Context::create
(surface);

  Glib::RefPtr <Pango::Layout> pango = Pango::Layout::create (cairo);
  
  return 0;
}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Attachment: signature.asc
Description: This is a digitally signed message part



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