All pastes #1073962 Raw Edit

Something

public text v1 · immutable
#1073962 ·published 2008-07-17 01:44 UTC
rendered paste body
Index: ../tovid/src/makemenu
===================================================================
--- ../tovid/src/makemenu	(revision 2542)
+++ ../tovid/src/makemenu	(working copy)
@@ -2,7 +2,7 @@
 ME="[makemenu]:"
 . tovid-init
 
-# version $Id:$
+# version $Id$
 # makemenu
 # Part of the tovid suite
 # =======================
@@ -94,7 +94,21 @@
     fi
 }
 
+get_listarg()
+{
+    version=$(convert -list configure | awk '/LIB_VERSION_NUMBER/ {print $2}')
 
+    im_version=( ${version//,/ } )
+    test_version=(6 3 5 7)
+    arg='font'
+    for i in ${!im_version[@]}; do
+        (( ${im_version[i]} < ${test_version[i]} )) && arg='type'
+    done
+
+    echo $arg
+}
+
+
 # Initializations
 
 # No background image or audio
@@ -448,14 +462,14 @@
 else
     # Check to see if the given font name is available in ImageMagick
     # (only return the first exact match)
-    USE_TITLE_FONT=$( convert -list type | \
+    USE_TITLE_FONT=$( convert -list $(get_listarg) | \
 	grep -m 1 "$TITLE_FONT" | awk '{print $1}' )
 
    # If not available, try to use something similar
     if test -z $USE_TITLE_FONT ; then
 	    echo $SEPARATOR
 	    echo "Font: \"$TITLE_FONT\" does not appear to be either a font file or registered with ImageMagick."
-	    USE_TITLE_FONT=$( convert -list type | \
+	    USE_TITLE_FONT=$( convert -list $(get_listarg) | \
 	    grep -i -m 1 "${TITLE_FONT:0:20}" | awk '{print $1}' )
 
         # If a similarly-named one does't exist, default to Helvetica
@@ -480,14 +494,14 @@
     else
         # Check to see if the given button font is available in ImageMagick
         # (only return the first exact match)
-        USE_BUTTON_FONT=$( convert -list type | \
+        USE_BUTTON_FONT=$( convert -list $(get_listarg) | \
     	grep -m 1 "$BUTTON_FONT" | awk '{print $1}' )
 
         # If not available, try to use something similar
         if test -z $USE_BUTTON_FONT ; then
 	        echo $SEPARATOR
 	        echo "Button: \"$BUTTON_FONT\" does not appear to be either a font file or registered with ImageMagick."
-    	    USE_BUTTON_FONT=$( convert -list type | \
+    	    USE_BUTTON_FONT=$( convert -list $(get_listarg) | \
 	        grep -i -m 1 "${BUTTON_FONT:0:20}" | awk '{print $1}' )
 
             # If a similarly-named one does't exist, default to Helvetica