with_freetype="yes"
])
-
if test $with_freetype != "no" ; then {
- PKG_CHECK_MODULES(FREETYPE, xft freetype2 fontconfig,[
+ PKG_CHECK_MODULES(FREETYPE, freetype2,[
with_freetype="yes"
],[
- PKG_CHECK_MODULES(FREETYPE, freetype2 fontconfig,[
- with_freetype="yes"
- ],[
- with_freetype="no"
- ])
+ with_freetype="no"
])
-# AC_CHECK_FT2(,[
-# with_freetype="yes"
-# ],[
-# with_freetype="no"
-# ])
} ; fi
if test $with_freetype = "no" ; then {
} ; fi
+# FONTCONFIG CHECK--------------------
+AC_ARG_WITH(fontconfig,[
+ --without-fontconfig disable support for fontconfig (Default=auto)],[
+],[
+ with_fontconfig="yes"
+])
+if test $with_fontconfig != "no" ; then {
+ PKG_CHECK_MODULES(FONTCONFIG, fontconfig,[
+ with_fontconfig="yes"
+ ],[
+ with_fontconfig="no"
+ ])
+} ; fi
+
+if test $with_fontconfig = "yes" ; then {
+ AC_DEFINE(WITH_FONTCONFIG,[],[enable fontconfig support])
+ AM_CONDITIONAL(WITH_FONTCONFIG,true)
+} else {
+ AM_CONDITIONAL(WITH_FONTCONFIG,false)
+} ; fi
# OPENEXR CHECK------------------------
JPEG output target support -------> $TARGET_JPEG
ETL_CFLAGS -----------------------> $ETL_CFLAGS
FreeType2 ------------------------> $with_freetype
+fontconfig ------------------------> $with_fontconfig
libavcodec -----------------------> $with_libavcodec
vImage ---------------------------> $with_vimage
GLib -----------------------------> $GLIB
liblyr_freetype_la_LIBADD = -L../../synfig -lsynfig @FREETYPE_LIBS@ @SYNFIG_LIBS@
liblyr_freetype_la_LDFLAGS = -module -no-undefined
liblyr_freetype_la_CXXFLAGS = @SYNFIG_CFLAGS@ @FREETYPE_CFLAGS@
+if WITH_FONTCONFIG
+liblyr_freetype_la_LIBADD += @FONTCONFIG_LIBS@
+liblyr_freetype_la_CXXFLAGS += @FONTCONFIG_CFLAGS@
+else
+endif
else
endif
** $Id: lyr_freetype.cpp,v 1.5 2005/01/24 05:00:18 darco Exp $
**
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2006 Paul Wise
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+#ifdef WITH_FONTCONFIG
+#include <fontconfig/fontconfig.h>
+#endif
#include "lyr_freetype.h"
}
#endif
+#ifdef WITH_FONTCONFIG
+ if(error)
+ {
+ FcFontSet *fs;
+ FcResult result;
+ if( !FcInit() )
+ {
+ synfig::warning("lyr_freetype: fontconfig: %s",_("unable to initialise")));
+ error = 1;
+ } else {
+ FcPattern* pat = FcNameParse((FcChar8 *) newfont.c_str());
+ FcConfigSubstitute(0, pat, FcMatchPattern);
+ FcDefaultSubstitute(pat);
+ FcPattern *match;
+ fs = FcFontSetCreate();
+ match = FcFontMatch(0, pat, &result);
+ if (match)
+ FcFontSetAdd(fs, match);
+ if (pat)
+ FcPatternDestroy(pat);
+ if(fs){
+ FcChar8* file;
+ if( FcPatternGetString (fs->fonts[0], FC_FILE, 0, &file) == FcResultMatch )
+ error=FT_New_Face(ft_library,(const char*)file,face_index,&face);
+ FcFontSetDestroy(fs);
+ } else
+ synfig::warning("lyr_freetype: fontconfig: %s",_("empty font set")));
+ }
+ }
+#endif
+
#ifdef WIN32
if(error)error=FT_New_Face(ft_library,("C:\\WINDOWS\\FONTS\\"+newfont).c_str(),face_index,&face);
if(error)error=FT_New_Face(ft_library,("C:\\WINDOWS\\FONTS\\"+newfont+".ttf").c_str(),face_index,&face);