[cairo] Entry points for nonexistent backends?
Owen Taylor
otaylor at redhat.com
Wed Aug 15 12:42:17 PDT 2007
On Wed, 2007-08-15 at 14:40 +0300, Tor Lillqvist wrote:
> One thing related to cairo bindings especially for non-interpretd
> languages, is this: How should such bindings handle backend-specific
> cairo functions?
>
> I guess this is not a problem on Linux because presumably distros tend
> to build cairo with all possible backends, as the dependencies
> required by them are all present anyway on typical installations, and
> if not, handled sensibly by package management anyway.
>
> But on Windows it is a real problem. There is no package
> management. In general one should try to minimize the number of
> dependencies a 3rd-party library has.
>
> For instance the cairo DLL I distribute for use with GTK+ doesn't have
> the FreeType font backend included, because there is no need for that
> with GTK+. Including it would mean introducing a run-time dependency
> on freetype and fontconfig.
>
> (Note that dependent DLLs *have* to be present at run-time on
> Windows. As far as I recall, this is unlike ELF-based systems, where
> they need only be present if symbols from them are actually referenced
> at run-time.)
>
> I also build and distribute another cairo DLL that doesn't include
> even the SVG, PDF and PS backends. I still use the same DLL name
> (i.e. "soname" in ELF terminology) for it, because in other respects
> it is binary compatible. (I.e. an app that uses only the Win32 backend
> functions is able to run as well against a cairo DLL that also include
> other backends.)
I don't understand the point of this version ... the SVG/PDF/PS backends
have no external dependencies other than the font system, right?
My take on the thing is that a standard windows build uses the win32
font system. It does not use or include the FreeType font system,
because that's not how fonts work on Windows.
The fact that it's possible to build FreeType on fontconfig on windows
is no more relevant than the fact it's possible to build libX11 on
Windows.
So, in answer to your question, while cairo might theoretically be
able to be built 10 ways from Sunday, there effectively must be a single
standard per-platform build. And that's what language bindings should
target.
- Owen
More information about the cairo
mailing list