Merge tag 'mgp-1.13a.20190520' into mirbsd
authormirabilos <t.glaser@tarent.de>
Wed, 22 May 2019 21:00:50 +0000 (23:00 +0200)
committermirabilos <mirabilos@evolvis.org>
Wed, 22 May 2019 21:00:50 +0000 (23:00 +0200)
mgp-snap-20190520 (last upstream)

1  2 
Imakefile.in
SYNTAX
configure.in
contrib/mgpnet.in
draw.c
image/new.c
image/zoom.c
mgp.h
mgp.man
mng.c

diff --cc Imakefile.in
Simple merge
diff --cc SYNTAX
--- 1/SYNTAX
--- 2/SYNTAX
+++ b/SYNTAX
@@@ -1,7 -1,7 +1,7 @@@
- $Id: SYNTAX,v 1.36 2003/04/11 22:05:41 nishida Exp $
+ $Id: SYNTAX,v 1.46 2008/01/18 17:43:20 nishida Exp $
  
  placement restriction for directives:
 -              .mgprc          preamble        main pages
 +              .etc/mgprc      preamble        main pages
                ---             ---             ---
  %vfcap                okay            x               okay
  %tfdir                okay            x               okay
@@@ -137,8 -164,28 +164,28 @@@ others           x               x               oka
        <font> :: use TrueType font <font>, if none of the font specified by
                %tfont directive is found.  This is the last-resort for the
                TrueType font finding code.
 -              (allowed in ~/.mgprc, without "%" sign)
 +              (allowed in ~/.etc/mgprc, without "%" sign)
  
+       you do not need it with Xft2 enabled installation.
+ %psfont "font"
+       <font>:: use PostScript fonts to create PostScript file
+       Suported fonts are:
+                       Times-[Roman|Italic|Bold|BoldItalic]
+                       Helvetica
+                       Helvetica-[BoldOblique|Bold|Oblique]
+                       Helvetica-Narrow
+                       Helvetica-Narrow[Oblique|Bold|Oblique]
+                       NewCenturySchlbk-[Roman|Bold|Italic|BoldItalic]
+                       Courier
+                       Courier-[Oblique|Bold|BoldOblique]
+                       AvantGarde-[Book|BookOblique|Demi|DemiOblique]
+                       Bookman-[Demi|DemiItalic|Light|LigtItalic]
+                       Palatino-[Roman|Bold|Italic|BoldItalic]
+                       ZapfChanery-MediumItalic
+                       Symbol
+                       ZapfDingbats
+       if none of this fonts is specified it uses the default font Helvetica.
  %bar <color> <width> <start> <length>
        <color> :: color of bar, foreground color will be used as default.
        <width> :: permill of display height. default 10.
diff --cc configure.in
@@@ -92,16 -111,16 +111,16 @@@ dnl echo $targe
  if test "$mgp_use_freetype" = "yes"; then
    # XXX: freetype2 may use freetype-config
        AC_MSG_CHECKING(for freetype1 library/header)
-       for dir in $mplocalbase /usr/local/freetype /usr/local /opt/freetype /usr/pkg /usr /usr/include/freetype1 ; do
 -      for dir in $SEARCHPATH /usr/local/freetype /usr/local /opt/freetype /usr/pkg /usr /usr/include/freetype1 /sw; do
++      for dir in $mplocalbase $SEARCHPATH /usr/local/freetype /usr/local /opt/freetype /usr/pkg /usr /usr/include/freetype1 /sw; do
                ac_cv_ft_lib=no
                ac_cv_ft_include=no
-               shlib1=`echo $dir/lib/libttf.so* | head -1 | sed -e 's/.*\///'`
-               if test x$shlib1 = x; then
-                       shlib1=no
+               shlib=`echo $dir/lib/libttf.$SHLIBEXT* | head -n 1 | sed -e 's/.*\///'`
+               if test x$shlib = x; then
+                       shlib=no
                fi
-               if test -d $dir/lib -a -f $dir/lib/$shlib1; then
+               if test -d $dir/lib -a -f $dir/lib/$shlib; then
                        ac_cv_ft_lib="$dir/lib"
-                       ac_cv_ft_libpath="$shlib1"
+                       ac_cv_ft_libpath="$shlib"
                elif test -d $dir/lib -a -f $dir/lib/libttf.a; then
                        ac_cv_ft_lib="$dir/lib"
                        ac_cv_ft_libpath="libttf.a"
@@@ -312,17 -269,20 +272,21 @@@ if test "$mgp_use_freetype" = "yes"; th
        fi
  fi
  
 -if type pkg-config > /dev/null 2>&1; then
 +if false && type pkg-config > /dev/null 2>&1; then
-   if pkg-config libpng; then
-      LIBS="$LIBS `pkg-config --libs libpng`"
-      OPTFLAGS="$OPTFLAGS `pkg-config --cflags libpng`"
-      AC_DEFINE(USE_PNG)
-      ac_has_found_png=1
-   fi
+   for pnglib in libpng libpng12 libpng10
+   do
+      if pkg-config $pnglib; then
+        LIBS="$LIBS `pkg-config --libs $pnglib`"
+        OPTFLAGS="$OPTFLAGS `pkg-config --cflags $pnglib`"
+        AC_DEFINE(USE_PNG)
++       ac_has_found_png=1
+        break
+      fi
+   done
  fi
