View previous topic :: View next topic |
Author |
Message |
maelp
Joined: 23 Sep 2007 Posts: 12
|
Posted: Mon Jun 23, 2008 11:09 am Post subject: Cairo+Pango |
|
|
Hello,
I wonder what's the proper way to render text using Cairo. There seems to be a pangocairo.h file, but I can't find the equivalent in gtkD, will it be included ? Is there a better way to render text ?
Another question :
if I have a widget, say a DrawingArea, I can get it's Cairo context. Is it safe to get it's Cairo context once when creating the widget, and then use it directly when doing some processing, or should I always get a "fresh context" when doing the redraw.
ie. is it possible to do a
Code: |
Context myContext
this(...) {
myContext = myDrawable.getCairoContext(...);
}
render(...)
{
myContext.drawCircle(...);
}
|
or should we do
Code: |
render(...)
{
Context myContext = myDrawable.getCairoContext(...);
myContext.drawCircle(...);
delete myContext ;
} |
[/code] |
|
Back to top |
|
|
Mike Wey
Joined: 07 May 2007 Posts: 428
|
Posted: Mon Jun 23, 2008 1:18 pm Post subject: Re: Cairo+Pango |
|
|
maelp wrote: | Hello,
I wonder what's the proper way to render text using Cairo. There seems to be a pangocairo.h file, but I can't find the equivalent in gtkD, will it be included ? Is there a better way to render text ? |
I think this will get included.
Quote: | Another question :
if I have a widget, say a DrawingArea, I can get it's Cairo context. Is it safe to get it's Cairo context once when creating the widget, and then use it directly when doing some processing, or should I always get a "fresh context" when doing the redraw.
ie. is it possible to do a
Code: |
Context myContext
this(...) {
myContext = myDrawable.getCairoContext(...);
}
render(...)
{
myContext.drawCircle(...);
}
|
or should we do
Code: |
render(...)
{
Context myContext = myDrawable.getCairoContext(...);
myContext.drawCircle(...);
delete myContext ;
} |
|
I don't have much experience with this, but both ways should work. |
|
Back to top |
|
|
kaarna
Joined: 03 Apr 2006 Posts: 92 Location: Finland
|
Posted: Thu Jun 26, 2008 6:09 pm Post subject: |
|
|
I've created a ticket about the lack of wrapping of functions in pango-Cairo-Rendering.html
http://www.dsource.org/projects/gtkd/ticket/35
It would be really great if those functions would be wrapped. That way we could actually use Pango with Cairo. I believe it isn't possible without them. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|