Skip to content

Instantly share code, notes, and snippets.

@jtanx
Created November 26, 2015 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtanx/612bd6c629a76e1aa977 to your computer and use it in GitHub Desktop.
Save jtanx/612bd6c629a76e1aa977 to your computer and use it in GitHub Desktop.
FontAnvil 0.3 changes to compile on Windows (MSYS2/Mingw-w64)
diff -ruBw fontanvil-0.3/configure.ac fontanvil-0.3a/configure.ac
--- fontanvil-0.3/configure.ac 2015-06-29 22:33:16.000000000 +0800
+++ fontanvil-0.3a/configure.ac 2015-11-26 07:29:10.301731000 +0800
@@ -441,7 +441,7 @@
#
AC_SYS_LONG_FILE_NAMES
AX_AM_JOBSERVER
-AS_IF([test '!' "x$KPSEWHICH" = "x"],[eightrenc=`$KPSEWHICH 8r.enc`])
+AS_IF([test '!' "x$KPSEWHICH" = "x"],[eightrenc=`"$KPSEWHICH" 8r.enc`])
AC_SUBST([eightrenc])
#
############################################################################
diff -ruBw fontanvil-0.3/gutils/gimagereadgif.c fontanvil-0.3a/gutils/gimagereadgif.c
--- fontanvil-0.3/gutils/gimagereadgif.c 2015-06-25 22:35:27.000000000 +0800
+++ fontanvil-0.3a/gutils/gimagereadgif.c 2015-11-26 07:34:44.169660700 +0800
@@ -40,6 +40,10 @@
# include "gimage.h"
# include <gif_lib.h>
+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && ((GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) || GIFLIB_MAJOR > 5)
+#define _GIFLIB_51PLUS
+#endif
+
static GImage *ProcessSavedImage(GifFileType * gif, struct SavedImage *si,
int il) {
/* Process each gif image into an internal FF format. Return NULL if error */
@@ -193,14 +197,22 @@
if (DGifSlurp(gif) != GIF_OK) {
fprintf(stderr, "Bad input file \"%s\"\n", filename);
+#ifdef _GIFLIB_51PLUS
+ DGifCloseFile(gif, NULL);
+#else
DGifCloseFile(gif);
+#endif
return (NULL);
}
/* Process each image so that it/they can be imported into FF. */
if ((images =
(GImage **) malloc(gif->ImageCount * sizeof(GImage *))) == NULL) {
+#ifdef _GIFLIB_51PLUS
+ DGifCloseFile(gif, NULL);
+#else
DGifCloseFile(gif);
+#endif
return (NULL);
}
il = gif->SavedImages[0].ImageDesc.Interlace;
@@ -210,7 +222,11 @@
while (--i >= 0)
free(images[i]);
free(images);
+#ifdef _GIFLIB_51PLUS
+ DGifCloseFile(gif, NULL);
+#else
DGifCloseFile(gif);
+#endif
return (NULL);
}
}
@@ -220,7 +236,11 @@
ret = images[0];
else
ret = GImageCreateAnimation(images, gif->ImageCount);
+#ifdef _GIFLIB_51PLUS
+ DGifCloseFile(gif, NULL);
+#else
DGifCloseFile(gif);
+#endif
free(images);
return (ret);
}
diff -ruBw fontanvil-0.3/Makefile.am fontanvil-0.3a/Makefile.am
--- fontanvil-0.3/Makefile.am 2015-06-29 23:24:05.000000000 +0800
+++ fontanvil-0.3a/Makefile.am 2015-11-26 08:40:16.190071300 +0800
@@ -139,7 +139,7 @@
tests/feart.log: tests/feamerge.log
-$(TESTS): ttmp/.dirstamp fontanvil/fontanvil
+$(TESTS): ttmp/.dirstamp
############################################################################
@@ -238,7 +238,8 @@
fontanvil/macenctab.c fontanvil/nonmactab.c
fontanvil_fontanvil_LDADD = $(top_builddir)/Unicode/libgunicode.a \
- $(top_builddir)/gutils/libgutils.a
+ $(top_builddir)/gutils/libgutils.a $(FREETYPE_LIBS) $(GLIB_LIBS) $(LIBPNG_LIBS) \
+ $(LIBTIFF_LIBS) $(ZLIB_LIBS) -liconv
Unicode_libgunicode_a_SOURCES = \
Unicode/charset/big5hkscs.c Unicode/charset/gb2312.c \
@@ -371,10 +372,10 @@
doc/fontanvil.pdf: $(texfiles) \
doc/quixote-dore.jpg doc/quixote-daumier.jpg
- cd doc ; $(PDFLATEX) fontanvil.tex
+ cd doc ; "$(PDFLATEX)" fontanvil.tex
cd doc ; makeindex fontanvil.idx
- cd doc ; $(PDFLATEX) fontanvil.tex
- cd doc ; $(PDFLATEX) fontanvil.tex
+ cd doc ; "$(PDFLATEX)" fontanvil.tex
+ cd doc ; "$(PDFLATEX)" fontanvil.tex
############################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment