]> granicus.if.org Git - graphviz/commitdiff
make gd textlayout plugin back off when freetype is not available so that
authorellson <devnull@localhost>
Tue, 30 May 2006 00:01:14 +0000 (00:01 +0000)
committerellson <devnull@localhost>
Tue, 30 May 2006 00:01:14 +0000 (00:01 +0000)
we revert to the estimate_textsize() function

configure.ac
plugin/gd/gvtextlayout_gd.c

index 2efa6345ee2c7985f36123fa4c8362e64c7a4ad0..929cf66dced3c37fff3b201293f44ab8f390443a 100644 (file)
@@ -1357,30 +1357,22 @@ dnl INCLUDES and LIBS for FREETYPE (only with mylibgd)
 
 if test "x$with_mylibgd" = "xyes"; then
 
-AC_ARG_WITH(freetype,
-  [AC_HELP_STRING([--with-freetype],
-                  [use freetype library])])
+dnl FreeType configure tests snarfed from libgd ..from libwmf ..
 
-### default is to build with freetype
-if test "x$with_freetype" != "xno"; then
-       with_freetype=yes
-fi
-
-if test "x$with_freetype" = "xyes"; then
-  dnl FreeType configure tests snarfed from libgd ..from libwmf ..
   FREETYPE_DIR="yes" 
   AC_ARG_WITH(freetype,
   [  --with-freetype=DIR     where to find the freetype 2.x library],
-         FREETYPE_DIR=$withval)
+       FREETYPE_DIR=$withval)
 
-  if test "x$FREETYPE_DIR" = "xno"; then
-    AC_MSG_WARN(Optional FREETYPE2 library disabled)
+  ### default is to build with freetype
+  if test "x$with_freetype" = "xno"; then
+    AC_MSG_WARN(Optional FREETYPE library disabled)
   else
-                                                                                
-    if test "x$FREETYPE_DIR" != "xyes"; then
-      AC_PATH_PROG(FREETYPE_CONFIG,freetype-config,,[$FREETYPE_DIR/bin:$PATH])
-    else
+
+    if test "x$FREETYPE_DIR" = "xyes"; then
       AC_PATH_PROG(FREETYPE_CONFIG,freetype-config)
+    else
+      AC_PATH_PROG(FREETYPE_CONFIG,freetype-config,,[$FREETYPE_DIR/bin:$PATH])
     fi
 
     if test -n "$FREETYPE_CONFIG"; then
@@ -1431,7 +1423,6 @@ if test "x$with_freetype" = "xyes"; then
     AC_SUBST(FT_LIBS)
   fi
 fi
-fi
 
 dnl ----------------------------------
 dnl INCLUDES and LIBS for FONTCONFIG (only with mylibgd)
index ec4f884c68ca89f9d1c24e9ccc1b895de44a55b9..58ff1a4775c5e4f81ff556ff1a96519f4a8ee679 100644 (file)
@@ -26,7 +26,7 @@
 #ifdef HAVE_LIBGD
 #include "gd.h"
 
-#ifdef HAVE_GD_FREETYPE
+#if defined(HAVE_LIBFREETYPE) && defined(HAVE_GD_FREETYPE)
 
 /* fontsize at which text is omitted entirely */
 #define FONTSIZE_MUCH_TOO_SMALL 0.15
@@ -134,8 +134,10 @@ void textlayout(textpara_t * para, char *fontname, double fontsize, char **fontp
        err = gdImageStringFTEx(NULL, brect, -1, fontlist,
                                fontsize, 0, 0, 0, para->str, &strex);
 
-       if (err)
+       if (err) {
+           fprintf(stderr,"%s\n", err);
            return;
+       }
 
        if (strex.xshow) {
            /* transfer malloc'ed xshow string to para */
@@ -162,7 +164,7 @@ gvtextlayout_engine_t textlayout_engine = {
 #endif
 
 gvplugin_installed_t gvtextlayout_gd_types[] = {
-#if defined(HAVE_LIBGD) && defined(HAVE_GD_FREETYPE)
+#if defined(HAVE_LIBGD) && defined(HAVE_LIBFREETYPE) && defined(HAVE_GD_FREETYPE)
     {0, "textlayout", 2, &textlayout_engine, NULL},
 #endif
     {0, NULL, 0, NULL, NULL}