Cairo and Pango viable for UI development?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Cairo and Pango viable for UI development?

Stew MacLean

Hi,

 

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

 

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

 

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

 

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

 

What is the general consensus?  Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?

 

All viewpoints appreciated…

 

Cheers,

 

Stewart


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development?

Randy Coulman
Stewart,

Where I work, we use Cairo and Pango heavily, and they work well for us.  We are Linux-only, though, so haven't had to deal with cross-platform distribution issues with the libraries.

If you decide to go with Cairo, you might also want to look at Cairo Graphics Kit (http://cairocreations.wordpress.com/the-cairo-graphics-kit/).

We're not using that (yet), but only because we had most of our Cairo infrastructure in place before CGK came out.

There's a post my old blog showing some before and after pictures, if you're interested


Randy

On Thu, Jun 6, 2013 at 4:14 AM, Stewart MacLean <[hidden email]> wrote:

Hi,

 

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

 

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

 

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

 

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

 

What is the general consensus?  Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?

 

All viewpoints appreciated…

 

Cheers,

 

Stewart


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc




--
Randy Coulman
Email: [hidden email]
Home: http://randycoulman.com
Twitter: @randycoulman      GitHub: randycoulman

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development?

cdavidshaffer
In reply to this post by Stew MacLean

On Jun 6, 2013, at 7:14 AM, Stewart MacLean wrote:

Hi,

 

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

 

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

 

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

 

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

 

What is the general consensus?  Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?




I just started using Cairo under VisualWorks myself.  I think enough people are using it (not sure about Pango) that we can expect it to continue to move forward for quite some time.  I'm not sure what aspect you're referring to when you say "black art".  /Using/ Cairo under VW seems to be about the same as using it under python or ruby.  To be sure, I transliterated the second demo at: http://cairographics.org/animationrotation/.  I've attached the result if you'd like to have a look.  (Note: I stayed as close to the python code as possible so the names and a few of the patterns will seem goofy to a Smalltalker.)  You'll need to load CairoGraphics and ExtraActivity.  If you are referring to the way the bindings are generated (manually, as far as I know) then you might be right.  But, then again, I don't much about using SWIG to generate the Ruby or Python bindings either...if I ever had to produce such a thing I'd probably search for another option ;-)

David




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

CairoAnimationDemo.st (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development? // Text2

Maarten Mostert
In reply to this post by Stew MacLean

If I remeber well Travis never really managed to compile Pango correctly on all platfroms as he did with Cairo. Some years ago I used Pango, but as it didn't move on, I reverted back to the smaller text API of Cairo.

 

Still think that if you take the GTK libraries you schould be able to get it to work. And if you're a C programmer you might even be able to extend the API to the rest of the Library ?

 

My problem with Text is that VW text doesn't scale like Cairo text which I use to represent my Tables in PDF files. Text with's vary as it is simply not the same font between a VW Arial and a Cairo Arial.

 

I really would like to know how Text2 is going to handle that ? Does it draw to a Cairo Context ?

 

Regards,

 

@Maarten,

 

 

> "Stewart MacLean" <[hidden email]> |

Hi,

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

What is the general consensus? Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?

All viewpoints appreciated…

Cheers,

Stewart


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development? // Text2

Michael Lucas-Smith-2
Hi All,

So Text2 doesn't improve the fonts per-se, but it does measure with fonts correctly. If you have a decent Unicode font (Windows Vista+, OS X) then you're sitting pretty. Linux / Unix is a bit of a different story which I won't go in to depth about here.

Tony and I have been keeping a close eye on CairoGraphics, but also on HarfBuzz, which is MIT and the underpinnings of what Pango does. CairoGraphics is not a dead end in our minds, not in the slightest, it's still the most promising graphics platform we've used.

We're in the processing of planning our priorities for the next version of VisualWorks and we've been tossing around more work on CairoGraphics. I know a lot of you are using it already. I have a great deal of enthusiasm for CairoGraphics. I think its APIs are really rich and it's easy to use. I like it a lot.

The best I can offer at this point is "Watch this space" and if you want better than that, "Pester Product Management" :) (psst: That's Arden).

Michael

On 07/06/2013, at 3:56 PM, [hidden email] wrote:

If I remeber well Travis never really managed to compile Pango correctly on all platfroms as he did with Cairo. Some years ago I used Pango, but as it didn't move on, I reverted back to the smaller text API of Cairo.

 

Still think that if you take the GTK libraries you schould be able to get it to work. And if you're a C programmer you might even be able to extend the API to the rest of the Library ?

 

My problem with Text is that VW text doesn't scale like Cairo text which I use to represent my Tables in PDF files. Text with's vary as it is simply not the same font between a VW Arial and a Cairo Arial.

 

I really would like to know how Text2 is going to handle that ? Does it draw to a Cairo Context ?

 

Regards,

 

@Maarten,

 

 

> "Stewart MacLean" <[hidden email]> |

Hi,

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

What is the general consensus? Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?

All viewpoints appreciated…

Cheers,

Stewart
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development? // Text2

Maarten Mostert
But what are you Guys waiting for ? Aren't you reinventing the Pango wheel with Text2 ??
Are you serious with it or is this an experiment ?
What about skins does this follow up ?
Regards
@+Maarten
---- Envoyé avec BlackBerry® d'Orange ----

From: Michael Lucas-Smith <[hidden email]>
Date: Fri, 7 Jun 2013 16:21:05 +1000
To: VW NC<[hidden email]>
Subject: Re: [vwnc] Cairo and Pango viable for UI development? // Text2

Hi All,

So Text2 doesn't improve the fonts per-se, but it does measure with fonts correctly. If you have a decent Unicode font (Windows Vista+, OS X) then you're sitting pretty. Linux / Unix is a bit of a different story which I won't go in to depth about here.

Tony and I have been keeping a close eye on CairoGraphics, but also on HarfBuzz, which is MIT and the underpinnings of what Pango does. CairoGraphics is not a dead end in our minds, not in the slightest, it's still the most promising graphics platform we've used.

We're in the processing of planning our priorities for the next version of VisualWorks and we've been tossing around more work on CairoGraphics. I know a lot of you are using it already. I have a great deal of enthusiasm for CairoGraphics. I think its APIs are really rich and it's easy to use. I like it a lot.

The best I can offer at this point is "Watch this space" and if you want better than that, "Pester Product Management" :) (psst: That's Arden).

Michael

On 07/06/2013, at 3:56 PM, [hidden email] wrote:

If I remeber well Travis never really managed to compile Pango correctly on all platfroms as he did with Cairo. Some years ago I used Pango, but as it didn't move on, I reverted back to the smaller text API of Cairo.

 

Still think that if you take the GTK libraries you schould be able to get it to work. And if you're a C programmer you might even be able to extend the API to the rest of the Library ?

 

My problem with Text is that VW text doesn't scale like Cairo text which I use to represent my Tables in PDF files. Text with's vary as it is simply not the same font between a VW Arial and a Cairo Arial.

 

I really would like to know how Text2 is going to handle that ? Does it draw to a Cairo Context ?

 

Regards,

 

@Maarten,

 

 

> "Stewart MacLean" <[hidden email]> |

Hi,

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

What is the general consensus? Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?

All viewpoints appreciated…

Cheers,

Stewart
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development? // Text2

Michael Lucas-Smith-2



On 7 June 2013 22:19, <[hidden email]> wrote:
But what are you Guys waiting for ?
 
i don't really understand that question. If I could snap my fingers instead of coding I would :) For now let's just say we're waiting for all the cosmic signs to align? (This is a joke).
 
Aren't you reinventing the Pango wheel with Text2 ??

Nope. Pango is many things but a Smalltalk object library it is not. The unicode algorithms, plus HarfBuzz character shaping (or operating system character shaping on Win32 and OS X), plus a Document model, plus a Layout Engine (this is Pango-like), plus a (couple of) cross platform widgets and now we're at Text2, although we don't use HarfBuzz yet, that's just an idea to improve character shaping on Linux.
 
Are you serious with it or is this an experiment ?

That's an unfair question to ask the engineers. Of course we're serious, but that doesn't mean it'll be scheduled in immediately. There are many priorities and improving our graphics is just one of them (one I feel very strongly about).
 
What about skins does this follow up ?

Skins doesn't need CairoGraphics to work. I suspect our 'generic' skin might look sharper with CairoGraphics drawing but that's also not necessary and now i'm probably stepping on Tony's toes talking about his baby :)
 
For the now, you can continue to use CairoGraphics in its unsupported state - like many have said there are quite a few people who use it and the community has been quick to jump on issues and find solutions for the most part.

Regards
@+Maarten
---- Envoyé avec BlackBerry® d'Orange ----

From: Michael Lucas-Smith <[hidden email]>
Date: Fri, 7 Jun 2013 16:21:05 +1000
To: VW NC<[hidden email]>
Subject: Re: [vwnc] Cairo and Pango viable for UI development? // Text2

Hi All,

So Text2 doesn't improve the fonts per-se, but it does measure with fonts correctly. If you have a decent Unicode font (Windows Vista+, OS X) then you're sitting pretty. Linux / Unix is a bit of a different story which I won't go in to depth about here.

Tony and I have been keeping a close eye on CairoGraphics, but also on HarfBuzz, which is MIT and the underpinnings of what Pango does. CairoGraphics is not a dead end in our minds, not in the slightest, it's still the most promising graphics platform we've used.

We're in the processing of planning our priorities for the next version of VisualWorks and we've been tossing around more work on CairoGraphics. I know a lot of you are using it already. I have a great deal of enthusiasm for CairoGraphics. I think its APIs are really rich and it's easy to use. I like it a lot.

The best I can offer at this point is "Watch this space" and if you want better than that, "Pester Product Management" :) (psst: That's Arden).

Michael

On 07/06/2013, at 3:56 PM, [hidden email] wrote:

If I remeber well Travis never really managed to compile Pango correctly on all platfroms as he did with Cairo. Some years ago I used Pango, but as it didn't move on, I reverted back to the smaller text API of Cairo.

 

Still think that if you take the GTK libraries you schould be able to get it to work. And if you're a C programmer you might even be able to extend the API to the rest of the Library ?

 

My problem with Text is that VW text doesn't scale like Cairo text which I use to represent my Tables in PDF files. Text with's vary as it is simply not the same font between a VW Arial and a Cairo Arial.

 

I really would like to know how Text2 is going to handle that ? Does it draw to a Cairo Context ?

 

Regards,

 

@Maarten,

 

 

> "Stewart MacLean" <[hidden email]> |

Hi,

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

What is the general consensus? Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?

All viewpoints appreciated…

Cheers,

Stewart
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development?

Stew MacLean
In reply to this post by Randy Coulman

[FYI - omitted sending to the list]

 

Hi Randy,

 

Thanks for the screenshots – that’s the look I’m after!

 

I’ve tried the latest Cairo Graphics Kit in vw7.9.1 but when I execute “CGK.CairoPNGImageTool new openOnClass: self withSelector: #Ballon” I get a changedParentage dnu.

 

ESUG2011Intro, pngTestSpec, testSpec and RobotAnimationDemo run fine. With Pango I had a week of “dll hell”. I eventually tracked down the libraries and used the MS depends to ensure I had all the dependent libraries. Once I got the library loaded, it failed to find a font function (it was on a laptop I had borrowed so I don’t have the exact name).

 

Most of the Gizmos work, apart from ones that use Pango library.

 

The CairoBarChart has problems as it looks like the base VisualImage hierarchy has changed,

 

I really like your rounded rectangles – I’ve seem some C Cairo examples which I may try to implement in Smalltalk. Are you able to share the code for drawing the rectangles? – this could help get me going with my tree diagram.

 

Cheers,

 

Stewart

 

 

-----Original Message-----
From: Randy Coulman [mailto:[hidden email]]
Sent
:
7 June 2013 2:03 a.m.
To: [hidden email]
Cc: [hidden email]
Subject: Re: [vwnc] Cairo and Pango viable for UI development?

 

Stewart,

 

Where I work, we use Cairo and Pango heavily, and they work well for us.  We are Linux-only, though, so haven't had to deal with cross-platform distribution issues with the libraries.

 

If you decide to go with Cairo, you might also want to look at Cairo Graphics Kit (http://cairocreations.wordpress.com/the-cairo-graphics-kit/).

 

We're not using that (yet), but only because we had most of our Cairo infrastructure in place before CGK came out.

 

There's a post my old blog showing some before and after pictures, if you're interested

 

 

Randy

On Thu, Jun 6, 2013 at 4:14 AM, Stewart MacLean <[hidden email]> wrote:

Hi,

 

I’ve been exploring the feasibility of using Cairo/Pango for developing a user interface that would primarily be akin to a tree Organisation Chart.

 

I want it to look nice, cross platform and zoomable, and from what I’ve seen good results can be obtained with Cairo.

 

Unfortunately as I did a bit deeper, it looks like it’s still very much experimental and a bit of a “black art”. I’ve been unable to get Pango to work.

 

I know Cairo has been on the radar for a few years now, but it is still unsupported by Cincom and third party development seems to have waned.

 

What is the general consensus?  Should I pursue this avenue or maybe look at using SWIG to hook up to Qt (which I have used successfully from Ruby, and looks quite nice), or something else?

 

All viewpoints appreciated…

 

Cheers,

 

Stewart


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



 

--
Randy Coulman

Email: [hidden email]

Home: http://randycoulman.com

Twitter: @randycoulman      GitHub: randycoulman


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development?

Henrik Sperre Johansen

On Jun 11, 2013, at 11:21 AM, Henrik Johansen wrote:


On Jun 10, 2013, at 9:11 PM, Stewart MacLean wrote:

[FYI - omitted sending to the list]

 

Hi Randy,

 

Thanks for the screenshots – that’s the look I’m after!

 

I really like your rounded rectangles – I’ve seem some C Cairo examples which I may try to implement in Smalltalk. Are you able to share the code for drawing the rectangles? – this could help get me going with my tree diagram.

 

Cheers,

 

Stewart


There's an implementation of rounded rects included in the "handy paths" category:

CairoContext >> #rectangle: fillet:

Set the origin, stroke and fill first, and you're ready to go :)

Cheers,
Henry

Bah, reply recipient strikes again…

Anyways, here's a screenshot of how that looks (in this case GF/ST with a Pen modified to draw using Cairo, rather than "pure" Cairo)


Cheers,
Henry

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Cairo and Pango viable for UI development?

Stew MacLean

Hi Henry,

 

Thanks for this – it looks great!

 

Randy pointed me to an example using this as well.

 

Just gotta get Pango going on 7.9.1 to do the text…

 

Cheers,

 

Stewart

 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Henrik Johansen
Sent: 11 June 2013 9:44 p.m.
To: [hidden email]
Subject: Re: [vwnc] Cairo and Pango viable for UI development?

 

 

On Jun 11, 2013, at 11:21 AM, Henrik Johansen wrote:



 

On Jun 10, 2013, at 9:11 PM, Stewart MacLean wrote:



[FYI - omitted sending to the list]

 

Hi Randy,

 

Thanks for the screenshots – that’s the look I’m after!

 

I really like your rounded rectangles – I’ve seem some C Cairo examples which I may try to implement in Smalltalk. Are you able to share the code for drawing the rectangles? – this could help get me going with my tree diagram.

 

Cheers,

 

Stewart

 

There's an implementation of rounded rects included in the "handy paths" category:



CairoContext >> #rectangle: fillet:

 

Set the origin, stroke and fill first, and you're ready to go :)

 

Cheers,

Henry

 

Bah, reply recipient strikes again…

 

Anyways, here's a screenshot of how that looks (in this case GF/ST with a Pen modified to draw using Cairo, rather than "pure" Cairo)

 

 

Cheers,

Henry


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc