[cairo] Using Pango+Cairo to layout non-standard / international text

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Apr 28 10:28:51 PDT 2008


On 2008-04-28 11:29-0400 robertk54 at aol.com wrote:

>>> Are there binaries available for Cairo+FT2 and Pango+FT2 for Win32 
> and 
>>> / or Linux?  
>  
>> Most Linux distros should have Pango+Cairo+FT2 binary packages you can 
>> install. For example, Debian testing has 
>> libpango1.0-0, Version 1.20.0-1 
>> libcairo2, Version 1.4.14-1, and 
>> libfreetype6, Version 2.3.5-1+b1 
>  
>> Alan
>
> I was under the impression the cairo and pango libraries you listed do not
> contain freetype support.  This is not the case?  I do not need libcairo2ft2'
> or 'libpangoft2'?

I don't think you should worry about such details in advance for Linux.  In
general, distro packagers try to be as general/helpful in their packaging as
possible rather than arbitrarily trying to make life difficult.  Thus, I
suggest the approach you should take is just try to build your application.
If the build complains about a missing header, figure out which software
package that header belongs to (presumbably the development version of one
of the packages above) and install the package, then try building your
application again.

Also, I would advise using pkg-config to figure out what cflags and library
flags you need to build your application.

For example, PLplot has a cairo plotting device driver which depends on
pango, cairo, and freetype2.  The PLplot CMake-based build system indirectly
makes calls to pkg-config similar to the following when done by hand:

software at raven> pkg-config --cflags pangocairo
-DPNG_NO_MMX_CODE -I/usr/include/pango-1.0 -I/usr/include/cairo
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2
-I/usr/include/libpng12

software at raven> pkg-config --libs pangocairo
-lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl
-lglib-2.0

pangocairo.pc is part of the libpango1.0-dev package on my system.  The full
list of *.pc files belonging to that package is

software at raven> dpkg --listfiles libpango1.0-dev |grep .pc
/usr/lib/pkgconfig/pangoxft.pc
/usr/lib/pkgconfig/pangox.pc
/usr/lib/pkgconfig/pango.pc
/usr/lib/pkgconfig/pangoft2.pc
/usr/lib/pkgconfig/pangocairo.pc

so you may want to substitute "pango" or "pangoft2" for "pangocairo" in the
pkg-config commands above depending on what your application needs.

Anyhow, I hope the above practical experience with building
pango/cairo/freetype-dependent applications is enough to get you started. If
you still run into trouble after that, let the list know what the specific
build error is for your application, and I am sure somebody should be able
to help you further.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the cairo mailing list