[GRASS5] 5.7: making Freetype optional

Markus Neteler neteler at itc.it
Thu Nov 11 10:58:32 EST 2004


On Wed, Nov 10, 2004 at 02:18:52PM +0000, glynn at gclements.plus.com wrote:
> 
> Markus Neteler wrote:
> 
> > Making Freetype support optional:
> > ... to do so, should I add tons of
> > 
> >   #include "config.h"
> > 
> >   #ifdef HAVE_FT2BUILD_H
> >   ...
> >   #endif
> > 
> > statements into the following files?
> > 
> > cvsgrass57/display/drivers/lib
> >  command.c
> >  font_freetype.c
> >  Font_get.c
> >  Get_t_box.c
> >  Text.c
> > 
> > cvsgrass57/lib/raster
> >  Font.c
> > 
> > Would appreciate a recommendation how to proceed.
> 
> display/drivers/lib/Text3.c appears to be the only file which depends
> directly upon FreeType. Of the functions in that file:
> 
> + The body of drawMain() should be conditionalised upon
> HAVE_FT2BUILD_H, so that the function itself is a no-op if FreeType
> isn't available.
> 
> + Other functions which require FreeType should be conditionalised
> upon HAVE_FT2BUILD_H, so that the function doesn't exist if FreeType
> isn't available.
> 
> + Functions which don't need to be exported (AFAICT, everything except
> soft_text_freetype(), soft_text_ext_freetype() and get_text_ext_freetype())
> should be declared "static".
> 
> The drivers and raster library will support the FONT_FREETYPE and
> FONT_FREETYPE_RELEASE operations regardless of whether FreeType was
> enabled, except that those operations won't actually work.

I have made several changes, now it seems to work (please test with and
without Freetype). However, I was not quite lucky with defining functions
static. So I used ifdefs there as well (sorry, I'm still geographer).

Markus




More information about the grass-dev mailing list