- if test x"$ac_has_found_png" != x"1"; then
-   for i in $mplocalbase /usr/pkg /usr/local /usr; do
-       if test -f $i/include/png.h -o -f $i/include/libpng/png.h; then
 -if test "$use_libpng" = ""; then
 -for i in $SEARCHPATH /usr/pkg /usr/local /usr; do
++test x"$ac_has_found_png" = x"1" || if test "$use_libpng" = ""; then
++for i in $mplocalbase $SEARCHPATH /usr/pkg /usr/local /usr; do
+       if test -f $i/include/png.h; then 
                if test -f $i/lib/libpng.a ; then
                        DEPLIBS="$DEPLIBS $i/lib/libpng.a"
                elif test -f $i/lib/libpng.so ; then
@@@ -359,12 -316,12 +323,12 @@@ for i in $mplocalbase /usr/pkg /usr/loc
                LIBS="$LIBS -L$i/lib"
                OPTFLAGS="$OPTFLAGS -I$i/include"
                AC_CHECK_LIB(mng, mng_initialize, 
 -                      [LIBS="$LIBS -lmng"
 +                      [LIBS="$LIBS -lmng -llcms -ljpeg -lz"
                         AC_DEFINE(MNG)], 
                [AC_CHECK_LIB(mng, mng_readdisplay,
 -                      [LIBS="$LIBS -lmng -ljpeg"
 +                      [LIBS="$LIBS -lmng -llcms -ljpeg -lz"
                         AC_DEFINE(MNG)],
-                       [], [-llcms -ljpeg -lz])])
 -                      [], [-ljpeg])])
++                      [], [-llcms -ljpeg -lz])], [-llcms -ljpeg -lz])
                break
        fi
  done
@@@ -405,15 -452,15 +442,15 @@@ USE_IMLIB=
  AC_SUBST(USE_IMLIB)
  AC_MSG_CHECKING(if imlib is used)
  AC_ARG_ENABLE(imlib,
-       [  --enable-imlib          use imlib exclusively to load images.],
+       [  --enable-imlib          use imlib2 exclusively to load images.],
        [mgp_imlib="$enableval"],
-       [mgp_imlib="no"])
+       [mgp_imlib="yes"])
  AC_MSG_RESULT($mgp_imlib)
  if test $mgp_imlib = "yes"; then
 -  if type pkg-config > /dev/null 2>&1; then
 +  if false && type pkg-config > /dev/null 2>&1; then
-      if pkg-config imlib; then
-         LIBS="$LIBS `pkg-config --libs imlib`"
-         OPTFLAGS="$OPTFLAGS `pkg-config --cflags imlib`"
+      if pkg-config imlib2; then
+         LIBS="$LIBS `pkg-config --libs imlib2`"
+         OPTFLAGS="$OPTFLAGS `pkg-config --cflags imlib2`"
        AC_DEFINE(USE_IMLIB)
        USE_IMLIB=1
       fi
Simple merge
diff --cc draw.c
--- 1/draw.c
--- 2/draw.c
+++ b/draw.c
@@@ -4528,10 -5269,11 +5269,11 @@@ xft_draw_fragment(state, p, len, regist
                        if (!strncmp(registry, rtab[i], 3)) break;
                }
                if (i == 3) return NULL; /* cannot find codeset */
-               snprintf(buf16, sizeof (buf16), "%s%s", prefix[i], p);
-               if (!icv[i]) icv[i] = iconv_open("UTF8", etab[i]);
-               if (icv[i] < 0){
-                       fprintf(stderr, "your iconv doesn't support %s\n", etab[i]);
 -              sprintf(buf16, "%s%s\0", prefix[i], p);         
++              snprintf(buf16, sizeof(buf16), "%s%s\0", prefix[i], p); /*XXX \0 likely wrong here */
+               if (icv[i] == (iconv_t)0) icv[i] = iconv_open("UTF-8", etab[i]);
+               if (icv[i] == (iconv_t)-1) {
+                       fprintf(stderr, "your iconv doesn't support %s\n",
+                           etab[i]);
                        return NULL;
                }
                p16 = buf16; o16 = out16;       
diff --cc image/new.c
Simple merge
diff --cc image/zoom.c
@@@ -70,7 -72,8 +72,8 @@@ Image *zoom(oimage, xzoom, yzoom, verbo
    else if (xzoom == yzoom) {
      if (verbose)
        fprintf(stderr, "  Zooming image by %0.2f%%...", xzoom);
-     sprintf(buf, "%s (%d%% zoom)", oimage->title, (int)xzoom);
+     if (oimage->title)
 -      sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
++      sprintf(buf, "%s (%d%% zoom)", oimage->title, (int)xzoom);
    }
    else {
      if (verbose)
diff --cc mgp.h
Simple merge
diff --cc mgp.man
+++ b/mgp.man
@@@ -346,8 -352,9 +352,9 @@@ completes
  .Sh CONFIGURATION FILES
  .Nm
  will look at a file named
 -.Pa ~/.mgprc
 +.Pa ~/.etc/mgprc
- in your home directory.
+ in your home directory. The path to this file can be overriden with the
+ environment variable MGPRC.
  The content of the file must be a limited set of magicpoint directives,
  one directive per line, without 
  .Li %
diff --cc mng.c
Simple merge