[GRASS-dev] 7.x Status Update

Glynn Clements glynn at gclements.plus.com
Sun Aug 10 17:32:20 EDT 2008


William Kyngesburye wrote:

> >> Another potentially disruptive update: the raster library now uses
> >> floating point values for coordinates.
> >
> > Next update: the cairo driver is now the default, assuming that GRASS
> > was built --with-cairo. If you haven't been enabling this, now is the
> > time to try, as the PNG driver may not be around for much longer.
> 
> I guess I *really* need to figure out Cairo for OSX now ;)  Well,  
> here's my current status as of a month ago:
> 
> - pixman: requires GCC 4.2 for SSE2 (for some stack alignment issue),  
> but compiles OK without it.  I need to try the new GCC 4.2 available  
> in Xcode 3.1 (this is available on OSX 10.5 Leopard only).
> 
> I made a script to build pixman universal, and will put it on my site  
> when I figure out the SSE2 stuff.
> 
> - cairo: requires pkg-config to configure.  For OSX this is silly, so  
> I hacked configure to disable pkg-config usage.
> 
> BUT, GRASS also uses pkg-config to get cairo config info (the only dep  
> in GRASS that does this).  I find this unreasonable (at least for  
> OSX), so can we get alternative (and standard for GRASS) --with-cairo- 
> includes and --with-cairo-libs flags, please?

This would also be useful on Windows.

The only potential problem is that cairo might need some -l flags. 
There's currently no way to provide those via configure, and with
high-level libraries, it starts getting impractical to enumerate
candidate libraries until the linking test succeeds.

OTOH, this is really only likely to be an issue if cairo is a static
library, or a dynamic library which lacks dependency information, both
of which are relatively unlikely.

> > At present, it uses the "toy" font backend, which means that it only
> > understands a limited set of fonts (AFAICT, it understands mono, serif
> > and sans, and -bold and -italic variants), although support for
> > FreeType and stroke fonts will be added soon.
> 
> - cairo also requires fontconfig to be used with freetype.  GRASS is  
> handling font paths and configuration itself, so I don't see the point  
> of this.  I built fonconfig for my old library binaries once, but it  
> was never used in the GIS packages and there were some build problems  
> (I forget what), so I removed it.  OSX X11 has fontconfig (and  
> freetype), but I don't want to depend on an X11 installation on OSX.

Cairo provides two functions to obtain a "handle" to a FreeType font;
one uses an FcPattern* while the other takes an FT_Face. However,
AFAICT, you don't have the option of building without fontconfig, even
if you only want the FT_Face version.

> So, I'm disabling the freetype backend and looking at the Cairo quartz  
> font backend.  I don't know how GRASS passes font details to Cairo, so  
> I don't know if this will work.  In general, how do you specify the  
> cairo backend to use (surface and font), from GRASS?  From the GRASS  
> docs, it looks like file extension sets surface backend.

There's no inherent reason why it can't support multiple font
back-ends. Each provides a different mechanism to obtain a
cairo_font_face_t* which can be passed to cairo_set_font_face().

The main issue is that each back-end needs corresponding
platform-specific code to get the platform's font handle.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list