FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cairo+Pango

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
maelp



Joined: 23 Sep 2007
Posts: 12

PostPosted: Mon Jun 23, 2008 11:09 am    Post subject: Cairo+Pango Reply with quote

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
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Mon Jun 23, 2008 1:18 pm    Post subject: Re: Cairo+Pango Reply with quote

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
View user's profile Send private message
kaarna



Joined: 03 Apr 2006
Posts: 92
Location: Finland

PostPosted: Thu Jun 26, 2008 6:09 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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