[fpc-devel] Re: [patch][rfc] pangocairo bindings and some related questions

Martin Sucha anty.sk at gmail.com
Tue May 5 22:13:34 CEST 2009


Hi,

2009/4/29 Martin Sucha:
> I've translated some C header files to be able to use pangocairo in
> my application.
I'm attaching a version of the patch that I consider final. I added
package cairo as a dependency for package gtk2. Also changed external
library name for cairo unit (see below/patch itsef).

I'm also attaching an example program for pangocairo usage. As I'm
short of time it is a separate source file. Feel free to include it
into sources if you like it. (Note: I made it without reading any docs
for pango/pangocairo so there are no warranties. This example works
fine on linux and throws a numeric exception on windows. I've traced
it to cairo_fill_preserve call for 'World' path (only stroking that
path works fine) -- I don't know if it is bug in the example program
itself or in pango/cairo/pangocairo binaries I used and I've _not_
checked it with latest gtk binaries)

> 1. I've chosen to put pangocairo.pas into separate subdirectory
> under packages/gtk2/src/, is this okay?
I assume yes.

> 2. This unit needs to be included into build system. This is where I
> need some help as I'm not familiar with build system yet. What needs
> to be done to integrate this unit? Is somewhere a document that
> describes how freepascal build system works?
I've hacked the build system somehow (added cairo dependency). It
built successfully on linux 64 bit and windows. Hopefully I have not
broken anything :) . Please let me know if you spot any mistake.

> 4. On Windows, my program requires cairo.dll to be present, but
> there only exists libcairo-2.dll in windows gtk2 binaries (simple
> renaming that to cairo.dll fixes it). Also there are two versions of
> cairo in ubuntu hardy (libcairo.so and libcairo.so.2). Maybe we
> could update the library name in cairo package [...] to a name with "2" included.
This version of the patch also includes a change for this.

Best Regards

Martin Sucha
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_pangocairo_final.patch
Type: text/x-patch
Size: 81383 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20090505/040d23af/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pangocairodemo.pas
Type: text/x-pascal
Size: 3812 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20090505/040d23af/attachment.pas>


More information about the fpc-devel mailing list