[cairo] Several questions about Cairo
behdad at behdad.org
Wed Mar 19 02:58:49 PDT 2008
On Tue, 2008-03-18 at 09:51 -0400, Hans Guijt wrote:
(Answering this offline in a train. I'm sure others have already
answered more completely.)
> I'm interested in using Cairo as a rendering backend in a piece of
> software we are working on here. However, before doing any serious work
> I have some questions I'm hoping you can help me with. Please be gentle
> if these are asked every week ;-)
Actually they are not.
> I'm in charge of a large software package that has fairly complex
> rendering needs. Currently we render to X11 and Win32 backends, and are
> thus limited to features that are common to both. I'm interested in
> using Cairo because I appreciate the higher potential quality of
> rendering (anti-aliased lines and text, for example), the ability to do
> semi-transparent rendering, the ability to have rotated text, and the
> potential to unify the rendering backends into a single block of code.
> However, some questions remain:
> 1. Does Cairo work on low-color displays? One of my supported platforms
> is HPUX in 8-bit color mode. Would that work, or would I still need a
> separate rendering backend for that platform?
Not yet, but the upcoming 1.6 release most probably will. Carl was
hacking on it last week.
> 2. Moreover, I need the ability to restrict the number of pens that
> Cairo allocates, because our software *must* coexist with other (3rd
> party) software that is utterly braindead and cannot survive without
> free pens. Is that possible?
Cairo doesn't use much of the core X protocol. If I understand it
correctly, then no pens are used by cairo.
> 3. Windows. Yes, it sounds like a curse. It is also a platform I must
> support. I'm worried that I cannot find any downloadable packages on the
> cairographics website. What I do find is links to other websites where I
> cannot find any traces of Cairo. Is there some fundamental reason why
> up-to-date Windows packages cannot be hosted on cairographics? If I have
> to support Windows, will I be required to maintain my own port? Or look
> for unofficial ports by people no related to the Cairo project? Neither
> of those options hold much appeal for me...
You don't need to maintain your own "port". Just build it. Or take any
of the builds available. The GTK+ win32 builds contain a cairo DLL for
> (and please don't attack me for using Windows. The website claims that
> Cairo supports Windows, and I need that capability.)
> 4. Documentation: I can see there should be a Windows port of Cairo
> 1.4.8 out there. I can also see the latest Cairo is apparently 1.4.14.
> However, I cannot find a list of changes between these versions, making
> it hard for me to figure out whether I should be satisfied with Cairo
> 1.4.8 or not. Is there a list of changes per version somewhere on the
The list of changes is available in release announcements for each
version, and they are available on the website under news. But general
rule of thumb is, you should always get the latest stable version
(1.4.14 currently. Soon will be 1.6.0).
> 5. Limitations: I seem to recall there were limitations with the ability
> to generate postscript at some point in the past, but I cannot find any
> information on limitations in the current (1.4.14) version of Cairo, let
> alone any older version (like 1.4.8). Based on what I read, I *expect*
> that Cairo will *always* do what is advertized (including fancy
> transparency, rotated anti-aliased fonts, and other tricks), no matter
> if the target platform is UNIX or Windows, and no matter if the backend
> is the screen, a printer, or postscript. But is this true?
Yes, cairo always produces what you asked it to do. It internally uses
image fallbacks for parts of the page that cannot be natively
represented in Postscript, but that's all transparent to the user.
> 6. Printing: based on what I've read, I'm assuming I will be able to use
> Cairo to generate printed output: directly through GDI on Windows, and
> by generating Postscript on UNIX. Is that assumption correct?
Yes. You'd need cairo 1.6 for win32 printing though.
> Answers and friendly advice are s much appreciated.
> Hans Guijt
Have fun using cairo!
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
More information about the cairo