diff -Nru dvipng-1.14/ChangeLog dvipng-1.15/ChangeLog --- dvipng-1.14/ChangeLog 2010-10-23 12:02:45.000000000 +0000 +++ dvipng-1.15/ChangeLog 2015-03-02 19:33:56.000000000 +0000 @@ -1,3 +1,46 @@ +2015-03-01 Jan-Åke Larsson + + * RELEASE: Release 1.15 + + * color.c, config.h.in, configure.ac, dvi.c, dvipng.h, misc.c, + pk.c, set.c, sfd.c, tfm.c, vf.c: Remove references to kpathsea + xmalloc, and enable non-GNU malloc + + * dvi.c: Fix long sleep interval in --follow + + * INSTALL, Makefile.in, README, config.h.in, configure.ac, draw.c, + dvipng.1, dvipng.c, dvipng.h, dvipng.texi, font.c, fontmap.c, + install.texi, miktex.h, misc.c, readme.texi, t1.c: Remove support + for the now dead libt1 + + * special.c: Use + + * color.c: Fix segfault at missing xcolor.sty + + * set.c: Added check for out of memory in libgd allocate + +2012-09-15 Jan-Åke Larsson + + * ft.c: Add warning for missing target_light hinting + +2012-09-15 Jan-Åke Larsson + + * dvipng.c: Use return value of fgets better + +2010-12-17 Jan-Åke Larsson + + * COPYING.gd: Inclusion of the gd copyright notice + +2010-12-14 Jan-Åke Larsson + + * RELEASE: Spell correctly + +2010-12-06 Jan-Åke Larsson + + * special.c: Warn when --norawps hinders output + * dvipng.texi: Document usage of a fallback + * Makefile.in: Add www directory + 2010-10-23 Jan-Åke Larsson * dvipng.1, RELEASE: Prepare for 1.14 @@ -227,13 +270,13 @@ * Makefile.in, INSTALL, README, color.c, commands.h, configure.ac, * draw.c, dvi.c, dvipng.1, dvipng.c, dvipng.h, dvipng.texi, enc.c, - * font.c, fontmap.c, ft.c, install.texi, macros.texi, miktex.h, + * font.c, fontmap.c, ft.c, install.texi, macros.texi, miktex.h, * misc.c, papersiz.c, pk.c, ppagelist.c, readme.texi, set.c, sfd.c, * special.c, t1.c, test_dvipng.tex, tfm.c, vf.c, COPYING, * COPYING.LESSER: Change to LGPLv3 - * install.texi: - * README: + * install.texi: + * README: * dvipng.texi: Add blurb about MediaWiki, and cosmetic changes 2008-01-10 Jan-Ake Larsson @@ -258,20 +301,20 @@ * special.c: Simplify PostScript header and multi-special handling - * color.c: + * color.c: * draw.c: * dvi.c: - * dvipng.h: - * font.c: - * ft.c: - * misc.c: - * set.c: + * dvipng.h: + * font.c: + * ft.c: + * misc.c: + * set.c: * special.c: - * t1.c: Split the flags variable into page_flags, option_flags and + * t1.c: Split the flags variable into page_flags, option_flags and dvi->flags * dvi.c: - * dvipng.c: dvi->flags resets now when the dvi is reopened + * dvipng.c: dvi->flags resets now when the dvi is reopened 2007-08-06 Jan-Ake Larsson @@ -296,7 +339,7 @@ * special.c: Rewrite to allow for raw PostScript specials, also use PostScript headers - * dvipng.h: + * dvipng.h: * dvi.c: Add read-ahead for PostScript specials * config.h.in: @@ -320,8 +363,8 @@ * Release 1.9 - * INSTALL: - * README: Update for 1.9 + * INSTALL: + * README: Update for 1.9 * Makefile.in: Make the test fail if fonts not found @@ -371,7 +414,7 @@ * ft.c: Adjust debug output - * configure.ac: Add sfd.o + * configure.ac: Add sfd.o 2006-10-04 Jan-Ake Larsson @@ -420,7 +463,7 @@ * Makefile.in: add www target - * README: + * README: * readme.texi: Update capabilities info and preview-latex link 2006-03-30 Jan-Ake Larsson @@ -429,25 +472,25 @@ * RELEASE: Update for 1.8 - * set.c: - * readme.texi: - * install.texi: - * ft.c: - * dvi.c: - * draw.c: - * README: + * set.c: + * readme.texi: + * install.texi: + * ft.c: + * dvi.c: + * draw.c: + * README: * INSTALL: Update copyright 2006-03-29 Jan-Ake Larsson - * dvipng.1: + * dvipng.1: * dvipng.texi: Document new switch, new PostScript inclusion, rearrange and adjust - * misc.c: - * INSTALL: - * README: - * install.texi: + * misc.c: + * INSTALL: + * README: + * install.texi: * readme.texi: Minimal documentation adjustments 2006-03-27 Jan-Ake Larsson @@ -462,7 +505,7 @@ 2006-02-27 Jan-Ake Larsson * special.c: Use gs' pngalpha device, render without clipping, - adjust image position + adjust image position * set.c: Simplify code, make color cache (page-)persistent @@ -473,10 +516,10 @@ * dvipng.h: New flags - * configure.ac: + * configure.ac: * config.h.in: Simplify gd tests - * configure.ac: + * configure.ac: * aclocal.m4: Check gs devices 2006-02-10 Jan-Ake Larsson @@ -538,13 +581,13 @@ 2005-10-11 Jan-Ake Larsson * Release 1.7 - + * INSTALL: Typographic changes - * README: - * RELEASE: - * configure.ac: - * dvipng.1: + * README: + * RELEASE: + * configure.ac: + * dvipng.1: * dvipng.texi: Adjust for 1.7 * install.texi: Insert space @@ -597,12 +640,12 @@ * color.c: Don't use strtok, adjust for xcolor - * special.c: Don't use strtok + * special.c: Don't use strtok 2005-04-25 Jan-Ake Larsson - * config.h.in: - * configure.ac: + * config.h.in: + * configure.ac: * set.c: Don't do alpha blending in truecolor mode, write alpha channel to file @@ -624,17 +667,17 @@ * dvipng.1: Regenerate man page - * configure.ac: - * dvipng.texi: + * configure.ac: + * dvipng.texi: * miktex.h: Update version info - * configure.ac: - * dvipng.texi: - * README: + * configure.ac: + * dvipng.texi: + * README: * readme.texi: Update mailing list address - * configure.ac: - * config.h.in: + * configure.ac: + * config.h.in: * special.c: Simplify string search 2005-04-03 Jan-Ake Larsson @@ -650,75 +693,75 @@ DVI files * ft.c: Sizes are given in big points in FreeType, in TeX points - in DVI files + in DVI files - * dvipng.h: Fix boolean type again + * dvipng.h: Fix boolean type again 2005-02-10 Jan-Ake Larsson - * config.h.in: - * configure.ac: - * dvipng.texi: - * dvipng.h: - * misc.c: - * set.c: Add proper alpha channel + * config.h.in: + * configure.ac: + * dvipng.texi: + * dvipng.h: + * misc.c: + * set.c: Add proper alpha channel 2005-02-04 Jan-Ake Larsson - * color.c: - * draw.c: - * dvi.c: - * dvipng.c: - * font.c: - * ft.c: - * misc.c: - * papersiz.c: - * pk.c: - * set.c: - * special.c: - * t1.c: + * color.c: + * draw.c: + * dvi.c: + * dvipng.c: + * font.c: + * ft.c: + * misc.c: + * papersiz.c: + * pk.c: + * set.c: + * special.c: + * t1.c: * tfm.c: * vf.c: Cosmetic changes to warnings and fatals * Release 1.5 - - * RELEASE: Prepare for 1.5 - * INSTALL: - * Makefile.in: - * README: - * color.c: - * commands.h: - * configure.ac: - * draw.c: - * dvi.c: - * dvipng.1: - * dvipng.c: - * dvipng.h: - * dvipng.texi: - * enc.c: - * font.c: - * fontmap.c: - * ft.c: - * install.texi: - * macros.texi: - * miktex.h: - * misc.c: - * papersiz.c: - * pk.c: - * ppagelist.c: - * readme.texi: - * set.c: - * special.c: - * t1.c: - * test_dvipng.tex: + * RELEASE: Prepare for 1.5 + + * INSTALL: + * Makefile.in: + * README: + * color.c: + * commands.h: + * configure.ac: + * draw.c: + * dvi.c: + * dvipng.1: + * dvipng.c: + * dvipng.h: + * dvipng.texi: + * enc.c: + * font.c: + * fontmap.c: + * ft.c: + * install.texi: + * macros.texi: + * miktex.h: + * misc.c: + * papersiz.c: + * pk.c: + * ppagelist.c: + * readme.texi: + * set.c: + * special.c: + * t1.c: + * test_dvipng.tex: * tfm.c: * vf.c: Update Copyright, set version 1.5 2005-02-03 Jan-Ake Larsson - * draw.c: - * dvipng.h: + * draw.c: + * dvipng.h: * set.c: Fix bug in --picky mode 2005-01-27 Jan-Ake Larsson @@ -737,9 +780,9 @@ * Release 1.4 * RELEASE: - * configure.ac: + * configure.ac: * dvipng.1: - * dvipng.texi: Set version 1.4 + * dvipng.texi: Set version 1.4 * README: Fix formatting @@ -752,7 +795,7 @@ * configure.ac: * dvipng.h: Move int64_t and uint64_t tests entirely to autoconf - * dvi.c: Fix signedness + * dvi.c: Fix signedness 2004-11-30 Jan-Ake Larsson @@ -760,13 +803,13 @@ 2004-11-25 Jan-Ake Larsson - * Release 1.3 - + * Release 1.3 + * Makefile.in, README, dvipng.1, readme.texi: Fix dvigif installation and docs * INSTALL: - * README: Add license + * README: Add license * dvipng.c: Remove duplicate copyright @@ -784,7 +827,7 @@ * dvipng.h: Use char* arithmetic, not void*. And enable use of gcc -ansi -pedantic. - * special.c: Don't use C++ comments. + * special.c: Don't use C++ comments. * papersiz.c: Rewrite @@ -813,7 +856,7 @@ 2004-11-01 Jan-Åke Larsson - * RELEASE: Update for 1.3 + * RELEASE: Update for 1.3 * dvipng.h: Load alloca.h when available @@ -852,9 +895,9 @@ 2004-10-27 Jan-Åke Larsson * dvipng.1: - * dvipng.texi: Amend docs + * dvipng.texi: Amend docs - * misc.c: Amend helptext + * misc.c: Amend helptext 2004-10-26 Jan-Åke Larsson @@ -862,7 +905,7 @@ * misc.c: * dvipng.h: Change background transparency - * configure.ac: Bump version, add test for libz + * configure.ac: Bump version, add test for libz 2004-10-07 Jan-Åke Larsson @@ -875,16 +918,16 @@ 2004-08-18 Jan-Åke Larsson * Release 1.2 - - * RELEASE: Change for 1.2 + + * RELEASE: Change for 1.2 * config.h.in: Update - * dvipng.1: change help text + * dvipng.1: change help text * dvipng.texi: update mailing list text. And version. - * README: + * README: * readme.texi: update info and todo list * draw.c, misc.c, dvipng.c, dvipng.h: @@ -896,7 +939,7 @@ * special.c: Fix comment - * set.c: + * set.c: * dvipng.h: new Gamma function * configure.ac: libm is needed by new gamma code @@ -909,27 +952,27 @@ * special.c: do not call ghostscript when switch given * misc.c: add picky and ghostscript switches - - * dvipng.h: add picky and ghostscript flags + + * dvipng.h: add picky and ghostscript flags 2004-08-06 Jan-Åke Larsson * dvipng.texi: Document --png, --gif, and --picky - * .cvsignore: Add *.gif + * .cvsignore: Add *.gif - * Makefile.in: Install 'dvigif' if we have GIF support + * Makefile.in: Install 'dvigif' if we have GIF support - * configure.ac: Test for gdImageGif and 'ln -s' + * configure.ac: Test for gdImageGif and 'ln -s' - * config.h.in: GIF support + * config.h.in: GIF support * set.c: GIF writing * misc.c: basename fixes, --png and --gif fixes, - --no-image-on-warn changes name to --picky + --no-image-on-warn changes name to --picky - * dvi.c: basename fixes + * dvi.c: basename fixes * dvipng.h: Portability fixes, add GIF image flag @@ -939,12 +982,12 @@ 2004-07-01 Jan-Åke Larsson - * miktex.mak: New, for MIKTeX + * miktex.mak: New, for MIKTeX * dvi.c: * dvipng.c: * dvipng.h: - * special.c: Adjust for MIKTeX + * special.c: Adjust for MIKTeX * color.c: * enc.c: @@ -972,89 +1015,89 @@ 2004-06-24 Jan-Åke Larsson - * fontmap.c: - * pk.c: + * fontmap.c: + * pk.c: * vf.c: More memory fixes 2004-06-21 Jan-Åke Larsson * config.h.in: - * configure.ac: Test for stdbool, munmap and strtol + * configure.ac: Test for stdbool, munmap and strtol - * test_dvipng.tex: Change color test + * test_dvipng.tex: Change color test - * dvipng.h: - * misc.c: + * dvipng.h: + * misc.c: * ppagelist.c: Fix -r switch - * dvipng.h: - * font.c: - * misc.c: + * dvipng.h: + * font.c: + * misc.c: * ppagelist.c: - * special.c: - * t1.c: + * special.c: + * t1.c: * tfm.c: Use stdbool - * color.c: - * dvi.c: - * dvipng.c: - * dvipng.h: - * enc.c: - * font.c: - * fontmap.c: + * color.c: + * dvi.c: + * dvipng.c: + * dvipng.h: + * enc.c: + * font.c: + * fontmap.c: * ppagelist.c: * special.c: Fix memory leak(s) - * color.c: - * draw.c: - * dvi.c: - * dvipng.h: - * misc.c: + * color.c: + * draw.c: + * dvi.c: + * dvipng.h: + * misc.c: * set.c: * special.c: Fix color stack - * draw.c: - * dvipng.h: - * ft.c: - * pk.c: + * draw.c: + * dvipng.h: + * ft.c: + * pk.c: * set.c: - * t1.c: - * tfm.c: + * t1.c: + * tfm.c: * vf.c: Simplify char structs - * color.c: - * draw.c: - * dvi.c: - * dvipng.c: - * dvipng.h: - * enc.c: - * font.c: - * fontmap.c: - * ft.c: - * misc.c: - * papersiz.c: - * pk.c: + * color.c: + * draw.c: + * dvi.c: + * dvipng.c: + * dvipng.h: + * enc.c: + * font.c: + * fontmap.c: + * ft.c: + * misc.c: + * papersiz.c: + * pk.c: * ppagelist.c: * set.c: - * special.c: - * t1.c: - * tfm.c: - * vf.c: Add copyright notice + * special.c: + * t1.c: + * tfm.c: + * vf.c: Add copyright notice 2004-05-31 Jan-Åke Larsson * dvipng.1: * configure.ac: * RELEASE: - * INSTALL: Release 1.1 + * INSTALL: Release 1.1 2004-05-26 Jan-Åke Larsson * special.c: Handle source specials - * test_dvipng.tex: Add failing special and color test + * test_dvipng.tex: Add failing special and color test - * dvipng.c: Adjust coment about SELFAUTO... + * dvipng.c: Adjust coment about SELFAUTO... * dvi.c: Fix possible overflow @@ -1066,30 +1109,30 @@ 2004-05-18 Jan-Åke Larsson - * dvipng.texi: Fix build + * dvipng.texi: Fix build 2004-05-14 Jan-Åke Larsson - * config.h.in: Use more tests + * config.h.in: Use more tests - * dvipng.1: Add documentation + * dvipng.1: Add documentation * dvipng.texi: Fix build. Revert to four-argument @node, my makeinfo cannot handle the one-argument form (yet). 2004-05-11 Jan-Åke Larsson - * configure.ac: More tests + * configure.ac: More tests 2004-05-09 Jan-Åke Larsson - * install.texi: T1lib docs + * install.texi: T1lib docs * dvipng.1: - * dvipng.texi: Add documentation, and spellcheck + * dvipng.texi: Add documentation, and spellcheck * special.c: - * color.c: Make colors work again. + * color.c: Make colors work again. 2004-05-08 David Kastrup @@ -1100,7 +1143,7 @@ * fontmap.c: Use both kpse_fontmap_format and _dvips_header_ - * enc.c: Use configure test + * enc.c: Use configure test * configure.ac: Add test for kpse_enc_format, reorder gd and png tests @@ -1135,7 +1178,7 @@ 2004-05-02 Jan-Åke Larsson * Makefile.in: - * config.h.in: + * config.h.in: * configure.ac: * draw.c: * dvipng.c: @@ -1149,13 +1192,13 @@ 2004-04-05 Jan-Åke Larsson - * dvipng.1: - * readme.texi: + * dvipng.1: + * readme.texi: * dvipng.texi: - * Makefile.in: Add man page + * Makefile.in: Add man page 2004-03-27 Jan-Åke Larsson - + * dvipng.texi: Fix debug documentations * dvipng.c: Dont fail on --mode without --bdpi, output a warning. @@ -1164,7 +1207,7 @@ * papersiz.c: Remove compiler warning - * dvipng.texi: + * dvipng.texi: * misc.c: Change year 2004-03-25 Jan-Åke Larsson @@ -1176,18 +1219,18 @@ * configure.ac: Change version number - * README: Checkin updated README + * README: Checkin updated README * pk.c: * ft.c: Speed up color cache - * dvipng.texi: Add info on resolution, change version number + * dvipng.texi: Add info on resolution, change version number 2004-03-24 Jan-Åke Larsson - * special.c: Fix missing 'showpage' and a memory leak + * special.c: Fix missing 'showpage' and a memory leak - * font.c: Adjust error message + * font.c: Adjust error message * dvipng.h: * ft.c: @@ -1219,7 +1262,7 @@ * font.c: * misc.c: * papersiz.c: - * special.c: Change the behaviour of the -D switch + * special.c: Change the behaviour of the -D switch 2004-03-08 Jan-Åke Larsson diff -Nru dvipng-1.14/color.c dvipng-1.15/color.c --- dvipng-1.14/color.c 2010-09-22 13:13:34.000000000 +0000 +++ dvipng-1.15/color.c 2015-03-02 19:33:55.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -40,15 +40,15 @@ "svgnam.def","x11nam.def",NULL}; char *xcpname=NULL; -void initcolor(void) +void initcolor(void) { csp = 1; - cstack[0].red=255; - cstack[0].green=255; - cstack[0].blue=255; - cstack[1].red=0; - cstack[1].green=0; - cstack[1].blue=0; + cstack[0].red=255; + cstack[0].green=255; + cstack[0].blue=255; + cstack[1].red=0; + cstack[1].green=0; + cstack[1].blue=0; } static struct colorname * NewColor(const char* prefix, int nprefix, @@ -56,9 +56,8 @@ char* model, int nmodel, char* values, int nvalues) { - struct colorname *tmp = - malloc(sizeof(struct colorname)+3+nprefix+nname+nmodel+nvalues); - if (tmp==NULL) + struct colorname *tmp; + if ((tmp=malloc(sizeof(struct colorname)+3+nprefix+nname+nmodel+nvalues))==NULL) Fatal("Cannot malloc space for color name"); tmp->color=tmp->name+nprefix+nname+1; strncpy(tmp->name,prefix,nprefix); @@ -69,13 +68,13 @@ strncpy(tmp->color+nmodel+1,values,nvalues); tmp->color[nmodel+nvalues+1]='\0'; model=tmp->color; - while(*model!='\0') { - if (*model==',') - *model=' '; + while(*model!='\0') { + if (*model==',') + *model=' '; model++; } DEBUG_PRINT(DEBUG_COLOR,("\n COLOR NAME:\t'%s' '%s'", - tmp->name,tmp->color)); + tmp->name,tmp->color)); return(tmp); } @@ -87,11 +86,11 @@ #define FINDVALEND(s,n) n=0; while(snext=list; @@ -254,7 +252,7 @@ void stringrgb(const char* color,int *r,int *g,int *b) { char* end; - static int unloaded=1; + static int unloaded=0; DEBUG_PRINT(DEBUG_COLOR,("\n COLOR SPEC:\t'%s' (",color)); SKIPSPACES(color); @@ -300,9 +298,9 @@ *r = c+k<255 ? 255-(c+k) : 0; *g = m+k<255 ? 255-(m+k) : 0; *b = y+k<255 ? 255-(y+k) : 0; - } else if (strncmp(color,"hsb ",4)==0 + } else if (strncmp(color,"hsb ",4)==0 || strncmp(color,"HSB ",4)==0) { - /* The hsb and HSB models really need more presicion. + /* The hsb and HSB models really need more presicion. Use double and convert back*/ double hu,sa,br,f,R,G,B; int i; @@ -320,19 +318,19 @@ i=6*hu; f=6*hu-i; switch(i) { - case 0: + case 0: R = br*(1-sa*0); G = br*(1-sa*(1-f)); B = br*(1-sa*1); break; - case 1: + case 1: R = br*(1-sa*f); G = br*(1-sa*0); B = br*(1-sa*1); break; - case 2: + case 2: R = br*(1-sa*1); G = br*(1-sa*0); B = br*(1-sa*(1-f)); break; - case 3: + case 3: R = br*(1-sa*1); G = br*(1-sa*f); B = br*(1-sa*0); break; - case 4: + case 4: R = br*(1-sa*(1-f)); G = br*(1-sa*1); B = br*(1-sa*0); break; - case 5: + case 5: R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*f); break; - default: + default: R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*1); } *r=FTO255(R); @@ -348,14 +346,13 @@ while(tmp!=NULL && strcmp(color,tmp->name)!=0) tmp=tmp->next; if (tmp==NULL) { - if (colornamep==NULL) - colornamep=LoadColornameFile(colordef[0]); + while (colornamep==NULL && colordef[unloaded]!=NULL) + colornamep=LoadColornameFile(colordef[unloaded++]); tmp=colornamep; - while((tmp->next!=NULL || colordef[unloaded]!=NULL) - && strcmp(color,tmp->name)!=0) { - if (tmp->next==NULL) - tmp->next=LoadColornameFile(colordef[unloaded++]); - tmp=tmp->next; + while(tmp!=NULL && strcmp(color,tmp->name)!=0) { + while (tmp->next==NULL && colordef[unloaded]!=NULL) + tmp->next=LoadColornameFile(colordef[unloaded++]); + tmp=tmp->next; } } if (strcmp(color,tmp->name)==0) { diff -Nru dvipng-1.14/config.h dvipng-1.15/config.h --- dvipng-1.14/config.h 1970-01-01 00:00:00.000000000 +0000 +++ dvipng-1.15/config.h 2015-03-02 19:33:56.000000000 +0000 @@ -0,0 +1,218 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define as 1 to get the debug (-d) option. */ +#define DEBUG 1 + +/* The environment setting for $SELFAUTODIR */ +/* #undef ENV_SELFAUTODIR */ + +/* The environment setting for $SELFAUTOLOC */ +/* #undef ENV_SELFAUTOLOC */ + +/* The environment setting for $SELFAUTOPARENT */ +/* #undef ENV_SELFAUTOPARENT */ + +/* Define as the path to GhostScript. */ +#define GS_PATH "gs" + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +/* #undef HAVE_DOPRNT */ + +/* Define to 1 if you have the `dup2' function. */ +#define HAVE_DUP2 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define to 1 if you have freetype2 */ +#define HAVE_FT2 1 + +/* Define to 1 if you have the `ftime' function. */ +/* #undef HAVE_FTIME */ + +/* Define to 1 if you have the `FT_Library_Version' function. */ +#define HAVE_FT_LIBRARY_VERSION 1 + +/* Define to 1 if you have the `gdImageCreateFromJpeg' function. */ +#define HAVE_GDIMAGECREATEFROMJPEG 1 + +/* Define to 1 if you have the `gdImageCreateFromPngPtr' function. */ +#define HAVE_GDIMAGECREATEFROMPNGPTR 1 + +/* Define to 1 if you have the `gdImageCreateTrueColor' function. */ +#define HAVE_GDIMAGECREATETRUECOLOR 1 + +/* Define to 1 if you have the `gdImageGif' function. */ +#define HAVE_GDIMAGEGIF 1 + +/* Define to 1 if you have the `gdImagePngEx' function. */ +#define HAVE_GDIMAGEPNGEX 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GD_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +/* #undef HAVE_GETTIMEOFDAY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_KPATHSEA_KPATHSEA_H 1 + +/* Define to 1 if your kpathsea has kpse_enc_format */ +#define HAVE_KPSE_ENC_FORMATS 1 + +/* Define to 1 if you have the `gd' library (-lgd). */ +#define HAVE_LIBGD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIBGEN_H 1 + +/* Define to 1 if you have the `kpathsea' library (-lkpathsea). */ +#define HAVE_LIBKPATHSEA 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `png' library (-lpng). */ +#define HAVE_LIBPNG 1 + +/* Define to 1 if you have the `z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `munmap' function. */ +#define HAVE_MUNMAP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_PNG_H 1 + +/* Define to 1 if you have the `pow' function. */ +#define HAVE_POW 1 + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if stdbool.h conforms to C99. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strstr' function. */ +#define HAVE_STRSTR 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vfork' function. */ +#define HAVE_VFORK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VFORK_H */ + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if `fork' works. */ +#define HAVE_WORKING_FORK 1 + +/* Define to 1 if `vfork' works. */ +#define HAVE_WORKING_VFORK 1 + +/* Define to 1 if the system has the type `_Bool'. */ +#define HAVE__BOOL 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "dvipng@nongnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "dvipng" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "dvipng 1.15" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "dvipng" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.15" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define as 1 to get execution time output. */ +/* #undef TIMING */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `long long' if does not define it. */ +/* #undef int64_t */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* Define to `unsigned long long' if does not define it. */ +/* #undef uint64_t */ + +/* Define as `fork' if `vfork' does not work. */ +/* #undef vfork */ diff -Nru dvipng-1.14/config.h.in dvipng-1.15/config.h.in --- dvipng-1.14/config.h.in 2009-03-28 15:17:31.000000000 +0000 +++ dvipng-1.15/config.h.in 2015-03-02 19:33:55.000000000 +0000 @@ -84,16 +84,9 @@ /* Define to 1 if you have the `png' library (-lpng). */ #undef HAVE_LIBPNG -/* Define to 1 if you have the `t1' library (-lt1). */ -#undef HAVE_LIBT1 - /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -142,6 +135,9 @@ /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H @@ -154,9 +150,6 @@ /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_T1LIB_H - /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -190,6 +183,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -208,9 +204,6 @@ /* Define to `long long' if does not define it. */ #undef int64_t -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - /* Define to `int' if does not define. */ #undef pid_t diff -Nru dvipng-1.14/configure dvipng-1.15/configure --- dvipng-1.14/configure 2010-12-14 21:35:32.000000000 +0000 +++ dvipng-1.15/configure 2015-03-02 19:33:55.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for dvipng 1.14. +# Generated by GNU Autoconf 2.69 for dvipng 1.15. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -91,6 +89,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -135,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -168,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -213,14 +238,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -323,6 +359,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -444,6 +488,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -478,16 +526,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -499,28 +547,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -552,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='dvipng' PACKAGE_TARNAME='dvipng' -PACKAGE_VERSION='1.14' -PACKAGE_STRING='dvipng 1.14' +PACKAGE_VERSION='1.15' +PACKAGE_STRING='dvipng 1.15' PACKAGE_BUGREPORT='dvipng@nongnu.org' PACKAGE_URL='' @@ -601,15 +629,15 @@ MAKEINFO_MACROS MAKEINFO INSTALL_BIN_TARGET -POW_LIB LIBOBJS +POW_LIB FT2_LIBS FT2_CFLAGS FT2_CONFIG +PSFONTS_O EGREP GREP CPP -PSFONTS_O GS LN_S INSTALL_DATA @@ -1085,7 +1113,7 @@ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1136,8 +1164,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1223,7 +1249,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dvipng 1.14 to adapt to many kinds of systems. +\`configure' configures dvipng 1.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1284,7 +1310,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvipng 1.14:";; + short | recursive ) echo "Configuration of dvipng 1.15:";; esac cat <<\_ACEOF @@ -1391,10 +1417,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvipng configure 1.14 -generated by GNU Autoconf 2.67 +dvipng configure 1.15 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1438,7 +1464,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1470,7 +1496,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1484,7 +1510,7 @@ # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1521,7 +1547,7 @@ ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1563,7 +1589,7 @@ ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1576,10 +1602,10 @@ ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1646,7 +1672,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1655,7 +1681,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1668,7 +1694,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1686,7 +1712,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1699,7 +1725,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1740,7 +1766,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -1752,7 +1778,7 @@ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1807,15 +1833,15 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dvipng $as_me 1.14, which was -generated by GNU Autoconf 2.67. Invocation command line was +It was created by dvipng $as_me 1.15, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2073,7 +2099,7 @@ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2196,7 +2222,7 @@ $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2233,7 +2259,7 @@ set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2245,7 +2271,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2273,7 +2299,7 @@ set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2285,7 +2311,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2326,7 +2352,7 @@ set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2338,7 +2364,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2366,7 +2392,7 @@ set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2379,7 +2405,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2425,7 +2451,7 @@ set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2437,7 +2463,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2469,7 +2495,7 @@ set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2481,7 +2507,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2524,7 +2550,7 @@ test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -2639,7 +2665,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -2682,7 +2708,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -2741,7 +2767,7 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -2752,7 +2778,7 @@ ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2793,7 +2819,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -2803,7 +2829,7 @@ ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2840,7 +2866,7 @@ ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -2918,7 +2944,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -2927,8 +2953,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3059,7 +3084,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3079,7 +3104,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -3154,7 +3179,7 @@ set dummy "$withval"; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GS+set}" = set; then : +if ${ac_cv_path_GS+:} false; then : $as_echo_n "(cached) " >&6 else case $GS in @@ -3168,7 +3193,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3232,7 +3257,7 @@ set dummy gs; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_GS+set}" = set; then : +if ${ac_cv_prog_GS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GS"; then @@ -3244,7 +3269,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GS="gs" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3314,7 +3339,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } -if test "${ac_cv_lib_m_pow+set}" = set; then : +if ${ac_cv_lib_m_pow+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3348,7 +3373,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = x""yes; then : +if test "x$ac_cv_lib_m_pow" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -3359,7 +3384,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 $as_echo_n "checking for deflate in -lz... " >&6; } -if test "${ac_cv_lib_z_deflate+set}" = set; then : +if ${ac_cv_lib_z_deflate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3393,7 +3418,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 $as_echo "$ac_cv_lib_z_deflate" >&6; } -if test "x$ac_cv_lib_z_deflate" = x""yes; then : +if test "x$ac_cv_lib_z_deflate" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF @@ -3404,7 +3429,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_read_image in -lpng" >&5 $as_echo_n "checking for png_read_image in -lpng... " >&6; } -if test "${ac_cv_lib_png_png_read_image+set}" = set; then : +if ${ac_cv_lib_png_png_read_image+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3438,7 +3463,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_read_image" >&5 $as_echo "$ac_cv_lib_png_png_read_image" >&6; } -if test "x$ac_cv_lib_png_png_read_image" = x""yes; then : +if test "x$ac_cv_lib_png_png_read_image" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPNG 1 _ACEOF @@ -3451,7 +3476,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdImageCreate in -lgd" >&5 $as_echo_n "checking for gdImageCreate in -lgd... " >&6; } -if test "${ac_cv_lib_gd_gdImageCreate+set}" = set; then : +if ${ac_cv_lib_gd_gdImageCreate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3485,7 +3510,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gd_gdImageCreate" >&5 $as_echo "$ac_cv_lib_gd_gdImageCreate" >&6; } -if test "x$ac_cv_lib_gd_gdImageCreate" = x""yes; then : +if test "x$ac_cv_lib_gd_gdImageCreate" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGD 1 _ACEOF @@ -3499,7 +3524,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kpse_set_program_name in -lkpathsea" >&5 $as_echo_n "checking for kpse_set_program_name in -lkpathsea... " >&6; } -if test "${ac_cv_lib_kpathsea_kpse_set_program_name+set}" = set; then : +if ${ac_cv_lib_kpathsea_kpse_set_program_name+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3533,7 +3558,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kpathsea_kpse_set_program_name" >&5 $as_echo "$ac_cv_lib_kpathsea_kpse_set_program_name" >&6; } -if test "x$ac_cv_lib_kpathsea_kpse_set_program_name" = x""yes; then : +if test "x$ac_cv_lib_kpathsea_kpse_set_program_name" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKPATHSEA 1 _ACEOF @@ -3544,56 +3569,6 @@ as_fn_error $? "cannot find/use libkpathsea" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for T1_InitLib in -lt1" >&5 -$as_echo_n "checking for T1_InitLib in -lt1... " >&6; } -if test "${ac_cv_lib_t1_T1_InitLib+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lt1 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char T1_InitLib (); -int -main () -{ -return T1_InitLib (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_t1_T1_InitLib=yes -else - ac_cv_lib_t1_T1_InitLib=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_t1_T1_InitLib" >&5 -$as_echo "$ac_cv_lib_t1_T1_InitLib" >&6; } -if test "x$ac_cv_lib_t1_T1_InitLib" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBT1 1 -_ACEOF - - LIBS="-lt1 $LIBS" - -fi - -PSFONTS_O="" -if test "$ac_cv_lib_t1_T1_InitLib" = yes; then - PSFONTS_O="t1.o" -fi - # Checks for header files. ac_ext=c @@ -3608,7 +3583,7 @@ CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3724,7 +3699,7 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5 ; } +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3736,7 +3711,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3750,7 +3725,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -3799,7 +3774,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3816,7 +3791,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -3866,7 +3841,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4008,19 +3983,20 @@ done -for ac_header in t1lib.h libgen.h +for ac_header in libgen.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default" +if test "x$ac_cv_header_libgen_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_LIBGEN_H 1 _ACEOF fi done +PSFONTS_O="" + # Check whether --with-ft-prefix was given. if test "${with_ft_prefix+set}" = set; then : @@ -4061,7 +4037,7 @@ set dummy freetype-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_FT2_CONFIG+set}" = set; then : +if ${ac_cv_path_FT2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $FT2_CONFIG in @@ -4075,7 +4051,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FT2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4192,7 +4168,7 @@ $as_echo "yes" >&6; } CFLAGS="$FT2_CFLAGS $CFLAGS" LIBS="$FT2_LIBS $LIBS" - PSFONTS_O="$PSFONTS_O sfd.o ft.o" + PSFONTS_O="sfd.o ft.o enc.o fontmap.o tfm.o" $as_echo "#define HAVE_FT2 1" >>confdefs.h @@ -4226,12 +4202,9 @@ -if test -n "$PSFONTS_O"; then - PSFONTS_O="$PSFONTS_O enc.o fontmap.o tfm.o" -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then : +if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4272,7 +4245,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if test "${ac_cv_header_time+set}" = set; then : +if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4307,84 +4280,66 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if test "${ac_cv_header_stdbool_h+set}" = set; then : +if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#ifndef bool - "error: bool is not defined" -#endif -#ifndef false - "error: false is not defined" -#endif -#if false - "error: false is not 0" -#endif -#ifndef true - "error: true is not defined" -#endif -#if true != 1 - "error: true is not 1" -#endif -#ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" -#endif - - struct s { _Bool s: 1; _Bool t; } s; - - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - bool e = &s; - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; -# if defined __xlc__ || defined __GNUC__ - /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 - reported by James Lemley on 2005-10-05; see - http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html - This test is not quite right, since xlc is allowed to - reject this program, as the initializer for xlcbug is - not one of the forms that C requires support for. - However, doing the test right would require a runtime - test, and that would make cross-compilation harder. - Let us hope that IBM fixes the xlc bug, and also adds - support for this kind of constant expression. In the - meantime, this test will reject xlc, which is OK, since - our stdbool.h substitute should suffice. We also test - this with GCC, where it should work, to detect more - quickly whether someone messes up the test in the - future. */ - char digs[] = "0123456789"; - int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); -# endif - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; int main () { - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); ; return 0; @@ -4399,8 +4354,8 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } -ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = x""yes; then : + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 @@ -4409,6 +4364,7 @@ fi + if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h @@ -4432,7 +4388,7 @@ # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4441,11 +4397,11 @@ int main () { -/* FIXME: Include the comments suggested by Paul. */ + #ifndef __cplusplus - /* Ultrix mips cc rejects this. */ + /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; - const charset cs; + const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; @@ -4462,8 +4418,9 @@ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; @@ -4479,10 +4436,10 @@ iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this saying + { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; @@ -4511,7 +4468,7 @@ fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = x""yes; then : +if test "x$ac_cv_type_pid_t" = xyes; then : else @@ -4522,7 +4479,7 @@ fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : +if test "x$ac_cv_type_size_t" = xyes; then : else @@ -4542,7 +4499,7 @@ # AC_CHECK_TYPE(int64_t, long long) # AC_CHECK_TYPE(uint64_t, unsigned long long) ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default" -if test "x$ac_cv_type_int64_t" = x""yes; then : +if test "x$ac_cv_type_int64_t" = xyes; then : else @@ -4553,7 +4510,7 @@ fi ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default" -if test "x$ac_cv_type_uint64_t" = x""yes; then : +if test "x$ac_cv_type_uint64_t" = xyes; then : else @@ -4596,7 +4553,7 @@ for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = x""yes; then : +if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF @@ -4620,7 +4577,7 @@ if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } -if test "${ac_cv_func_fork_works+set}" = set; then : +if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -4673,7 +4630,7 @@ if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } -if test "${ac_cv_func_vfork_works+set}" = set; then : +if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -4806,73 +4763,8 @@ fi -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_malloc_0_nonnull=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#else -char *malloc (); -#endif - -int -main () -{ -return ! malloc (0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes -else - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } -if test $ac_cv_func_malloc_0_nonnull = yes; then : - -$as_echo "#define HAVE_MALLOC 1" >>confdefs.h - -else - $as_echo "#define HAVE_MALLOC 0" >>confdefs.h - - case " $LIBOBJS " in - *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" - ;; -esac - - -$as_echo "#define malloc rpl_malloc" >>confdefs.h - -fi - - +# We always allocate nonzero chunks +# AC_FUNC_MALLOC @@ -4900,7 +4792,7 @@ for ac_func in getpagesize do : ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = x""yes; then : +if test "x$ac_cv_func_getpagesize" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETPAGESIZE 1 _ACEOF @@ -4910,7 +4802,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } -if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then : +if ${ac_cv_func_mmap_fixed_mapped+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -5074,9 +4966,10 @@ fi rm -f conftest.mmap conftest.txt +# AC_FUNC_REALLOC { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } -if test "${ac_cv_func_strtod+set}" = set; then : +if ${ac_cv_func_strtod+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -5135,14 +5028,14 @@ esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" -if test "x$ac_cv_func_pow" = x""yes; then : +if test "x$ac_cv_func_pow" = xyes; then : fi if test $ac_cv_func_pow = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } -if test "${ac_cv_lib_m_pow+set}" = set; then : +if ${ac_cv_lib_m_pow+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5176,7 +5069,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = x""yes; then : +if test "x$ac_cv_lib_m_pow" = xyes; then : POW_LIB=-lm else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 @@ -5190,13 +5083,13 @@ for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" -if test "x$ac_cv_func_vprintf" = x""yes; then : +if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" -if test "x$ac_cv_func__doprnt" = x""yes; then : +if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h @@ -5256,7 +5149,7 @@ set dummy makeinfo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MAKEINFO+set}" = set; then : +if ${ac_cv_path_MAKEINFO+:} false; then : $as_echo_n "(cached) " >&6 else case $MAKEINFO in @@ -5270,7 +5163,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MAKEINFO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5318,7 +5211,7 @@ set dummy install-info; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_INSTALL_INFO+set}" = set; then : +if ${ac_cv_path_INSTALL_INFO+:} false; then : $as_echo_n "(cached) " >&6 else case $INSTALL_INFO in @@ -5332,7 +5225,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5401,7 +5294,7 @@ set dummy kpsewhich; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_KPSEWHICH+set}" = set; then : +if ${ac_cv_path_KPSEWHICH+:} false; then : $as_echo_n "(cached) " >&6 else case $KPSEWHICH in @@ -5415,7 +5308,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_KPSEWHICH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5493,7 +5386,6 @@ (dvigif): $ac_cv_func_gdImageGif FreeType font rendering available: $ac_have_freetype2 Support for subfonts (CJK-LaTeX): $ac_have_freetype2 - T1lib font rendering available: $ac_cv_lib_t1_T1_InitLib " >&5 $as_echo " ** Configuration summary for $PACKAGE_STRING: @@ -5515,7 +5407,6 @@ (dvigif): $ac_cv_func_gdImageGif FreeType font rendering available: $ac_have_freetype2 Support for subfonts (CJK-LaTeX): $ac_have_freetype2 - T1lib font rendering available: $ac_cv_lib_t1_T1_InitLib " >&6; } ac_config_headers="$ac_config_headers config.h" @@ -5586,10 +5477,21 @@ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -5621,7 +5523,7 @@ -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -5722,6 +5624,7 @@ IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5917,16 +5820,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -5986,28 +5889,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -6028,8 +5919,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dvipng $as_me 1.14, which was -generated by GNU Autoconf 2.67. Invocation command line was +This file was extended by dvipng $as_me 1.15, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6090,11 +5981,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dvipng config.status 1.14 -configured by $0, generated by GNU Autoconf 2.67, +dvipng config.status 1.15 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -6183,7 +6074,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -6215,7 +6106,7 @@ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -6237,9 +6128,10 @@ # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -6247,12 +6139,13 @@ { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -6274,7 +6167,7 @@ ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -6302,7 +6195,7 @@ rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -6350,7 +6243,7 @@ rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -6382,7 +6275,7 @@ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -6416,7 +6309,7 @@ # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -6428,8 +6321,8 @@ # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -6530,7 +6423,7 @@ esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -6549,7 +6442,7 @@ for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -6558,7 +6451,7 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -6584,8 +6477,8 @@ esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -6715,21 +6608,22 @@ s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -6740,20 +6634,20 @@ if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ + mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; diff -Nru dvipng-1.14/configure.ac dvipng-1.15/configure.ac --- dvipng-1.14/configure.ac 2010-10-22 18:15:24.000000000 +0000 +++ dvipng-1.15/configure.ac 2015-03-02 19:33:56.000000000 +0000 @@ -18,23 +18,23 @@ # License along with this program. If not, see # . # -# Copyright (C) 2002-2010 Jan-Åke Larsson +# Copyright (C) 2002-2015 Jan-Åke Larsson # #************************************************************************ # Process this file with autoconf to produce a configure script. -AC_INIT([dvipng], [1.14], [dvipng@nongnu.org]) +AC_INIT([dvipng], [1.15], [dvipng@nongnu.org]) AC_CONFIG_SRCDIR([dvipng.c]) -AC_ARG_ENABLE(debug, - AC_HELP_STRING([--disable-debug],[Compile without debug (-d) option]), +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug],[Compile without debug (-d) option]), [ if test "$enableval" = yes ; then AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.]) - fi ], + fi ], [ enable_debug="yes"; AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.])]) -AC_ARG_ENABLE(timing, - AC_HELP_STRING([--enable-timing],[Output execution time of dvipng]), +AC_ARG_ENABLE(timing, + AC_HELP_STRING([--enable-timing],[Output execution time of dvipng]), [ if test "$enableval" = yes ; then AC_DEFINE(TIMING, 1, [Define as 1 to get execution time output.]) fi ]) @@ -45,7 +45,7 @@ AC_PROG_INSTALL AC_PROG_LN_S AC_ARG_WITH(gs, - AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Hard-wire the location of GhostScript]), + AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Hard-wire the location of GhostScript]), [if test "x$withval" != xno ; then AC_PATH_PROG(GS,["$withval"]) AC_DEFINE_UNQUOTED(GS_PATH, "$GS", [Define as the path to GhostScript.]) @@ -68,29 +68,22 @@ AC_CHECK_LIB([gd], [gdImageCreate],, [AC_MSG_ERROR([cannot find/use libgd This drawing library can be downloaded at http://www.boutell.com/gd])]) -AC_CHECK_LIB([kpathsea], [kpse_set_program_name],, +AC_CHECK_LIB([kpathsea], [kpse_set_program_name],, AC_MSG_ERROR([cannot find/use libkpathsea])) -AC_CHECK_LIB([t1], [T1_InitLib]) -PSFONTS_O="" -if test "$ac_cv_lib_t1_T1_InitLib" = yes; then - PSFONTS_O="t1.o" -fi -AC_SUBST(PSFONTS_O) -# Checks for header files. +# Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([gd.h png.h kpathsea/kpathsea.h],, [AC_MSG_ERROR([cannot find/use $ac_header])]) -AC_CHECK_HEADERS([t1lib.h libgen.h]) +AC_CHECK_HEADERS([libgen.h]) +PSFONTS_O="" +AC_SUBST(PSFONTS_O) AC_CHECK_FT2(,[CFLAGS="$FT2_CFLAGS $CFLAGS" LIBS="$FT2_LIBS $LIBS" - PSFONTS_O="$PSFONTS_O sfd.o ft.o" + PSFONTS_O="sfd.o ft.o enc.o fontmap.o tfm.o" AC_DEFINE(HAVE_FT2, 1, [Define to 1 if you have freetype2]) ac_have_freetype2="yes"], [ac_have_freetype2="no"]) -if test -n "$PSFONTS_O"; then - PSFONTS_O="$PSFONTS_O enc.o fontmap.o tfm.o" -fi AC_HEADER_SYS_WAIT AC_HEADER_TIME AC_HEADER_STDBOOL @@ -123,8 +116,10 @@ # Checks for library functions. AC_FUNC_FORK -AC_FUNC_MALLOC +# We always allocate nonzero chunks +# AC_FUNC_MALLOC AC_FUNC_MMAP +# AC_FUNC_REALLOC AC_FUNC_STRTOD AC_FUNC_VPRINTF AC_CHECK_FUNCS([dup2 memset munmap pow putenv strchr strrchr strtol strstr]) @@ -145,7 +140,7 @@ AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH /usr/sbin /sbin) # SELFAUTO -AC_ARG_ENABLE(selfauto-set, +AC_ARG_ENABLE(selfauto-set, AC_HELP_STRING([--enable-selfauto-set], [This option will make the final binary explicitly set the $SELFAUTO... variables to make it look as dvipng is installed in the @@ -202,22 +197,21 @@ The -d (debug) switch is enabled: $enable_debug Your gd is new enough (>=2.0) to enable - the --truecolor switch, full alpha - transparency, proper rescaling of + the --truecolor switch, full alpha + transparency, proper rescaling of included bitmaps, and jpeg inclusion: $ac_cv_func_gdImageCreateTrueColor Your gd has jpeg inclusion enabled: $ac_cv_func_gdImageCreateFromJpeg - Your gd is new enough (>=2.0.12) to + Your gd is new enough (>=2.0.12) to enable transparent backgrounds for EPS inclusion and the -z (compression) switch: $ac_cv_func_gdImagePngEx Your gd is new enough (>=2.0.21) to allow image creation from memory $ac_cv_func_gdImageCreateFromPngPtr Your gd is new enough (>=2.0.28) to - enable gif inclusion and output + enable gif inclusion and output (dvigif): $ac_cv_func_gdImageGif FreeType font rendering available: $ac_have_freetype2 Support for subfonts (CJK-LaTeX): $ac_have_freetype2 - T1lib font rendering available: $ac_cv_lib_t1_T1_InitLib ]) AC_CONFIG_HEADER([config.h]) diff -Nru dvipng-1.14/COPYING.gd dvipng-1.15/COPYING.gd --- dvipng-1.14/COPYING.gd 1970-01-01 00:00:00.000000000 +0000 +++ dvipng-1.15/COPYING.gd 2015-03-02 19:33:56.000000000 +0000 @@ -0,0 +1,54 @@ +The below is the copyright notice of the gd library. +---------------------------------------------------- + +Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002 by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188 +by the National Institutes of Health. + +Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by +Boutell.Com, Inc. + +Portions relating to GD2 format copyright 1999, 2000, 2001, 2002 +Philip Warner. + +Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg +Roelofs. + +Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John +Ellson (ellson@lucent.com). + +Portions relating to gdft.c copyright 2001, 2002 John Ellson +(ellson@lucent.com). + +Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +Pierre-Alain Joye (pierre@libgd.org). + +Portions relating to JPEG and to color quantization copyright 2000, +2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997, +1998, 1999, 2000, 2001, 2002, Thomas G. Lane. This software is +based in part on the work of the Independent JPEG Group. See the +file README-JPEG.TXT for more information. + +Portions relating to WBMP copyright 2000, 2001, 2002 Maurice +Szmurlo and Johan Van den Brande. + +Permission has been granted to copy, distribute and modify gd in +any context without fee, including a commercial application, +provided that this notice is present in user-accessible supporting +documentation. + +This does not affect your ownership of the derived work itself, and +the intent is to assure proper credit for the authors of gd, not to +interfere with your productive use of gd. If you have questions, +ask. "Derived works" includes all programs that utilize the +library. Credit must be given in user-accessible documentation. + +This software is provided "AS IS." The copyright holders disclaim +all warranties, either express or implied, including but not +limited to implied warranties of merchantability and fitness for a +particular purpose, with respect to this code and accompanying +documentation. + +Although their code does not appear in gd, the authors wish to thank +David Koblas, David Rowley, and Hutchison Avenue Software Corporation +for their prior contributions. diff -Nru dvipng-1.14/debian/changelog dvipng-1.15/debian/changelog --- dvipng-1.14/debian/changelog 2013-08-10 23:23:20.000000000 +0000 +++ dvipng-1.15/debian/changelog 2016-01-08 14:22:36.000000000 +0000 @@ -1,3 +1,13 @@ +dvipng (1.15-0ubuntu1) xenial; urgency=medium + + * New upstream version. + - Fix segfault with missing xcolor.sty. Closes: #712570. + - Fix segfault with OOM conditions. Closes: #778524. + * dvipng: Recommend latex-xcolor. LP: #1191673. + * Bump standards version, debian compat level. + + -- Matthias Klose Fri, 08 Jan 2016 15:16:19 +0100 + dvipng (1.14-2) unstable; urgency=low * Build-Depends replace libpng12-dev with libpng-dev diff -Nru dvipng-1.14/debian/compat dvipng-1.15/debian/compat --- dvipng-1.14/debian/compat 2013-08-10 23:23:20.000000000 +0000 +++ dvipng-1.15/debian/compat 2016-01-08 14:17:27.000000000 +0000 @@ -1,2 +1 @@ -7 - +9 diff -Nru dvipng-1.14/debian/control dvipng-1.15/debian/control --- dvipng-1.14/debian/control 2013-08-10 23:23:20.000000000 +0000 +++ dvipng-1.15/debian/control 2016-01-08 14:18:47.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Varun Hiremath Build-Depends: cdbs, debhelper (>= 7), libgd2-noxpm-dev, libpng-dev, libfreetype6-dev, libkpathsea-dev, texinfo -Standards-Version: 3.9.4 +Standards-Version: 3.9.6 Homepage: http://www.nongnu.org/dvipng/ Vcs-Git: git://git.debian.org/users/varun/dvipng.git Vcs-Browser: http://git.debian.org/?p=users/varun/dvipng.git;a=summary @@ -12,6 +12,7 @@ Package: dvipng Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, texlive-base-bin, ghostscript +Recommends: latex-xcolor Description: convert DVI files to PNG graphics dvipng makes PNG graphics from DVI files as obtained from TeX and its relatives. It is intended to produce anti-aliased diff -Nru dvipng-1.14/draw.c dvipng-1.15/draw.c --- dvipng-1.14/draw.c 2010-03-17 13:02:35.000000000 +0000 +++ dvipng-1.15/draw.c 2015-03-02 19:33:55.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -28,7 +28,7 @@ #include /* isprint */ #endif -struct stack_entry { +struct stack_entry { dviunits h, v, w, x, y, z; /* stack entry */ subpixels hh,vv; } stack[STACK_SIZE+1]; /* stack + space for current pos */ @@ -49,7 +49,7 @@ DEBUG_PRINT(DEBUG_DVI, \ (" drift (%d,%d)", \ dvi_stack->hh-PIXROUND(dvi_stack->h,dvi->conv*shrinkfactor), \ - dvi_stack->vv-PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor))); + dvi_stack->vv-PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor))); #define MoveRight(x) \ temp=x; dvi_stack->h += temp; \ @@ -77,7 +77,7 @@ { struct char_entry* ptr=NULL; - if (currentfont==NULL) + if (currentfont==NULL) Fatal("faulty DVI, trying to set character from null font"); if (c<0 || c>LASTFNTCHAR) { Warning("glyph index out of range (%d), skipping",c); @@ -92,7 +92,6 @@ switch (currentfont->type) { case FONT_TYPE_VF: DEBUG_PRINT(DEBUG_DVI,("\n VF CHAR:\t")); break; case FONT_TYPE_PK: DEBUG_PRINT(DEBUG_DVI,("\n PK CHAR:\t")); break; - case FONT_TYPE_T1: DEBUG_PRINT(DEBUG_DVI,("\n T1 CHAR:\t")); break; case FONT_TYPE_FT: DEBUG_PRINT(DEBUG_DVI,("\n FT CHAR:\t")); break; default: DEBUG_PRINT(DEBUG_DVI,("\n NO CHAR:\t")) } @@ -104,12 +103,9 @@ if (currentfont->type==FONT_TYPE_VF) { return(SetVF(ptr)); } else { - if (ptr->data == NULL) + if (ptr->data == NULL) switch(currentfont->type) { case FONT_TYPE_PK: LoadPK(c, ptr); break; -#ifdef HAVE_LIBT1 - case FONT_TYPE_T1: LoadT1(c, ptr); break; -#endif #ifdef HAVE_FT2 case FONT_TYPE_FT: LoadFT(c, ptr); break; #endif @@ -156,7 +152,7 @@ dvi_stack->h += temp; dvi_stack->hh += PIXROUND(temp,dvi->conv*shrinkfactor); CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh); - } + } break; case SET_RULE: DEBUG_PRINT(DEBUG_DVI,(" %d %d", @@ -245,11 +241,13 @@ DEBUG_PRINT(DEBUG_DVI,(" %d", UNumRead(command+1, dvi_commandlength[*command]-1))); SetSpecial((char*)command + dvi_commandlength[*command], + (char*)command + dvi_commandlength[*command] + +UNumRead(command+1, dvi_commandlength[*command]-1), dvi_stack->hh,dvi_stack->vv); break; case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: if (((struct font_entry*)parent)->type==DVI_TYPE) { - FontDef(command, parent); + FontDef(command, parent); } else { Fatal("%s within VF macro from %s",dvi_commands[*command], ((struct font_entry*)parent)->n); @@ -290,7 +288,7 @@ } -static void DrawPage(dviunits hoffset, dviunits voffset) +static void DrawPage(dviunits hoffset, dviunits voffset) /* To be used after having read BOP and will exit cleanly when * encountering EOP. */ @@ -310,7 +308,7 @@ DrawCommand(command,dvi); command=DVIGetCommand(dvi); DEBUG_PRINT(DEBUG_DVI,("DRAW CMD:\t%s", dvi_commands[*command])); - } + } } void DrawPages(void) @@ -340,7 +338,7 @@ y_offset_def=y_offset_tightpage; } if (x_width_def >= 0) { /* extend BBOX */ - min(x_min,-x_offset_def); + min(x_min,-x_offset_def); max(x_max,x_min + x_width_def); min(y_min,-y_offset_def); max(y_max,y_min + y_width_def); @@ -348,7 +346,7 @@ if (x_width_def <= 0 || option_flags & EXPAND_BBOX) { x_width = x_max-x_min; y_width = y_max-y_min; - x_offset = -x_min; /* offset by moving topleft corner */ + x_offset = -x_min; /* offset by moving topleft corner */ y_offset = -y_min; /* offset by moving topleft corner */ } else { x_width=x_width_def; @@ -363,7 +361,7 @@ DEBUG_PRINT(DEBUG_DVI,("\n@%d PAGE START:\tBOP",dvi_pos->offset)); { int i; - for (i=0;i<10;i++) + for (i=0;i<10;i++) DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_pos->count[i])); DEBUG_PRINT(DEBUG_DVI,(" (%d)\n",dvi_pos->count[10])); } diff -Nru dvipng-1.14/dvi.c dvipng-1.15/dvi.c --- dvipng-1.14/dvi.c 2010-03-17 21:43:09.000000000 +0000 +++ dvipng-1.15/dvi.c 2015-03-02 19:33:56.000000000 +0000 @@ -18,14 +18,14 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ #include "dvipng.h" #ifdef MIKTEX # include -# define SLEEP Sleep(1000) +# define USLEEP Sleep #else /* MIKTEX */ # ifdef HAVE_LIBGEN_H # include @@ -33,13 +33,15 @@ # define basename xbasename # endif # ifdef WIN32 -# define SLEEP Sleep(1000) +# define USLEEP Sleep # include # else -# define SLEEP sleep(1) +# include +# define USLEEP usleep # endif /* WIN32 */ #endif /* MIKTEX */ #include +#include bool followmode=0; @@ -50,11 +52,14 @@ static unsigned char fgetc_follow(FILE* fp) { - int got=fgetc(fp); + int got=fgetc(fp),nsleep=1; while(followmode && got==EOF) { - SLEEP; + USLEEP(nsleep/1310); /* After a few trials, poll every 65536/1310=50 usec */ + clearerr(fp); got=fgetc(fp); + if (nsleep<50000) + nsleep*=2; } if (got==EOF) Fatal("DVI file ends prematurely"); @@ -107,41 +112,34 @@ struct dvi_data* dvi; if ((dvi = calloc(1,sizeof(struct dvi_data)))==NULL) - Fatal("cannot malloc memory for DVI struct"); - + Fatal("cannot allocate memory for DVI struct"); dvi->type = DVI_TYPE; dvi->fontnump=NULL; - - dvi->name = malloc(strlen(dviname)+5); - if (dvi->name==NULL) - Fatal("cannot malloc space for DVI filename"); + if ((dvi->name = malloc(strlen(dviname)+5))==NULL) + Fatal("cannot allocate space for DVI filename"); strcpy(dvi->name, dviname); tmpstring = strrchr(dvi->name, '.'); - if (tmpstring == NULL || strcmp(tmpstring,".dvi") != 0) + if (tmpstring == NULL || strcmp(tmpstring,".dvi") != 0) strcat(dvi->name, ".dvi"); - - if (outname==NULL) { - dvi->outname = malloc(strlen(basename(dviname))+7); - if (dvi->outname==NULL) { + if (outname==NULL) { + if ((dvi->outname = malloc(strlen(basename(dviname))+7))==NULL) { free(dvi->name); free(dvi); - Fatal("cannot malloc space for output filename"); + Fatal("cannot allocate space for output filename"); } strcpy(dvi->outname,basename(dviname)); tmpstring = strrchr(dvi->outname, '.'); - if (tmpstring != NULL && strcmp(tmpstring,".dvi") == 0) + if (tmpstring != NULL && strcmp(tmpstring,".dvi") == 0) *tmpstring = '\0'; strcat(dvi->outname, "%d.png"); } else { - dvi->outname = malloc(strlen(outname)+1); - if (dvi->outname==NULL) { + if ((dvi->outname = malloc(strlen(outname)+1))==NULL) { free(dvi->name); free(dvi); - Fatal("cannot malloc space for output filename"); + Fatal("cannot allocate space for output filename"); } strcpy(dvi->outname,outname); } - if ((dvi->filep = fopen(dvi->name,"rb")) == NULL) { /* do not insist on .dvi */ tmpstring = strrchr(dvi->name, '.'); @@ -149,7 +147,7 @@ dvi->filep = fopen(dvi->name,"rb"); } while((dvi->filep == NULL) && followmode) { - SLEEP; + USLEEP(50); *tmpstring='.'; if ((dvi->filep = fopen(dvi->name,"rb")) == NULL) { /* do not insist on .dvi */ @@ -173,7 +171,7 @@ /* This function reads in and stores the next dvi command. */ /* Mmap is not appropriate here, we may want to read from half-written files. */ -{ +{ static unsigned char* command=NULL; static uint32_t commlen=0; unsigned char *current = command; @@ -183,21 +181,21 @@ if (commlen==0) { commlen=STRSIZE; if ((current=command=malloc(commlen))==NULL) - Fatal("cannot malloc memory for DVI command"); + Fatal("cannot allocate memory for DVI command"); } DEBUG_PRINT(DEBUG_DVI,("\n@%ld ", ftell(dvi->filep))); *(current++) = fgetc_follow(dvi->filep); length = dvi_commandlength[*command]; if (length < 0) Fatal("undefined DVI op-code %d",*command); - while(current < command+length) + while(current < command+length) *(current++) = fgetc_follow(dvi->filep); switch (*command) { case XXX4: strlength = *(current - 4); case XXX3: strlength = strlength * 256 + *(current - 3); - case XXX2: + case XXX2: strlength = strlength * 256 + *(current - 2); case XXX1: strlength = strlength * 256 + *(current - 1); @@ -205,7 +203,7 @@ case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: strlength = *(current - 1) + *(current - 2); break; - case PRE: + case PRE: strlength = *(current - 1); break; } @@ -214,10 +212,10 @@ /* string + command length exceeds that of buffer */ commlen=strlength+1 + (uint32_t)length; if ((command=realloc(command,commlen))==NULL) - Fatal("cannot malloc memory for DVI command"); + Fatal("cannot allocate memory for DVI command"); current = command + length; } - while(current < command+length+strlength) + while(current < command+length+strlength) *(current++) = fgetc_follow(dvi->filep); *current='\0'; } @@ -229,7 +227,7 @@ special */ /* Mmap is not appropriate here, we may want to read from half-written files. */ -{ +{ long fpos; uint32_t strlength=0; bool israwps=false; @@ -241,15 +239,15 @@ strlength = fgetc_follow(dvi->filep); case XXX3: strlength = strlength * 256 + fgetc_follow(dvi->filep); - case XXX2: + case XXX2: strlength = strlength * 256 + fgetc_follow(dvi->filep); case XXX1: strlength = strlength * 256 + fgetc_follow(dvi->filep); } - if (strlength > 0) { + if (strlength > 0) { switch(fgetc_follow(dvi->filep)) { case 'p': - if (strlength > 2 + if (strlength > 2 && fgetc_follow(dvi->filep)=='s' && fgetc_follow(dvi->filep)==':') israwps=true; @@ -263,19 +261,19 @@ } uint32_t CommandLength(unsigned char* command) -{ +{ /* generally 2^32+5 bytes max, but in practice 32 bit numbers suffice */ uint32_t length=0; length = dvi_commandlength[*command]; switch (*command) { - case XXX1: case XXX2: case XXX3: case XXX4: + case XXX1: case XXX2: case XXX3: case XXX4: length += UNumRead(command + 1,length - 1); break; - case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: + case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: length += *(command + length - 1) + *(command + length - 2); break; - case PRE: + case PRE: length += *(command + length - 1); break; } @@ -283,9 +281,9 @@ } static void SkipPage(struct dvi_data* dvi) -{ +{ /* Skip present page */ - unsigned char* command; + unsigned char* command; command=DVIGetCommand(dvi); while (*command != EOP) { @@ -297,7 +295,10 @@ case XXX1: case XXX2: case XXX3: case XXX4: DEBUG_PRINT(DEBUG_DVI,("NOSKIP CMD:\t%s %d", dvi_commands[*command], UNumRead(command+1, dvi_commandlength[*command]-1))); - SetSpecial((char*)command + dvi_commandlength[*command],0,0); + SetSpecial((char*)command + dvi_commandlength[*command], + (char*)command + dvi_commandlength[*command] + +UNumRead(command+1, dvi_commandlength[*command]-1), + 0,0); break; case BOP: case PRE: case POST: case POST_POST: Fatal("%s occurs within page", dvi_commands[*command]); @@ -316,7 +317,7 @@ { /* Find page start, return pointer to page_list entry if found */ struct page_list* tpagelistp=NULL; - unsigned char* command; + unsigned char* command; command=DVIGetCommand(dvi); /* Skip until page start or postamble */ @@ -334,10 +335,10 @@ } command=DVIGetCommand(dvi); } - if ((tpagelistp = + if ((tpagelistp = malloc(sizeof(struct page_list) +(csp+1-2)*sizeof(struct dvi_color)))==NULL) - Fatal("cannot malloc memory for new page entry"); + Fatal("cannot allocate memory for new page entry"); tpagelistp->next = NULL; if ( *command == BOP ) { /* Init page */ int i; @@ -348,7 +349,7 @@ tpagelistp->count[i] = UNumRead(command + 1 + i*4, 4); DEBUG_PRINT(DEBUG_DVI,(" %d",tpagelistp->count[i])); } - if (dvi->pagelistp==NULL) + if (dvi->pagelistp==NULL) tpagelistp->count[10] = 1; else tpagelistp->count[10] = dvi->pagelistp->count[10]+1; @@ -365,7 +366,7 @@ int SeekPage(struct dvi_data* dvi, struct page_list* page) { ReadColorStack(page); - return(fseek(dvi->filep, + return(fseek(dvi->filep, page->offset+((page->count[0]==PAGE_POST) ? 1L : 45L), SEEK_SET)); } @@ -375,7 +376,7 @@ struct page_list* tpagelistp; /* if page points to POST there is no next page */ - if (page!=NULL && page->count[0]==PAGE_POST) + if (page!=NULL && page->count[0]==PAGE_POST) return(NULL); /* If we have read past the last page in our current list or the @@ -415,18 +416,18 @@ struct page_list* FindPage(struct dvi_data* dvi, int32_t pagenum, bool abspage) - /* Find first page of certain number, + /* Find first page of certain number, absolute number if abspage is set */ { struct page_list* page=NextPage(dvi, NULL); - + if (pagenum==PAGE_LASTPAGE || pagenum==PAGE_POST) { while(page!=NULL && page->count[0]!=PAGE_POST) page=NextPage(dvi,page); if (pagenum==PAGE_LASTPAGE) page=PrevPage(dvi,page); } else - if (pagenum!=PAGE_FIRSTPAGE) + if (pagenum!=PAGE_FIRSTPAGE) while(page != NULL && pagenum != page->count[abspage ? 0 : 10]) page=NextPage(dvi,page); return(page); @@ -436,7 +437,7 @@ static void DelPageList(struct dvi_data* dvi) { struct page_list* temp; - + /* Delete the page list */ temp=dvi->pagelistp; @@ -469,7 +470,7 @@ DelPageList(dvi); ClearPSHeaders(); while(((dvi->filep = fopen(dvi->name,"rb")) == NULL) && followmode) { - SLEEP; + USLEEP(50); } if (dvi->filep == NULL) { perror(dvi->name); diff -Nru dvipng-1.14/dvipng.1 dvipng-1.15/dvipng.1 --- dvipng-1.14/dvipng.1 2010-10-23 12:01:04.000000000 +0000 +++ dvipng-1.15/dvipng.1 2015-03-02 19:33:55.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) +.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== @@ -38,6 +38,8 @@ . ds PI \(*p . ds L" `` . ds R" '' +. ds C` +. ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. @@ -48,17 +50,24 @@ .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX .. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{ +. if \nF \{ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. +. if !\nF==2 \{ +. nr % 0 +. nr F 2 +. \} +. \} .\} +.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -124,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "DVIPNG 1" -.TH DVIPNG 1 "2010-10-23" "dvipng 1.14" "User commands" +.TH DVIPNG 1 "2015-02-23" "dvipng 1.15" "User commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -145,24 +154,24 @@ \&\fBdvigif\fR binary or with the \fB\-\-gif\fR option. .PP The benefits of \fBdvipng\fR/\fBdvigif\fR include -.IP "\(bu" 4 +.IP "*" 4 Speed. It is a very fast bitmap-rendering code for \s-1DVI\s0 files, which makes it suitable for generating large amounts of images on-the-fly, as needed in preview-latex, WeBWorK and others. -.IP "\(bu" 4 +.IP "*" 4 It does not read the postamble, so it can be started before TeX finishes. There is a \fB\-\-follow\fR switch that makes dvipng wait at end-of-file for further output, unless it finds the \s-1POST\s0 marker that -indicates the end of the \s-1DVI\s0. -.IP "\(bu" 4 +indicates the end of the \s-1DVI.\s0 +.IP "*" 4 Interactive query of options. dvipng can read options interactively through stdin, and all options are usable. It is even possible to change the input file through this interface. -.IP "\(bu" 4 -Supports \s-1PK\s0, \s-1VF\s0, PostScript Type1, and TrueType fonts, subfonts (i.e., +.IP "*" 4 +Supports \s-1PK, VF,\s0 PostScript Type1, and TrueType fonts, subfonts (i.e., as used in CJK-LaTeX), color specials, and inclusion of PostScript, -\&\s-1PNG\s0, \s-1JPEG\s0 or \s-1GIF\s0 images. -.IP "\(bu" 4 +\&\s-1PNG, JPEG\s0 or \s-1GIF\s0 images. +.IP "*" 4 and more... .SH "OPTIONS" .IX Header "OPTIONS" @@ -205,7 +214,7 @@ .IP "\fB\-bg\fR \fIcolor_spec\fR" 4 .IX Item "-bg color_spec" Choose background color for the images. This option will be ignored if -there is a background color \especial in the \s-1DVI\s0. The color spec should +there is a background color \especial in the \s-1DVI.\s0 The color spec should be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. You can also specify 'Transparent' or 'transparent' which will give you a transparent background with the normal background as a fallback color. A @@ -267,7 +276,7 @@ .IP "\fB\-fg\fR \fIcolor_spec\fR" 4 .IX Item "-fg color_spec" Choose foreground color for the images. This option will be ignored if -there is a foreground color \especial in the \s-1DVI\s0. The color spec should +there is a foreground color \especial in the \s-1DVI.\s0 The color spec should be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. .IP "\fB\-\-follow*\fR" 4 .IX Item "--follow*" @@ -275,7 +284,7 @@ does not read the postamble, so it can be started before TeX finishes. This switch makes dvipng wait at end-of-file for further output, unless it finds the \s-1POST\s0 marker that indicates the end of the -\&\s-1DVI\s0. This is similar to \fBtail \-f\fR but for DVI-to-PNG conversion. +\&\s-1DVI.\s0 This is similar to \fBtail \-f\fR but for DVI-to-PNG conversion. .IP "\fB\-\-freetype*\fR" 4 .IX Item "--freetype*" Enable/disable FreeType font rendering (default on). This option is @@ -286,9 +295,7 @@ Modern installed, there will be no need to generate bitmapped (\s-1PK\s0) variants on disk of these. Then, you can render images at different (and unusual) resolutions without cluttering the disk with lots of bitmapped -fonts. Note that if you have both FreeType and T1lib on your system, -FreeType will be preferred by dvipng. If you for some reason would want -to use T1lib rendering, use this option. +fonts. .IP "\fB\-\-gamma\fR \fInum\fR" 4 .IX Item "--gamma num" Control the interpolation of colors in the greyscale anti-aliasing @@ -421,7 +428,7 @@ .IP "\fB\-Q\fR \fInum\fR" 4 .IX Item "-Q num" Set the quality to \fInum\fR. That is, choose the number of antialiasing -levels for bitmapped fonts (\s-1PK\s0) and fonts rendered using T1lib, to be +levels for bitmapped fonts (\s-1PK\s0), to be \&\fInum\fR*\fInum\fR+1. The default value is 4 which gives 17 levels of antialiasing for antialiased fonts from these two. If FreeType is available, its rendering is unaffected by this option. @@ -446,24 +453,11 @@ the left edge of the paper. This usually gives whitespace above and to the left in the produced image. The value \fBtight\fR will make dvipng only include all ink put on the page, producing neat images. -.IP "\fB\-\-t1lib*\fR" 4 -.IX Item "--t1lib*" -Enable T1lib font rendering (default on). This option is available if -the T1lib font library was present at compilation time. If this is the -case, dvipng will have direct support for PostScript Type1 fonts -internally, rather than using \fBgsftopk\fR for rendering the fonts. If -you have PostScript versions of Computer Modern installed, there will be -no need to generate bitmapped variants on disk of these. Then, you can -render images at different (and unusual) resolutions without cluttering -the disk with lots of bitmapped fonts. Note that if you have both -FreeType and T1lib on your system, FreeType will be preferred by dvipng, -and if you for some reason rather want to use T1lib, give the option -\&\fB\-\-freetype0\fR (see above). .IP "\fB\-\-truecolor*\fR" 4 .IX Item "--truecolor*" This will make \fBdvipng\fR generate truecolor output. Note that truecolor output is automatic if you include an external image in your -\&\s-1DVI\s0, e.g., via a PostScript special (i.e., the \fBgraphics\fR or +\&\s-1DVI,\s0 e.g., via a PostScript special (i.e., the \fBgraphics\fR or \&\fBgraphicx\fR package). This switch is overridden by the \&\fB\-\-palette\fR switch. .IP "\fB\-v*\fR" 4 @@ -510,4 +504,4 @@ version 3, see the \s-1COPYING\s0 file in the dvipng distribution or <\fBhttp://www.gnu.org/licenses/gpl.html\fR>. .PP -Copyright (c) 2002\-2010 Jan-AAke Larsson +Copyright (c) 2002\-2015 Jan-AAke Larsson diff -Nru dvipng-1.14/dvipng.c dvipng-1.15/dvipng.c --- dvipng-1.14/dvipng.c 2008-02-08 13:45:25.000000000 +0000 +++ dvipng-1.15/dvipng.c 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2008 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -36,7 +36,7 @@ int main(int argc, char ** argv) { bool parsestdin; - + #ifdef TIMING # ifdef HAVE_GETTIMEOFDAY gettimeofday(&Tp, NULL); @@ -95,7 +95,7 @@ kpse_init_prog("DVIPNG", 300, "cx", "cmr10"); #endif -#ifdef HAVE_FT2_OR_LIBT1 +#ifdef HAVE_FT2 InitPSFontMap(); #endif @@ -105,15 +105,13 @@ char line[STRSIZE]; printf("%s> ",dvi!=NULL?dvi->name:""); - fgets(line,STRSIZE,stdin); - while(!feof(stdin)) { + while(fgets(line,STRSIZE,stdin)) { DecodeString(line); if (dvi!=NULL) { DVIReOpen(dvi); DrawPages(); } printf("%s> ",dvi!=NULL?dvi->name:""); - fgets(line,STRSIZE,stdin); } printf("\n"); } @@ -128,12 +126,12 @@ timer = timebuffer.time + timebuffer.millitm/1000.0 - timer; # endif # endif - - if (ndone > 0) + + if (ndone > 0) fprintf(stderr, "Time of complete run: %.2f s, %d page(s), %.4f s/page.\n", timer, ndone, timer / ndone); - if (my_toc >= 0.0001) + if (my_toc >= 0.0001) fprintf(stderr, "Thereof in TIC/TOC region %.5f s.\n",my_toc); #endif @@ -141,24 +139,14 @@ ClearFonts(); DVIClose(dvi); ClearColorNames(); -#ifdef HAVE_FT2_OR_LIBT1 +#ifdef HAVE_FT2 ClearPSFontMap(); ClearEncoding(); -#endif -#ifdef HAVE_FT2 ClearSubfont(); - if (libfreetype!=NULL && FT_Done_FreeType(libfreetype)) - Fatal("an error occured during freetype destruction"); + if (libfreetype!=NULL && FT_Done_FreeType(libfreetype)) + Fatal("an error occured during freetype destruction"); libfreetype = NULL; -#endif -#ifdef HAVE_LIBT1 - if (libt1!=NULL && T1_CloseLib()) - Fatal("an error occured during t1lib destruction"); - libt1 = NULL; -#endif +#endif exit(exitcode); } - - - diff -Nru dvipng-1.14/dvipng.h dvipng-1.15/dvipng.h --- dvipng-1.14/dvipng.h 2010-10-14 19:27:42.000000000 +0000 +++ dvipng-1.15/dvipng.h 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -26,13 +26,6 @@ #define DVIPNG_H #include "config.h" -/* Autoconf may define malloc to rpl_malloc, if the system does not - * have a GNU Libc-compatible malloc (for which malloc(0) gives a - * valid pointer). We don't need that (yet) */ -#ifdef malloc -# undef malloc -#endif - #define STRSIZE 255 /* stringsize for file specifications */ #define FIRSTFNTCHAR 0 @@ -79,16 +72,10 @@ #endif #ifdef HAVE_FT2 -#define HAVE_FT2_OR_LIBT1 -#include +#include #include FT_FREETYPE_H #endif -#ifdef HAVE_LIBT1 -#define HAVE_FT2_OR_LIBT1 -#include -#endif - #ifdef HAVE_STDBOOL_H # include #else @@ -158,7 +145,7 @@ #define PAGE_POST INT32_MAX #define PAGE_LASTPAGE INT32_MAX-1 #define PAGE_MAXPAGE INT32_MAX-2 /* assume no pages out of this range */ -#define PAGE_FIRSTPAGE INT32_MIN +#define PAGE_FIRSTPAGE INT32_MIN #define PAGE_MINPAGE INT32_MIN+1 /* assume no pages out of this range */ struct dvi_color { @@ -186,7 +173,7 @@ bool DVIFollowToggle(void); unsigned char* DVIGetCommand(struct dvi_data*); bool DVIIsNextPSSpecial(struct dvi_data*); -uint32_t CommandLength(unsigned char*); +uint32_t CommandLength(unsigned char*); void ClearPSHeaders(void); /********************************************************/ @@ -237,28 +224,21 @@ int32_t charindex[256]; }; -#ifdef HAVE_FT2_OR_LIBT1 +#ifdef HAVE_FT2 struct psfontmap { struct psfontmap *next; char *line,*psfile,*tfmname,*encname,*end; struct encoding* encoding; -#ifdef HAVE_FT2 FT_Matrix* ft_transformp; FT_Matrix ft_transform; struct subfont* subfont; -#endif -#ifdef HAVE_LIBT1 - T1_TMATRIX* t1_transformp; - T1_TMATRIX t1_transform; -#endif }; #endif #define FONT_TYPE_PK 1 #define FONT_TYPE_VF 2 #define FONT_TYPE_FT 3 -#define FONT_TYPE_T1 4 -struct char_entry { /* PK/FT/T1 Glyph/VF Macro */ +struct char_entry { /* PK/FT Glyph/VF Macro */ dviunits tfmw; /* TFM width */ unsigned char *data; /* glyph data, either pixel data * (0=transp, 255=max ink) or VF macro */ @@ -274,22 +254,17 @@ struct font_entry { /* font entry */ int type; /* PK/VF/Type1 ... */ struct font_entry *next; - uint32_t c, s, d; - uint8_t a, l; + uint32_t c, s, d; + uint8_t a, l; char n[STRSIZE]; /* FNT_DEF command parameters */ int dpi; /* computed from s and d */ char * name; /* full name of PK/VF file */ struct filemmap fmmap; /* file memory map */ uint32_t magnification; /* magnification read from font file */ uint32_t designsize; /* design size read from font file */ - void * chr[NFNTCHARS]; /* character information */ + void * chr[NFNTCHARS]; /* character information */ #ifdef HAVE_FT2 FT_Face face; /* Freetype2 face */ -#endif -#ifdef HAVE_LIBT1 - int T1id; /* T1lib font id */ -#endif -#ifdef HAVE_FT2_OR_LIBT1 struct psfontmap* psfontmap; /* Font transformation */ #endif struct font_num *vffontnump; /* VF local font numbering */ @@ -311,10 +286,10 @@ void FontDef(unsigned char*, void* /* dvi/vf */); void ClearFonts(void); -void SetFntNum(int32_t, void* /* dvi/vf */); +void SetFntNum(int32_t, void* /* dvi/vf */); void FreeFontNumP(struct font_num *hfontnump); -#ifdef HAVE_FT2_OR_LIBT1 +#ifdef HAVE_FT2 char* copyword(char* orig); struct psfontmap *NewPSFont(struct psfontmap* copyfrom); void InitPSFontMap(void); @@ -323,9 +298,6 @@ struct encoding* FindEncoding(char*); void ClearEncoding(void); bool ReadTFM(struct font_entry *, char*); -#endif - -#ifdef HAVE_FT2 bool InitFT(struct font_entry *); void DoneFT(struct font_entry *tfontp); void LoadFT(int32_t, struct char_entry *); @@ -333,12 +305,6 @@ void ClearSubfont(void); #endif -#ifdef HAVE_LIBT1 -bool InitT1(struct font_entry *); -void DoneT1(struct font_entry *tfontp); -void LoadT1(int32_t, struct char_entry *); -#endif - /********************************************************/ /********************* ppagelist.h ********************/ /********************************************************/ @@ -368,7 +334,7 @@ void CreateImage(pixels width, pixels height); void DestroyImage(void); -void DrawCommand(unsigned char*, void* /* dvi/vf */); +void DrawCommand(unsigned char*, void* /* dvi/vf */); void DrawPages(void); void WriteImage(char*, int); void LoadPK(int32_t, register struct char_entry *); @@ -377,7 +343,7 @@ void Gamma(double gamma); int32_t SetVF(struct char_entry *ptr); int32_t SetRule(int32_t, int32_t, int32_t, int32_t); -void SetSpecial(char *, int32_t, int32_t); +void SetSpecial(char *, char *, int32_t, int32_t); void BeginVFMacro(struct font_entry*); void EndVFMacro(void); @@ -422,21 +388,20 @@ #define TIGHT_BBOX (1<<4) #define FORCE_TRUECOLOR (1<<5) #define USE_FREETYPE (1<<6) -#define USE_LIBT1 (1<<7) -#define REPORT_HEIGHT (1<<8) -#define REPORT_DEPTH (1<<9) -#define REPORT_WIDTH (1<<10) -#define DVI_PAGENUM (1<<11) -#define MODE_PICKY (1<<12) -#define GIF_OUTPUT (1<<13) -#define MODE_STRICT (1<<14) -#define NO_GHOSTSCRIPT (1<<15) -#define NO_GSSAFER (1<<16) -#define BG_TRANSPARENT (1<<17) -#define BG_TRANSPARENT_ALPHA (1<<18) -#define FORCE_PALETTE (1<<19) -#define NO_RAW_PS (1<<20) -EXTERN uint32_t option_flags INIT(BE_NONQUIET | USE_FREETYPE | USE_LIBT1); +#define REPORT_HEIGHT (1<<7) +#define REPORT_DEPTH (1<<8) +#define REPORT_WIDTH (1<<9) +#define DVI_PAGENUM (1<<10) +#define MODE_PICKY (1<<11) +#define GIF_OUTPUT (1<<12) +#define MODE_STRICT (1<<13) +#define NO_GHOSTSCRIPT (1<<14) +#define NO_GSSAFER (1<<15) +#define BG_TRANSPARENT (1<<16) +#define BG_TRANSPARENT_ALPHA (1<<17) +#define FORCE_PALETTE (1<<18) +#define NO_RAW_PS (1<<19) +EXTERN uint32_t option_flags INIT(BE_NONQUIET | USE_FREETYPE); #define PAGE_GAVE_WARN 1 #define PAGE_PREVIEW_BOP (1<<1) @@ -456,8 +421,7 @@ #define DEBUG_ENC (1<<6) #define DEBUG_COLOR (1<<7) #define DEBUG_GS (1<<8) -#define DEBUG_T1 (1<<9) -#define LASTDEBUG DEBUG_T1 +#define LASTDEBUG DEBUG_GS #define DEBUG_DEFAULT DEBUG_DVI #else #define DEBUG_PRINT(a,b) @@ -511,13 +475,13 @@ # define min(x,y) if ((y)<(x)) x = y /* These are in pixels*/ -EXTERN int x_min INIT(0); +EXTERN int x_min INIT(0); EXTERN int y_min INIT(0); EXTERN int x_max INIT(0); EXTERN int y_max INIT(0); /* Page size: default set by -T */ -EXTERN int x_width_def INIT(0); +EXTERN int x_width_def INIT(0); EXTERN int y_width_def INIT(0); /* Offset: default set by -O and -T bbox */ @@ -525,14 +489,14 @@ EXTERN int y_offset_def INIT(0); /* Preview-latex's tightpage */ -EXTERN int x_width_tightpage INIT(0); +EXTERN int x_width_tightpage INIT(0); EXTERN int y_width_tightpage INIT(0); EXTERN int x_offset_tightpage INIT(0); EXTERN int y_offset_tightpage INIT(0); /* Paper size: set by -t, for cropmark purposes only */ /* This has yet to be written */ -EXTERN int x_pwidth INIT(0); +EXTERN int x_pwidth INIT(0); EXTERN int y_pwidth INIT(0); /* The transparent border preview-latex desires */ @@ -556,10 +520,6 @@ EXTERN FT_Library libfreetype INIT(NULL); #endif -#ifdef HAVE_LIBT1 -EXTERN void* libt1 INIT(NULL); -#endif - #define EXIT_FATAL EXIT_FAILURE+1 EXTERN int exitcode INIT(EXIT_SUCCESS); diff -Nru dvipng-1.14/dvipng.texi dvipng-1.15/dvipng.texi --- dvipng-1.14/dvipng.texi 2010-12-06 20:07:18.000000000 +0000 +++ dvipng-1.15/dvipng.texi 2015-03-02 19:33:56.000000000 +0000 @@ -9,8 +9,8 @@ @c man end @end ifset -@set version 1.14 -@set month-year October 2010 +@set version 1.15 +@set month-year February 2015 @c Put everything in one index (arbitrarily chosen to be the concept index). @syncodeindex fn cp @@ -39,8 +39,8 @@ @author by Jan-@AA{}ke Larsson. @page @vskip 0pt plus 1filll -Copyright @copyright{} 2002-2010 Jan-@AA{}ke Larsson - +Copyright @copyright{} 2002-2015 Jan-@AA{}ke Larsson + Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @@ -131,7 +131,7 @@ be output as @file{foo1.png}, @file{foo2.png}, @file{foo3.png}, and @file{foo4.png}, respectively. -If you have enabled the PostScript font support (via FreeType or T1lib), +If you have enabled the PostScript font support (via FreeType), fonts will be rendered as they are needed. Otherwise, dvipng will use bitmapped (PK) fonts, and if you use PK fonts that have not been used on your system before, they may be automatically generated; this process @@ -239,12 +239,12 @@ Set the debug flags, showing what dvipng (thinks it) is doing. This will work unless dvipng has been compiled without the @code{DEBUG} option (not recommended). Set the flags as you need them, use @samp{-d -1} as -the first option for maximum output. @xref{Debug options}. +the first option for maximum output. @xref{Debug options}. @item -D @var{num} @cindex output resolution, setting Set the output resolution, both horizontal and vertical, to @var{num} -dpi (dots per inch). +dpi (dots per inch). One may want to adjust this to fit a certain text font size (e.g., on a web page), and for a text font height of @var{font_px} pixels (in @@ -258,7 +258,7 @@ have to rescale that to pixels, using the screen resolution (default is usually 96 dpi) which means the formula is @example -@var{font_px} = @var{font_pt} * 96 / 72 [pt * px/in / (pt/in)] +@var{font_px} = @var{font_pt} * 96 / 72 [pt * px/in / (pt/in)] @end example On some high-res screens, the value is instead 120 dpi. Good luck! @@ -346,9 +346,7 @@ Modern installed, there will be no need to generate bitmapped (PK) variants on disk of these. Then, you can render images at different (and unusual) resolutions without cluttering the disk with lots of bitmapped -fonts. Note that if you have both FreeType and T1lib on your system, -FreeType will be preferred by dvipng. If you for some reason would want -to use T1lib rendering, use this option. +fonts. @item --gamma @var{num} @cindex gamma @@ -408,7 +406,7 @@ @pindex mktexpk@r{, avoiding} @c this description repeated in kpathsea.texi This option only has an effect when using bitmapped (PK) fonts. It turns -off automatic PK font generation (@file{mktexpk}). +off automatic PK font generation (@file{mktexpk}). @ignore @flindex missfont.log If @code{mktexpk}, the invocation is appended to a file @@ -459,10 +457,10 @@ @cindex offset pages Move the origin by @var{x-offset},@var{y-offset}, a comma-separated pair of dimensions such as @samp{.1in,-.3cm}. -@c (@pxref{papersize special}). +@c (@pxref{papersize special}). The origin of the page is shifted from the default position (of one inch down, one inch to the right from the upper left corner of -the paper) by this amount. +the paper) by this amount. @item -p [=]@var{num} @cindex first page printed @@ -533,7 +531,7 @@ @cindex antialiasing levels@r{, number of} @cindex quality Set the quality to @var{num}. That is, choose the number of antialiasing -levels for bitmapped fonts (PK) and fonts rendered using T1lib, to be +levels for bitmapped fonts (PK), to be @var{num}*@var{num}+1. The default value is 4 which gives 17 levels of antialiasing for antialiased fonts from these two. If FreeType is available, its rendering is unaffected by this option. @@ -566,7 +564,7 @@ Set the paper type to @var{papertype}. @c usually defined in one of the @c configuration files, along with the appropriate PostScript code to -@c select it (@pxref{Config file paper sizes}). +@c select it (@pxref{Config file paper sizes}). You can also specify a @var{papertype} of @samp{landscape}, which rotates a document by 90 degrees. To rotate a document whose paper type is not the default, you can use the @samp{-t} option twice, once for the @@ -590,23 +588,9 @@ the left edge of the paper. This usually gives whitespace above and to the left in the produced image. The value @samp{tight} will make dvipng only include all ink put on the page, producing neat images. -@c (@pxref{papersize special}). +@c (@pxref{papersize special}). @c This option overrides any papersize special in the DVI file. -@item --t1lib* -@cindex T1lib font rendering -Enable T1lib font rendering (default on). This option is available if -the T1lib font library was present at compilation time. If this is the -case, dvipng will have direct support for PostScript Type1 fonts -internally, rather than using @samp{gsftopk} for rendering the fonts. If -you have PostScript versions of Computer Modern installed, there will be -no need to generate bitmapped variants on disk of these. Then, you can -render images at different (and unusual) resolutions without cluttering -the disk with lots of bitmapped fonts. Note that if you have both -FreeType and T1lib on your system, FreeType will be preferred by dvipng, -and if you for some reason rather want to use T1lib, give the option -@samp{--freetype0} (see above). - @item --truecolor* @cindex truecolor output This will make @samp{dvipng} generate truecolor output. Note that @@ -614,8 +598,8 @@ DVI, e.g., via a PostScript special (i.e., the @samp{graphics} or @samp{graphicx} package). This switch is overridden by the @samp{--palette} switch. - -@item -v* + +@item -v* Enable verbose operation. This will currently indicate what fonts is used, in addition to the usual output. @@ -664,7 +648,7 @@ @c man end @node Graphics -@chapter Graphics +@chapter Graphics @samp{dvipng} attempts to handle graphics as included by the @samp{graphicx} and @samp{graphics} packages, without the need of @@ -789,8 +773,8 @@ @samp{background}, followed by a color specification. @menu -* Color specifications:: -* Color specials:: +* Color specifications:: +* Color specials:: @end menu @@ -804,9 +788,9 @@ @samp{hsb}, @samp{cmy}, @samp{cmyk}, or @samp{gray}) followed by the appropriate number of parameters. Thus, the color specification @samp{rgb 0.3 0.4 0.5} would correspond to the color that is @samp{0.3 -0.4 0.5} in its red, blue and green values. The color model used -internally in dvipng is @samp{RGB} (discretized to 256 levels), for -details on the formulas used in conversion, see the @samp{xcolor} +0.4 0.5} in its red, blue and green values. The color model used +internally in dvipng is @samp{RGB} (discretized to 256 levels), for +details on the formulas used in conversion, see the @samp{xcolor} documentation. By-name color specifications are single (case-dependent) words and are @@ -869,7 +853,7 @@ @section Contact information Bug reports should be sent to -@email{dvipng@@nongnu.org}. +@email{dvipng@@nongnu.org}. Questions, suggestions for new features, pleas for help, and/or praise should go to @email{dvipng@@nongnu.org}. For more information on this @@ -892,14 +876,14 @@ currently being tracked. To track a certain class of debug messages, simply provide the appropriate number given below; if you wish to track multiple classes, sum the numbers of the classes you wish to track. To -track all classes, you can use @code{-1}. +track all classes, you can use @code{-1}. Some of these debugging options are actually provided by Kpathsea (@pxref{Debugging, , , kpathsea, Kpathsea}). The classes are: @table @asis -@item 1 +@item 1 Normal dvi op-codes @item 2 Virtual fonts @@ -918,16 +902,15 @@ @item 256 GhostScript specials @item 512 -T1lib calls -@item 1024 Kpathsea @code{stat} calls -@item 2048 +@item 1024 Kpathsea hash table lookups -@item 4096 +@item 2048 Kpathsea path element expansion -@item 8192 +@item 4096 Kpathsea path searches @ignore +@item 8192 @item 16384 @end ignore @@ -966,7 +949,7 @@ version 3, see the COPYING file in the dvipng distribution or @url{http://www.gnu.org/licenses/gpl.html}. -Copyright @copyright{} 2002-2010 Jan-@AA{}ke Larsson +Copyright @copyright{} 2002-2015 Jan-@AA{}ke Larsson @c man end @end ifset @@ -989,11 +972,10 @@ @sp 2 @noindent -Copyright @copyright{} 2002-2010 Jan-@AA{}ke Larsson +Copyright @copyright{} 2002-2015 Jan-@AA{}ke Larsson @node Index @unnumbered Index @printindex cp @bye - diff -Nru dvipng-1.14/font.c dvipng-1.15/font.c --- dvipng-1.14/font.c 2010-03-17 21:41:29.000000000 +0000 +++ dvipng-1.15/font.c 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -85,7 +85,7 @@ if (((struct font_entry*)parent)->type==FONT_TYPE_VF) { DEBUG_PRINT(DEBUG_VF,(" %d %d %d",k,c,s)); /* Rescale. s is relative to the actual scale /(1<<20) */ - s = (uint32_t)((uint64_t) s * (((struct font_entry*) parent)->s) + s = (uint32_t)((uint64_t) s * (((struct font_entry*) parent)->s) / (1<<20)); DEBUG_PRINT(DEBUG_VF,(" (%d) %d",s,d)); /* Oddly, d differs in the DVI and the VF that my system produces */ @@ -114,17 +114,17 @@ tfontnump = tfontnump->next; } /* If found, return if it is correct */ - if (tfontnump!=NULL - && tfontnump->fontp->s == s - && tfontnump->fontp->d == d - && strlen(tfontnump->fontp->n) == a+l + if (tfontnump!=NULL + && tfontnump->fontp->s == s + && tfontnump->fontp->d == d + && strlen(tfontnump->fontp->n) == a+l && strncmp(tfontnump->fontp->n,(char*)current+14,a+l) == 0) { DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tMatch found",k)); return; } /* If not found, create new */ if (tfontnump==NULL) { - if ((tfontnump=malloc(sizeof(struct font_num)))==NULL) + if ((tfontnump=malloc(sizeof(struct font_num)))==NULL) Fatal("cannot malloc memory for new font number"); tfontnump->k=k; switch (((struct font_entry*)parent)->type) { @@ -140,17 +140,17 @@ /* Search font list for possible match */ tfontptr = hfontptr; - while (tfontptr != NULL - && (tfontptr->s != s - || tfontptr->d != d - || strlen(tfontptr->n) != a+l + while (tfontptr != NULL + && (tfontptr->s != s + || tfontptr->d != d + || strlen(tfontptr->n) != a+l || strncmp(tfontptr->n,(char*)current+14,a+l) != 0 ) ) { tfontptr = tfontptr->next; } /* If found, set its number and return */ if (tfontptr!=NULL) { DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tMatch found, number set",k)); - tfontnump->fontp = tfontptr; + tfontnump->fontp = tfontptr; return; } @@ -173,29 +173,27 @@ tfontptr->l = l; /* device length */ strncpy(tfontptr->n,(char*)current+14,a+l); /* full font name */ tfontptr->n[a+l] = '\0'; - + tfontptr->name = NULL; for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) { tfontptr->chr[i] = NULL; } - tfontptr->dpi = + tfontptr->dpi = (uint32_t)((ActualFactor((uint32_t)(1000.0*tfontptr->s /(double)tfontptr->d+0.5)) * ActualFactor(dvi->mag) * dpi*shrinkfactor) + 0.5); -#ifdef HAVE_FT2_OR_LIBT1 +#ifdef HAVE_FT2 tfontptr->psfontmap=NULL; #endif } -#ifdef HAVE_FT2_OR_LIBT1 -static char* kpse_find_t1_or_tt(char* filename) +#ifdef HAVE_FT2 +static char* kpse_find_t1_or_tt(char* filename) { char* filepath = kpse_find_file(filename, kpse_type1_format, false); -#ifdef HAVE_FT2 - if ((option_flags & USE_FREETYPE) && filepath==NULL) + if ((option_flags & USE_FREETYPE) && filepath==NULL) filepath = kpse_find_file(filename, kpse_truetype_format, false); -#endif return(filepath); } #endif @@ -208,10 +206,10 @@ DEBUG_PRINT(DEBUG_DVI,("\n FIND FONT:\t%s %d",tfontptr->n,tfontptr->dpi)); tfontptr->name = kpse_find_vf (tfontptr->n); - if (tfontptr->name!=NULL) + if (tfontptr->name!=NULL) InitVF(tfontptr); -#ifdef HAVE_FT2_OR_LIBT1 - else if (option_flags & (USE_FREETYPE | USE_LIBT1)) { +#ifdef HAVE_FT2 + else if (option_flags & USE_FREETYPE) { tfontptr->psfontmap = FindPSFontMap(tfontptr->n); if (tfontptr->psfontmap!=NULL) tfontptr->name=kpse_find_t1_or_tt(tfontptr->psfontmap->psfile); @@ -220,51 +218,39 @@ if (tfontptr->name!=NULL) { char* tfmname=kpse_find_file(tfontptr->n, kpse_tfm_format, false); if (tfmname!=NULL) { - if (!ReadTFM(tfontptr,tfmname)) { - Warning("unable to read tfm file %s", tfmname); - free(tfontptr->name); - tfontptr->name=NULL; - } else -#ifdef HAVE_FT2 - if ((option_flags & USE_FREETYPE)==0 || !InitFT(tfontptr)) { -#endif -#ifdef HAVE_LIBT1 - if ((option_flags & USE_LIBT1)==0 || !InitT1(tfontptr)) { -#endif - /* if Freetype or T1 loading fails for some reason, fall - back to PK font */ - free(tfontptr->name); - tfontptr->name=NULL; -#ifdef HAVE_LIBT1 - } -#endif -#ifdef HAVE_FT2 - } -#endif - free(tfmname); + if (!ReadTFM(tfontptr,tfmname)) { + Warning("unable to read tfm file %s", tfmname); + free(tfontptr->name); + tfontptr->name=NULL; + } else if ((option_flags & USE_FREETYPE)==0 || !InitFT(tfontptr)) { + /* if Freetype loading fails for some reason, fall back to PK font */ + free(tfontptr->name); + tfontptr->name=NULL; + } + free(tfmname); } } } -#endif /* HAVE_FT2_OR_LIBT1 */ +#endif /* HAVE_FT2 */ if (tfontptr->name==NULL) { tfontptr->name=kpse_find_pk (tfontptr->n, tfontptr->dpi, &font_ret); if (tfontptr->name!=NULL) { if (!FILESTRCASEEQ (tfontptr->n, font_ret.name)) { - page_flags |= PAGE_GAVE_WARN; - Warning("font %s not found, using %s at %d dpi instead", - tfontptr->n, font_ret.name, font_ret.dpi); - tfontptr->c = 0; /* no checksum warning */ - } else if (!kpse_bitmap_tolerance ((double)font_ret.dpi, - (double) tfontptr->dpi)) { - page_flags |= PAGE_GAVE_WARN; - Warning("font %s at %d dpi not found, using %d dpi instead", - tfontptr->n, tfontptr->dpi, font_ret.dpi); + page_flags |= PAGE_GAVE_WARN; + Warning("font %s not found, using %s at %d dpi instead", + tfontptr->n, font_ret.name, font_ret.dpi); + tfontptr->c = 0; /* no checksum warning */ + } else if (!kpse_bitmap_tolerance ((double)font_ret.dpi, + (double) tfontptr->dpi)) { + page_flags |= PAGE_GAVE_WARN; + Warning("font %s at %d dpi not found, using %d dpi instead", + tfontptr->n, tfontptr->dpi, font_ret.dpi); } InitPK(tfontptr); } else { page_flags |= PAGE_GAVE_WARN; Warning("font %s at %d dpi not found, characters will be left blank", - tfontptr->n, tfontptr->dpi); + tfontptr->n, tfontptr->dpi); #ifndef WIN32 tfontptr->fmmap.fd = 0; #else /* WIN32 */ @@ -291,11 +277,6 @@ DoneFT(tfontp); break; #endif -#ifdef HAVE_LIBT1 - case FONT_TYPE_T1: - DoneT1(tfontp); - break; -#endif } } @@ -304,7 +285,7 @@ { struct font_num *tmp; while(hfontnump!=NULL) { - tmp=hfontnump->next; + tmp=hfontnump->next; free(hfontnump); hfontnump=tmp; } @@ -352,5 +333,3 @@ if (currentfont->name==NULL) FontFind(currentfont); } - - diff -Nru dvipng-1.14/fontmap.c dvipng-1.15/fontmap.c --- dvipng-1.14/fontmap.c 2010-09-22 13:13:34.000000000 +0000 +++ dvipng-1.15/fontmap.c 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -30,7 +30,7 @@ #endif static struct psfontmap *psfontmap=NULL; -static char* newword(char** buffer, char* end) +static char* newword(char** buffer, char* end) { char *word,*pos=*buffer; @@ -43,7 +43,7 @@ return(word); } -char* copyword(char* orig) +char* copyword(char* orig) { char *word; @@ -76,8 +76,8 @@ if (psfont_name==NULL) { Warning("cannot find ps2pk.map, nor psfonts.map"); } else { - DEBUG_PRINT((DEBUG_FT|DEBUG_T1), - ("\n OPEN PSFONT MAP:\t'%s'", psfont_name)); + DEBUG_PRINT(DEBUG_FT, + ("\n OPEN PSFONT MAP:\t'%s'", psfont_name)); if (MmapFile(psfont_name,&psfont_mmap)) { Warning("psfonts map %s could not be opened", psfont_name); } @@ -86,7 +86,7 @@ #ifdef HAVE_FT2 psfont_name=find_format("ttfonts.map"); if (psfont_name!=NULL) { - DEBUG_PRINT(DEBUG_FT,("\n OPEN TTFONT MAP:\t'%s'", psfont_name)); + DEBUG_PRINT(DEBUG_FT,("\n OPEN TTFONT MAP:\t'%s'", psfont_name)); if (MmapFile(psfont_name,&ttfont_mmap)) { Warning("ttfonts map %s could not be opened", psfont_name); } @@ -106,9 +106,6 @@ newentry->psfile = copyword(copyfrom->psfile); newentry->encname = copyword(copyfrom->encname); newentry->encoding = copyfrom->encoding; -#ifdef HAVE_LIBT1 - newentry->t1_transformp = copyfrom->t1_transformp; -#endif #ifdef HAVE_FT2 newentry->ft_transformp = copyfrom->ft_transformp; newentry->subfont = copyfrom->subfont; @@ -120,9 +117,6 @@ newentry->psfile = NULL; newentry->encname = NULL; newentry->encoding = NULL; -#ifdef HAVE_LIBT1 - newentry->t1_transformp = NULL; -#endif #ifdef HAVE_FT2 newentry->ft_transformp = NULL; newentry->subfont = NULL; @@ -147,8 +141,8 @@ end=searching_mmap->data+searching_mmap->size; } while(postfmname,fontname)!=0)) { - while(pos < end - && (*pos=='\r' || *pos=='\n' || *pos==' ' || *pos=='\t' + while(pos < end + && (*pos=='\r' || *pos=='\n' || *pos==' ' || *pos=='\t' || *pos=='%' || *pos=='*' || *pos==';' || *pos=='#')) { while(pos < end && *pos!='\r' && *pos!='\n') pos++; /* skip comments/empty rows */ pos++; @@ -158,9 +152,9 @@ entry->line = pos; /* skip tfmname)); + + DEBUG_PRINT(DEBUG_FT,("\n PSFONTMAP: %s ",entry->tfmname)); pos=entry->line; end=entry->end; - while(pos < end) { + while(pos < end) { if (*pos=='<') { /* filename follows */ pos++; if (pospsfile = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<%s ",entry->psfile)); + DEBUG_PRINT(DEBUG_FT,("<%s ",entry->psfile)); } else if (posencname = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); + DEBUG_PRINT(DEBUG_FT,("<[%s ",entry->encname)); } else { /* encname=word; - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); - } else { /* encname)); + } else { /* psfile=word; - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<%s ",entry->psfile)); + DEBUG_PRINT(DEBUG_FT,("<%s ",entry->psfile)); } } } else if (*pos=='"') { /* PS code: reencoding/tranformation exists */ char *word; double cxx=1.0,cxy=0.0; pos++; - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\"")); + DEBUG_PRINT(DEBUG_FT,("\"")); while(pos < end && *pos!='"') { word=newword((char**)&pos,end); while(pos < end && (*pos==' ' || *pos=='\t')) pos++; if (pos+10ft_transform.yx=0; entry->ft_transform.yy=0x10000; #endif -#ifdef HAVE_LIBT1 - entry->t1_transformp=&(entry->t1_transform); - entry->t1_transform.cxx=cxx; - entry->t1_transform.cxy=cxy; - entry->t1_transform.cyx=0.0; - entry->t1_transform.cyy=1.0; -#endif - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\" ")); + DEBUG_PRINT(DEBUG_FT,("\" ")); pos++; } else { /* bare word */ switch (++nameno) { @@ -273,12 +260,12 @@ break; case 2: /* second word is psname, NOT psfile */ psname = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("(%s) ",psname)); + DEBUG_PRINT(DEBUG_FT,("(%s) ",psname)); free(psname); break; case 3: /* third word is encoding */ entry->encname = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); + DEBUG_PRINT(DEBUG_FT,("<[%s ",entry->encname)); break; default: while(pospsfile==NULL) { + if (entry->psfile==NULL) { /* No psfile-name given, use tfmname */ entry->psfile=copyword(entry->tfmname); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),(" <%s ",entry->psfile)); + DEBUG_PRINT(DEBUG_FT,(" <%s ",entry->psfile)); } - if (entry->encname!=NULL - && (entry->encoding=FindEncoding(entry->encname))==NULL) + if (entry->encname!=NULL + && (entry->encoding=FindEncoding(entry->encname))==NULL) Warning("unable to load font encoding '%s' for %s", entry->encname,entry->tfmname); } @@ -303,7 +290,7 @@ { struct psfontmap *entry; static struct filemmap* search_mmap_p=&psfont_mmap; - + entry=psfontmap; while(entry!=NULL && strcmp(entry->tfmname,fontname)!=0) entry=entry->next; @@ -331,9 +318,9 @@ } #endif } - if (entry!=NULL && entry->psfile==NULL) + if (entry!=NULL && entry->psfile==NULL) ReadPSFontMap(entry); - if (entry!=NULL && entry->encname!=NULL && entry->encoding==NULL) + if (entry!=NULL && entry->encname!=NULL && entry->encoding==NULL) /* Encoding given but it cannot be found. Unusable font */ return(NULL); return(entry); diff -Nru dvipng-1.14/ft.c dvipng-1.15/ft.c --- dvipng-1.14/ft.c 2010-02-11 14:09:10.000000000 +0000 +++ dvipng-1.15/ft.c 2015-03-02 19:33:56.000000000 +0000 @@ -30,6 +30,7 @@ FT_UInt glyph_i; int i,j,k; unsigned char* bit; + static bool hintwarning=false; DEBUG_PRINT(DEBUG_FT,("\n LOAD FT CHAR\t%d (%d)",c,ptr->tfmw)); if (currentfont->psfontmap!=NULL @@ -45,12 +46,17 @@ } else glyph_i = FT_Get_Char_Index( currentfont->face, c ); if (FT_Load_Glyph( currentfont->face, glyph_i, - FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT ) - /* On some configurations (with FreeType <= 2.1.7) the above - fails, while the below works */ - && FT_Load_Glyph( currentfont->face, glyph_i, - FT_LOAD_RENDER | FT_LOAD_NO_HINTING )) - Fatal("cannot load FT char %d",c); + FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT )) { + /* On some configurations (with FreeType <= 2.1.7) the above + fails, while the below works */ + if (!hintwarning) { + hintwarning=true; + Warning("the used FreeType does not have target_light hinting"); + } + if (FT_Load_Glyph( currentfont->face, glyph_i, + FT_LOAD_RENDER | FT_LOAD_NO_HINTING )) + Fatal("cannot load FT char %d",c); + } ptr->xOffset = -currentfont->face->glyph->bitmap_left*shrinkfactor; ptr->yOffset = (currentfont->face->glyph->bitmap_top-1)*shrinkfactor; bitmap=currentfont->face->glyph->bitmap; diff -Nru dvipng-1.14/INSTALL dvipng-1.15/INSTALL --- dvipng-1.14/INSTALL 2009-02-23 13:48:50.000000000 +0000 +++ dvipng-1.15/INSTALL 2015-03-02 19:33:55.000000000 +0000 @@ -1,95 +1,86 @@ Installing dvipng ***************** -Installing dvipng should be simple: merely `./configure', `make', and -`make install'. +Installing dvipng should be simple: merely './configure', 'make', and +'make install'. Prerequisites ============= * The GD Graphics Draw library, libgd - The drawing library `libgd' is necessary, and is downloadable at - `http://www.boutell.com/gd', and there are binary packages for - most operating systems from their respective distributors. In any - case, the latest version of the library installs using `autoconf' - so it should not be difficult for you to install it from source, - and then proceed with installing dvipng. + The drawing library 'libgd' is necessary, and is downloadable at + , and there are binary packages for most + operating systems from their respective distributors. In any case, + the latest version of the library installs using 'autoconf' so it + should not be difficult for you to install it from source, and then + proceed with installing dvipng. * The path-searching library kpathsea Kpathsea is most likely included in your LaTeX installation, but it - may happen that ./configure does not find it; see below. If you do - not have it, download it from `http://www.ctan.org' and compile it. + may happen that ./configure does not find it; see below. If you do + not have it, download it from and compile it. I have no experience with this, so I cannot help much here. * The font-rendering library FreeType 2 While not strictly necessary, a recent FreeType 2 is recommended - since dvipng currently will produce better-quality images when - this library is available. To take advantage of this, you should - have at least FreeType 2.1.9. + since dvipng currently will produce better-quality images when this + library is available. To take advantage of this, you should have + at least FreeType 2.1.9. FreeType 2 will enable direct support for PostScript and TrueType fonts, so that dvipng will not need to generate bitmapped variants on disk of the TeX fonts since modern TeX distributions include - PostScript versions of them. Then, you can render images at + PostScript versions of them. Then, you can render images at different (and unusual) resolutions without cluttering the disk with lots of bitmapped fonts. - Finally, it will enable subfont support in dvipng. That is, if you + Finally, it will enable subfont support in dvipng. That is, if you want to render CJK-LaTeX characters, you must have FreeType 2 installed. - * The font-rendering library T1lib - - An alternative to FreeType 2 is T1lib, but this will enable only - PostScript fonts in dvipng and will not include subfont support. - Also here, you can render images at different (and unusual) - resolutions without cluttering the disk with lots of bitmapped - fonts. If both FreeType 2 and T1lib are present, FreeType will be - internally preferred by dvipng but T1lib can be chosen at runtime. - * libpng and libz To be able to compress and write PNG files to disk, dvipng (or - really libgd) uses libpng which in turn uses libz. These should be + really libgd) uses libpng which in turn uses libz. These should be available on any modern system, if not, download them and install them. - * The `texinfo' package + * The 'texinfo' package This is needed for building the documentation. Configure ========= -The first step is to configure the source code, telling it where -various files will be. To do so, run +The first step is to configure the source code, telling it where various +files will be. To do so, run ./configure OPTIONS (Note: if you have fetched dvipng from CVS rather than a regular -release, you will have to first generate `./configure' by running -`autoconf' 2.53 or later.) +release, you will have to first generate './configure' by running +'autoconf' 2.53 or later.) On many machines, you will not need to specify any options, but if -`configure' cannot determine something on its own, you'll need to help -it out. For a list of the options type +'configure' cannot determine something on its own, you'll need to help +it out. For a list of the options type ./configure --help On some machines, the libraries will be installed in directories that -are not in the linker's search path. This will generate an error when -running `./configure', indicating that it cannot find libgd or -libkpathsea (most likely). You then need to specify the path to the -respective library's object files. They are typically called e.g., -`libgd.a' or `libgd.so'. If they are located in e.g., `/sw/local/lib', +are not in the linker's search path. This will generate an error when +running './configure', indicating that it cannot find libgd or +libkpathsea (most likely). You then need to specify the path to the +respective library's object files. They are typically called e.g., +'libgd.a' or 'libgd.so'. If they are located in e.g., '/sw/local/lib', do ./configure LDFLAGS=-L/sw/local/lib - If the library is available as a shared object file (`.so'), the + If the library is available as a shared object file ('.so'), the runtime linker may also need to be told where to find the library, then use @@ -97,11 +88,11 @@ When either of these is necessary, it is likely that the C header files are also installed in directories that are not in the C -preprocessor's search path. This will also generate an error when -running `./configure', indicating that it cannot find e.g., `gd.h' or -`kpathsea.h' (most likely). You then need to specify the path to the -respective library's C header files. If they are located in e.g., -`/sw/local/include', do +preprocessor's search path. This will also generate an error when +running './configure', indicating that it cannot find e.g., 'gd.h' or +'kpathsea.h' (most likely). You then need to specify the path to the +respective library's C header files. If they are located in e.g., +'/sw/local/include', do ./configure CPPFLAGS=-I/sw/local/include @@ -115,7 +106,7 @@ Build/install ============= -Once `configure' has been run, simply enter +Once 'configure' has been run, simply enter make @@ -130,31 +121,30 @@ Installation outside the texmf tree =================================== -In some cases, a dvipng binary installed outside the texmf tree will -not be able to find virtual fonts, or the PostScript font maps -(normally used by dvips). This may be because _only_ $SELFAUTOLOC, -$SELFAUTODIR, and $SELFAUTOPARENT are used in the texmf tree -configuration file `texmf.cnf'. If so, give the switch -`--enable-selfauto-set' to `./configure'. This will make dvipng adjust -these three internally so that kpathsea thinks that dvipng _is_ -installed in the texmf tree. +In some cases, a dvipng binary installed outside the texmf tree will not +be able to find virtual fonts, or the PostScript font maps (normally +used by dvips). This may be because _only_ $SELFAUTOLOC, $SELFAUTODIR, +and $SELFAUTOPARENT are used in the texmf tree configuration file +'texmf.cnf'. If so, give the switch '--enable-selfauto-set' to +'./configure'. This will make dvipng adjust these three internally so +that kpathsea thinks that dvipng _is_ installed in the texmf tree. Installation for non-privileged users ===================================== Often people without system administration privileges want to install -software for their private use. In that case you need to specify more -options to the `configure' script, usually this is done by using the -`--prefix' option to the `configure' script, and let it point to the -personal home directory. In that way, resulting binaries will be -installed under the `bin' subdirectory of your home directory, manual -pages under `man' and so on. That way, it is reasonably easy to +software for their private use. In that case you need to specify more +options to the 'configure' script, usually this is done by using the +'--prefix' option to the 'configure' script, and let it point to the +personal home directory. In that way, resulting binaries will be +installed under the 'bin' subdirectory of your home directory, manual +pages under 'man' and so on. That way, it is reasonably easy to maintain a bunch of additional packages, since the prefix argument is -supported by most `configure' scripts. +supported by most 'configure' scripts. - You'll have to add something like `/home/myself/bin' to your `PATH' + You'll have to add something like '/home/myself/bin' to your 'PATH' shell variable, if it isn't there already, and similarly set the -`INFOPATH' and `MANPATH' variables to be able to access the +'INFOPATH' and 'MANPATH' variables to be able to access the documentation. Copying @@ -162,7 +152,6 @@ This program is released under the GNU Lesser General Public License version 3, see the COPYING file in the dvipng distribution or -`http://www.gnu.org/licenses/'. - - Copyright (C) 2002-2009 Jan-AAke Larsson +. + Copyright (C) 2002-2015 Jan-AAke Larsson diff -Nru dvipng-1.14/install.texi dvipng-1.15/install.texi --- dvipng-1.14/install.texi 2009-02-23 13:48:50.000000000 +0000 +++ dvipng-1.15/install.texi 2015-03-02 19:33:56.000000000 +0000 @@ -1,5 +1,5 @@ @c install.texi -@c +@c @c Part of the dvipng distribution @include macros.texi @@ -9,15 +9,15 @@ @end ifset @c ----------------------- Installing dvipng should be simple: merely @code{./configure}, -@code{make}, and @code{make install}. +@code{make}, and @code{make install}. @ifclear rawfile @menu -* Prerequisites:: -* Configure:: -* Build/install:: +* Prerequisites:: +* Configure:: +* Build/install:: * Installation outside the texmf tree:: -* Advice for non-privileged users:: +* Advice for non-privileged users:: @end menu @end ifclear @@ -57,15 +57,6 @@ Finally, it will enable subfont support in dvipng. That is, if you want to render CJK-@LaTeX{} characters, you must have FreeType 2 installed. -@item The font-rendering library T1lib - -An alternative to FreeType 2 is T1lib, but this will enable only -PostScript fonts in dvipng and will not include subfont support. Also -here, you can render images at different (and unusual) resolutions -without cluttering the disk with lots of bitmapped fonts. If both -FreeType 2 and T1lib are present, FreeType will be internally -preferred by dvipng but T1lib can be chosen at runtime. - @item libpng and libz To be able to compress and write PNG files to disk, dvipng (or really @@ -74,7 +65,7 @@ @item The @code{texinfo} package -This is needed for building the documentation. +This is needed for building the documentation. @end itemize @node Configure @@ -150,7 +141,7 @@ make @end example -@noindent +@noindent at the prompt to compile the C code, and build the documentation files. To install the files into the locations chosen earlier, type @@ -158,7 +149,7 @@ make install @end example -@noindent +@noindent You may need special privileges to install, e.g., if you are installing into system directories. @@ -199,5 +190,5 @@ version 3, see the COPYING file in the dvipng distribution or @url{http://www.gnu.org/licenses/}. -Copyright @copyright{} 2002-2009 Jan-@AA{}ke Larsson +Copyright @copyright{} 2002-2015 Jan-@AA{}ke Larsson @end ifset diff -Nru dvipng-1.14/Makefile.in dvipng-1.15/Makefile.in --- dvipng-1.14/Makefile.in 2010-12-06 19:53:01.000000000 +0000 +++ dvipng-1.15/Makefile.in 2015-03-02 19:33:55.000000000 +0000 @@ -18,7 +18,7 @@ # License along with this program. If not, see # . # -# Copyright (C) 2002-2008 Jan-Åke Larsson +# Copyright (C) 2002-2015 Jan-Åke Larsson # #************************************************************************ @@ -40,6 +40,7 @@ bindir = @bindir@ infodir = @infodir@ mandir = @mandir@ +datarootdir = @datarootdir@ DESTDIR= INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -64,7 +65,7 @@ ####################################### The program dvipng: $(objects) - $(CC) $(LDFLAGS) $(objects) -o dvipng $(LIBS) + $(CC) $(LDFLAGS) $(objects) -o dvipng $(LIBS) $(objects): dvipng.h commands.h config.h @@ -83,7 +84,7 @@ -$(TEXIDVI) -I $(srcdir) $(srcdir)/dvipng.texi dvipng.ps: dvipng.dvi - $(DVIPS) -Ppdf dvipng.dvi + $(DVIPS) -Ppdf dvipng.dvi dvipng.info: $(TEXIFILES) dvipng.help -$(MAKEINFO) -I$(srcdir) $(srcdir)/dvipng.texi @@ -100,7 +101,7 @@ -I $(srcdir) $(srcdir)/dvipng.texi (cd html; for i in *; do \ sed -e "s/Jan-A/Jan-\Å\;/g" $$i > ../www/$$i; \ - done) + done) cp www/dvipng.html www/index.html rm -rf html @@ -135,13 +136,14 @@ clean: rm -f *.o dvipng *.help *.info* *dvipng.dvi *.aux *.log - rm -f *dvipng.ps *.cp *.fn *.ky *~ \#*\# \ + rm -f *dvipng*.png *.cp *.fn *.ky *~ \#*\# \ *.tp *.vr *.pg *.toc *.tp *.bak *.cps *.kys *.tps \ *.fns *.vrs *.pgs *.html *.tmp distclean: clean rm -f Makefile rm -f config.status config.log config.cache c-auto.h + rm -rf autom4te.cache ####################################### Maintainer targets @@ -156,7 +158,7 @@ -I$(srcdir) $(srcdir)/readme.texi --output README dvipng.1: dvipng.texi readme.texi - texi2pod.pl -D man $(srcdir)/dvipng.texi | \ + ~/bin/texi2pod.pl -D man $(srcdir)/dvipng.texi | \ sed -es/@//g -es/previewlatex/preview-latex/g -es/{}//g > dvipng.pod pod2man --center="User commands" --release=$(PACKAGE_STRING)\ dvipng.pod > dvipng.1 @@ -166,4 +168,3 @@ # SunOS make suffix rule wierdness .cps.h: - diff -Nru dvipng-1.14/miktex.h dvipng-1.15/miktex.h --- dvipng-1.14/miktex.h 2008-02-08 13:45:24.000000000 +0000 +++ dvipng-1.15/miktex.h 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2008 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -124,9 +124,6 @@ /* Define to 1 if you have the `png' library (-lpng). */ #define HAVE_LIBPNG 1 -/* Define to 1 if you have the `t1' library (-lt1). */ -#undef HAVE_LIBT1 - /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ @@ -144,7 +141,7 @@ #undef HAVE_MMAP /* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP +#undef HAVE_MUNMAP /* Define to 1 if you have the header file. */ #define HAVE_PNG_H 1 @@ -194,9 +191,6 @@ /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H -/* Define to 1 if you have the header file. */ -#undef HAVE_T1LIB_H - /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H diff -Nru dvipng-1.14/misc.c dvipng-1.15/misc.c --- dvipng-1.14/misc.c 2010-09-30 10:13:40.000000000 +0000 +++ dvipng-1.15/misc.c 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -62,7 +62,7 @@ Message(BE_NONQUIET,"This is %s",programname); if (strcmp(basename(programname),PACKAGE_NAME)!=0) Message(BE_NONQUIET," (%s)", PACKAGE_NAME); - Message(BE_NONQUIET," %s Copyright 2002-2010 Jan-Ake Larsson\n", + Message(BE_NONQUIET," %s Copyright 2002-2015 Jan-Ake Larsson\n", PACKAGE_VERSION); } @@ -77,7 +77,7 @@ switch (c) { case 'd': /* selects Debug output */ if (*p>'9' && *p!='-') { - if (strncmp(p,"vinum",5)==0) { + if (strncmp(p,"vinum",5)==0) { if (p[5] != '0') { option_flags |= DVI_PAGENUM; Message(PARSE_STDIN,"DVI page number output on\n",p); @@ -86,7 +86,7 @@ Message(PARSE_STDIN,"DVI page number output off\n"); } break; - } else if (strncmp(p,"epth",4)==0) { /* Depth reporting */ + } else if (strncmp(p,"epth",4)==0) { /* Depth reporting */ if (p[4] != '0') { option_flags |= REPORT_DEPTH; Message(PARSE_STDIN,"Depth reporting on\n",p); @@ -97,14 +97,14 @@ break; } goto DEFAULT; - } else { + } else { #ifdef DEBUG if (*p == 0 && argv[i+1]) p = argv[i+1]; debug = atoi(p); if (debug > 0) { if (p == argv[i+1]) i++; - } else + } else debug = DEBUG_DEFAULT; Message(PARSE_STDIN,"Debug output enabled\n"); #ifdef HAVE_LIBKPATHSEA @@ -130,7 +130,7 @@ makeTexPK = (*p == '0'); #ifdef HAVE_LIBKPATHSEA kpse_set_program_enabled (kpse_pk_format, makeTexPK, kpse_src_cmdline); -#endif +#endif if (makeTexPK) Message(PARSE_STDIN,"MakeTeXPK enabled\n"); else @@ -148,7 +148,7 @@ case 'h': if (strcmp(p,"elp") == 0 ) { break; - } else if (strncmp(p,"eight",5) == 0 ) { /* Height reporting */ + } else if (strncmp(p,"eight",5) == 0 ) { /* Height reporting */ if (p[5] != '0') { option_flags |= REPORT_HEIGHT; Message(PARSE_STDIN,"Height reporting on\n",p); @@ -166,7 +166,7 @@ Message(PARSE_STDIN,"Offset: (%d,%d)\n",x_offset_def,y_offset_def); break ; case 'e': - if (strncmp(p,"xpand-bbox",10) == 0 ) { + if (strncmp(p,"xpand-bbox",10) == 0 ) { if (p[10] != '0') { option_flags |= EXPAND_BBOX; Message(PARSE_STDIN,"BBox expansion on\n",p); @@ -197,28 +197,16 @@ case 't': /* specify paper format, only for cropmarks */ #ifdef HAVE_GDIMAGECREATETRUECOLOR /* Truecolor */ - if (strncmp(p,"ruecolor",8)==0) { + if (strncmp(p,"ruecolor",8)==0) { if (p[8] != '0') { - option_flags |= FORCE_TRUECOLOR; + option_flags |= FORCE_TRUECOLOR; Message(PARSE_STDIN,"Truecolor mode on\n",p); - } else { - option_flags &= ~FORCE_TRUECOLOR; + } else { + option_flags &= ~FORCE_TRUECOLOR; Message(PARSE_STDIN,"Truecolor mode off\n"); } - } else -#endif -#ifdef HAVE_LIBT1 - if ( strncmp(p,"1lib",4) == 0 ) { /* -t1lib activation */ - if (p[4] != '0') { - option_flags |= USE_LIBT1; - Message(PARSE_STDIN,"t1lib rendering on\n",p); - } else { - option_flags &= ~USE_LIBT1; - Message(PARSE_STDIN,"t1lib rendering off\n"); - } - } else + } else #endif - { /* cropmarks not implemented yet */ if (*p == 0 && argv[i+1]) p = argv[++i] ; @@ -252,16 +240,16 @@ p++; if (*p == 0 && argv[i+1]) p = argv[++i] ; - if (strncmp(p,"Transparent",11) == 0 ) + if (strncmp(p,"Transparent",11) == 0 ) option_flags |= BG_TRANSPARENT_ALPHA; - else if (strncmp(p,"transparent",11) == 0 ) + else if (strncmp(p,"transparent",11) == 0 ) option_flags |= BG_TRANSPARENT; else background(p); - if (option_flags & BG_TRANSPARENT) + if (option_flags & BG_TRANSPARENT) Message(PARSE_STDIN,"Transp. background (fallback rgb %d,%d,%d)\n", cstack[0].red,cstack[0].green,cstack[0].blue); - else + else Message(PARSE_STDIN,"Background: rgb %d,%d,%d\n", cstack[0].red,cstack[0].green,cstack[0].blue); break; @@ -299,7 +287,7 @@ bordercolor.red, bordercolor.green, bordercolor.blue); } break; - } + } goto DEFAULT; case 'f': if ( *p == 'g' ) { /* -fg foreground color */ @@ -315,7 +303,7 @@ if (p[7] != '0') { option_flags |= USE_FREETYPE; Message(PARSE_STDIN,"FreeType rendering on\n",p); - } else { + } else { option_flags &= ~USE_FREETYPE; Message(PARSE_STDIN,"FreeType rendering off\n"); } @@ -333,7 +321,7 @@ if (*p == 0 && argv[i+1]) p = argv[++i] ; number = atoi(p); - if (number < 1 || number > 1000000) + if (number < 1 || number > 1000000) Warning("Bad magnification parameter (-x or -y), ignored"); else { usermag=number; @@ -342,7 +330,7 @@ } break ; case 'g' : - if (strncmp(p,"amma",4)==0) { /* --gamma correction */ + if (strncmp(p,"amma",4)==0) { /* --gamma correction */ double gamma=0.0; p+=4; @@ -358,7 +346,7 @@ Message(PARSE_STDIN,"Gamma value is %s\n", gamma); break; #ifdef HAVE_GDIMAGEGIF - } else if (strncmp(p,"if",2)==0) { /* --gif output */ + } else if (strncmp(p,"if",2)==0) { /* --gif output */ option_flags |= GIF_OUTPUT; Message(PARSE_STDIN,"GIF output\n"); break; @@ -374,10 +362,10 @@ Message(PARSE_STDIN,"Page list: %s\n",p); if (ParsePages(p)) Fatal("bad page list specifier (-pp)"); - } else if (strncmp(p,"ng",2)==0) { /* --png output */ + } else if (strncmp(p,"ng",2)==0) { /* --png output */ option_flags &= ~GIF_OUTPUT; Message(PARSE_STDIN,"PNG output\n"); - } else if (strncmp(p,"icky",4)==0) { + } else if (strncmp(p,"icky",4)==0) { if (p[4] != '0') { option_flags |= MODE_PICKY; Message(PARSE_STDIN,"No images output for pages with warnings\n",p); @@ -385,7 +373,7 @@ option_flags &= ~MODE_PICKY; Message(PARSE_STDIN,"Images output even for pages with warnings\n"); } - } else if (strncmp(p,"alette",6)==0) { + } else if (strncmp(p,"alette",6)==0) { if (p[6] != '0') { option_flags |= FORCE_PALETTE; Message(PARSE_STDIN,"Forcing 256-color PNG output\n",p); @@ -412,7 +400,7 @@ } break ; case 's' : - if (strncmp(p,"trict",5)==0) { + if (strncmp(p,"trict",5)==0) { if (p[5] != '0') { option_flags |= MODE_STRICT; Message(PARSE_STDIN,"Warnings are fatal\n",p); @@ -424,7 +412,7 @@ goto DEFAULT; break ; case 'n' : - if (strncmp(p,"oghostscript",12)==0) { + if (strncmp(p,"oghostscript",12)==0) { if (p[12] != '0') { option_flags |= NO_GHOSTSCRIPT; Message(PARSE_STDIN,"No GhostScript calls\n",p); @@ -432,7 +420,7 @@ option_flags &= ~NO_GHOSTSCRIPT; Message(PARSE_STDIN,"GhostScript calls made\n"); } - } else if (strncmp(p,"ogssafer",8)==0) { + } else if (strncmp(p,"ogssafer",8)==0) { if (p[8] != '0') { option_flags |= NO_GSSAFER; Message(PARSE_STDIN,"GhostScript calls does not use -dSAFER\n",p); @@ -440,7 +428,7 @@ option_flags &= ~NO_GSSAFER; Message(PARSE_STDIN,"GhostScript calls use -dSAFER\n"); } - } else if (strncmp(p,"ogs",3)==0) { + } else if (strncmp(p,"ogs",3)==0) { if (p[3] != '0') { option_flags |= NO_GHOSTSCRIPT; Message(PARSE_STDIN,"No GhostScript calls\n",p); @@ -448,7 +436,7 @@ option_flags &= ~NO_GHOSTSCRIPT; Message(PARSE_STDIN,"GhostScript calls made\n"); } - } else if (strncmp(p,"orawps",6)==0) { + } else if (strncmp(p,"orawps",6)==0) { if (p[6] != '0') { option_flags |= NO_RAW_PS; Message(PARSE_STDIN,"Conversion of raw PostScript will not be attempted\n",p); @@ -469,7 +457,7 @@ if (*p == '=') { abspage=true; p++ ; - } + } if ((*p>='0'&&*p<='9') || (*p=='-' && *(p+1)>='0' && *(p+1)<='9')) { lastpage = atoi(p); LastPage(lastpage,abspage); @@ -511,22 +499,19 @@ Warning("the Freetype library seems unusable"); else { FT_Int amajor, aminor, apatch; - + FT_Library_Version( libfreetype, &amajor, &aminor, &apatch ); printf("Using libft %d.%d.%d\n",amajor, aminor, apatch); - FT_Done_FreeType(libfreetype); + FT_Done_FreeType(libfreetype); } # endif #endif -#ifdef HAVE_LIBT1 - printf("Using t1lib %s\n", T1_GetLibIdent()); -#endif - puts ("Copyright (C) 2002-2010 Jan-Ake Larsson.\n\ + puts ("Copyright (C) 2002-2015 Jan-Ake Larsson.\n\ There is NO warranty. You may redistribute this software\n\ under the terms of the GNU Lesser General Public License\n\ version 3, see the COPYING file in the dvipng distribution\n\ or ."); - exit (EXIT_SUCCESS); + exit (EXIT_SUCCESS); } if (*p != '0') option_flags |= BE_NONQUIET | BE_VERBOSE; @@ -555,7 +540,7 @@ } break; case 'w': - if (strncmp(p,"idth",4) == 0 ) { /* Width reporting */ + if (strncmp(p,"idth",4) == 0 ) { /* Width reporting */ if (p[4] != '0') { option_flags |= REPORT_WIDTH; Message(PARSE_STDIN,"Width reporting on\n",p); @@ -590,9 +575,9 @@ } } if (dviname != NULL) { - if (dvi != NULL && dvi->filep != NULL) + if (dvi != NULL && dvi->filep != NULL) DVIClose(dvi); - dvi=DVIOpen(dviname,outname); + dvi=DVIOpen(dviname,outname); } if (dvi==NULL) { @@ -638,18 +623,15 @@ fprintf(stdout," --png Output PNG images (dvipng default)\n"); #endif fprintf(stdout," --strict When a warning occurs, exit\n"); -#ifdef HAVE_LIBT1 - fprintf(stdout," --t1lib* T1lib font rendering (default on)\n"); -#endif #ifdef HAVE_GDIMAGECREATETRUECOLOR fprintf(stdout," --truecolor* Truecolor output\n"); #endif - fprintf(stdout," -Q # Quality (T1lib and PK subsampling)\n"); + fprintf(stdout," -Q # Quality (PK subsampling)\n"); fprintf(stdout," --width* Output the image width on stdout\n"); #ifdef HAVE_GDIMAGEPNGEX fprintf(stdout," -z # PNG compression level\n"); #endif - + fprintf(stdout,"\n # = number f = file s = string * = suffix, '0' to turn off\n"); fprintf(stdout," c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)\n\n"); /*#ifdef HAVE_LIBKPATHSEA @@ -663,7 +645,7 @@ exit(EXIT_SUCCESS); } } - if ((option_flags & PARSE_STDIN) == 0 && (!ppused)) + if ((option_flags & PARSE_STDIN) == 0 && (!ppused)) ParsePages("-"); return((option_flags & PARSE_STDIN) != 0); } @@ -675,7 +657,7 @@ int strc=1; strv[0]=NULL; /* No program name */ - while (*string==' ' || *string=='\t' || *string=='\r' || *string=='\n') + while (*string==' ' || *string=='\t' || *string=='\r' || *string=='\n') string++; while (*string!='\0') { strv[strc++]=string; @@ -687,12 +669,12 @@ } else { /* String delimiter found , so search for next */ strv[strc-1]=++string; - while (*string!='\'' && *string!='\0') + while (*string!='\'' && *string!='\0') string++; } if (*string!='\0') *string++='\0'; - while (*string==' ' || *string=='\t' || *string=='\r' || *string=='\n') + while (*string==' ' || *string=='\t' || *string=='\r' || *string=='\n') string++; } if (strc>1) /* Nonempty */ @@ -704,7 +686,7 @@ uint32_t UNumRead(unsigned char* current, register int n) { uint32_t x = (unsigned char) *(current)++; /* number being constructed */ - while(--n) + while(--n) x = (x << 8) | *(current)++; return(x); } @@ -730,7 +712,7 @@ fprintf(stderr, "\n"); fprintf(stderr, "%s: Fatal error, ", programname); vfprintf(stderr, fmt, args); - + fprintf(stderr, "\n\n"); va_end(args); @@ -738,11 +720,7 @@ #ifdef HAVE_FT2 if (libfreetype) (void) FT_Done_FreeType(libfreetype); /* at this point, ignore error */ -#endif -#ifdef HAVE_LIBT1 - if (libt1) - (void) T1_CloseLib(); /* at this point, ignore error */ -#endif +#endif exit(EXIT_FATAL); } @@ -805,8 +783,7 @@ return(true); } # else /* HAVE_MMAP */ - fmmap->data = malloc(fmmap->size); - if (fmmap->data == NULL) { + if ((fmmap->data = malloc(fmmap->size+1)) == NULL) { Warning("cannot malloc space for <%s>",filename); close(fmmap->fd); return(true); @@ -821,7 +798,7 @@ close(fmmap->fd); # endif /* HAVE_MMAP */ #else /* WIN32 */ - fmmap->hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, 0, + fmmap->hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); if (fmmap->hFile == INVALID_HANDLE_VALUE) { Warning("cannot open file <%s>", filename); diff -Nru dvipng-1.14/mkinstalldirs dvipng-1.15/mkinstalldirs --- dvipng-1.14/mkinstalldirs 2003-10-19 20:33:26.000000000 +0000 +++ dvipng-1.15/mkinstalldirs 2015-03-02 19:33:56.000000000 +0000 @@ -4,7 +4,7 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.1 2003/10/19 20:33:26 jalar Exp $ +# $Id$ errstatus=0 dirmode="" diff -Nru dvipng-1.14/pk.c dvipng-1.15/pk.c --- dvipng-1.14/pk.c 2010-02-11 14:09:10.000000000 +0000 +++ dvipng-1.15/pk.c 2015-03-02 19:33:56.000000000 +0000 @@ -62,7 +62,7 @@ } else if (i <= (int)dyn_f) { return ((uint32_t)i); } else if (i < 14) { - return ((i-(uint32_t)dyn_f - 1) * 16 + (uint32_t)getnyb(pos) + return ((i-(uint32_t)dyn_f - 1) * 16 + (uint32_t)getnyb(pos) + dyn_f + 1); } else { if (i == 14) { @@ -83,7 +83,7 @@ switch (*pos++) { case 243: i = *pos++; - case 242: + case 242: i = 256 * i + *pos++; case 241: i = 256 * i + *pos++; @@ -92,9 +92,9 @@ DEBUG_PRINT(DEBUG_PK,("\n PK SPECIAL\t'%.*s' ",(int)i,pos)); pos += i; break; - case 244: + case 244: #ifdef DEBUG - { + { uint32_t c; c=UNumRead(pos,4); DEBUG_PRINT(DEBUG_PK,("\n PK SPECIAL\t%d",c)); @@ -102,14 +102,14 @@ #endif pos += 4; break; - case 245: + case 245: break; case 246: DEBUG_PRINT(DEBUG_PK,("\n PK\tNOP ")); break; case 247: case 248: case 249: case 250: case 251: case 252: case 253: case 254: - case 255: + case 255: Fatal("unexpected PK flagbyte %d", (int)*pos); } } @@ -152,7 +152,7 @@ ptr->tfmw = (dviunits) ((int64_t) ptr->tfmw * currentfont->s / 0x100000 ); DEBUG_PRINT(DEBUG_PK,(" (%d)",ptr->tfmw)); - + width = UNumRead(pos, n); height = UNumRead(pos+=n, n); DEBUG_PRINT(DEBUG_PK,(" %dx%d",width,height)); @@ -160,7 +160,7 @@ if (width > 0x7fff || height > 0x7fff) Fatal("character %d too large in file %s", c, currentfont->name); - /* + /* * Hotspot issues: Shrinking to the topleft corner rather than the hotspot will displace glyphs a fraction of a pixel. We deal with this in as follows: The glyph is shrunk to its hotspot by @@ -169,7 +169,7 @@ will then act as shrinking to the hotspot. This may enlarge the bitmap somewhat, of course. (Also remember that the below calculation of i/j_offset is in integer arithmetics.) - + There will still be a displacement from rounding the dvi position, but vertically it will be equal for all glyphs on a line, so we displace a whole line vertically by fractions of a @@ -189,7 +189,7 @@ ptr->yOffset = yoffset+j_offset; DEBUG_PRINT(DEBUG_PK,(" (%dx%d)",width,height)); - /* + /* Extra marginal so that we do not crop the image when shrinking. */ shrunk_width = (width + shrinkfactor - 1) / shrinkfactor; @@ -197,8 +197,9 @@ ptr->w = shrunk_width; ptr->h = shrunk_height; pos+=n; - buffer = calloc(shrunk_width*shrunk_height* - shrinkfactor*shrinkfactor,sizeof(char)); + if ((buffer = calloc(shrunk_width*shrunk_height* + shrinkfactor*shrinkfactor,sizeof(char)))==NULL) + Fatal("cannot allocate space for pk buffer"); DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); /* Raster char */ if (dyn_f == 14) { /* get raster by bits */ @@ -228,25 +229,25 @@ count = pk_packed_num(&pos); while (count > 0) { if (i+count < width) { - if (paint_switch) + if (paint_switch) for(k=0;ki_offset) - Fatal("wrong number of bits stored: char. %c, font %s", + Fatal("wrong number of bits stored: char. %c, font %s", (char)c, currentfont->name); if (j>height) Fatal("bad PK file %s, too many bits", currentfont->name); @@ -284,8 +285,8 @@ */ if ((ptr->data = calloc(shrunk_width*shrunk_height,sizeof(char))) == NULL) Fatal("unable to malloc image space for char %c", (char)c); - for (j = 0; j < (int) height; j++) { - for (i = 0; i < (int) width; i++) { + for (j = 0; j < (int) height; j++) { + for (i = 0; i < (int) width; i++) { /* if (((i % shrinkfactor) == 0) && ((j % shrinkfactor) == 0)) ptr->data[i/shrinkfactor+j/shrinkfactor*shrunk_width] = buffer[i+j*width]; @@ -293,15 +294,15 @@ ptr->data[i/shrinkfactor+j/shrinkfactor*shrunk_width] += buffer[i+j*width]; } - } - for (j = 0; j < shrunk_height; j++) { - for (i = 0; i < shrunk_width; i++) { + } + for (j = 0; j < shrunk_height; j++) { + for (i = 0; i < shrunk_width; i++) { ptr->data[i+j*shrunk_width] = ptr->data[i+j*shrunk_width] *255/shrinkfactor/shrinkfactor; DEBUG_PRINT(DEBUG_GLYPH,("%3u ",ptr->data[i+j*shrunk_width])); } DEBUG_PRINT(DEBUG_GLYPH,("|\n")); - } + } free(buffer); } @@ -317,11 +318,11 @@ if (MmapFile(tfontp->name,&(tfontp->fmmap))) Fatal("font file %s unusable", tfontp->name); position=(unsigned char*)tfontp->fmmap.data; - if (tfontp->fmmap.size < 2 || tfontp->fmmap.size < 3+*(position+2)+16) + if (tfontp->fmmap.size < 2 || tfontp->fmmap.size < 3+*(position+2)+16) Fatal("PK file %s ends prematurely",tfontp->name); - if (*position++ != PK_PRE) + if (*position++ != PK_PRE) Fatal("unknown font format in file %s",tfontp->name); - if (*position++ != PK_ID) + if (*position++ != PK_ID) Fatal( "wrong version %d of PK file %s (should be 89)", (int)*(position-1),tfontp->name); DEBUG_PRINT(DEBUG_PK,("\n PK_PRE:\t'%.*s'",(int)*position, position+1)); @@ -330,7 +331,7 @@ tfontp->designsize = UNumRead(position, 4); DEBUG_PRINT(DEBUG_PK,(" %d", tfontp->designsize)); tfontp->type = FONT_TYPE_PK; - + c = UNumRead(position+4, 4); DEBUG_PRINT(DEBUG_PK,(" %d", c)); CheckChecksum (tfontp->c, c, tfontp->name); @@ -348,7 +349,7 @@ DEBUG_PRINT(DEBUG_PK,("\n @%ld PK CHAR:\t%d", (long)position - (long)tfontp->fmmap.data, *position)); if ((tcharptr = malloc(sizeof(struct char_entry))) == NULL) - Fatal("cannot malloc space for char_entry"); + Fatal("cannot allocate space for char_entry"); tcharptr->flag_byte = *position; tcharptr->data = NULL; tcharptr->tfmw = 0; diff -Nru dvipng-1.14/README dvipng-1.15/README --- dvipng-1.14/README 2009-02-23 13:48:50.000000000 +0000 +++ dvipng-1.15/README 2015-03-02 19:33:55.000000000 +0000 @@ -4,25 +4,25 @@ This program makes PNG and/or GIF graphics from DVI files as obtained from TeX and its relatives. - If GIF support is enabled, GIF output is chosen by using the -`dvigif' binary or with the `--gif' option. + If GIF support is enabled, GIF output is chosen by using the 'dvigif' +binary or with the '--gif' option. It is intended to produce anti-aliased screen-resolution images as -fast as is possible. The target audience is people who need to generate -and regenerate many images again and again. The primary target is the +fast as is possible. The target audience is people who need to generate +and regenerate many images again and again. The primary target is the preview-latex (X)Emacs package, a package to preview formulas from -within (X)Emacs. Yes, you get to see your formulas in the (X)Emacs -buffer, see `http://www.gnu.org/software/auctex/preview-latex.html'. +within (X)Emacs. Yes, you get to see your formulas in the (X)Emacs +buffer, see . Another example is WeBWorK, an internet-based method for delivering -homework problems to students over the internet, giving students -instant feedback as to whether or not their answers are correct, see -`http://webwork.math.rochester.edu'. +homework problems to students over the internet, giving students instant +feedback as to whether or not their answers are correct, see +. A more recent addition to the dvipng-using applications out there is -MediaWiki, the software behind Wikipedia and many other wikis out -there. Dvipng is used to render mathematical formulae from version -1.8.0 of MediaWiki, see `http://www.mediawiki.org'. +MediaWiki, the software behind Wikipedia and many other wikis out there. +Dvipng is used to render mathematical formulae from version 1.8.0 of +MediaWiki, see . Other applications may also benefit, like web applications as latex2html and WYSIWYG editors like LyX. @@ -30,20 +30,20 @@ Benefits of dvipng ================== - The benefits of `dvipng'/`dvigif' include +The benefits of 'dvipng'/'dvigif' include - * Speed. It is a very fast bitmap-rendering code for DVI files, which - makes it suitable for generating large amounts of images + * Speed. It is a very fast bitmap-rendering code for DVI files, + which makes it suitable for generating large amounts of images on-the-fly, as needed in preview-latex, WeBWorK and others. * It does not read the postamble, so it can be started before TeX - finishes. There is a `--follow' switch that makes dvipng wait at + finishes. There is a '--follow' switch that makes dvipng wait at end-of-file for further output, unless it finds the POST marker that indicates the end of the DVI. - * Interactive query of options. dvipng can read options interactively - through stdin, and all options are usable. It is even possible to - change the input file through this interface. + * Interactive query of options. dvipng can read options + interactively through stdin, and all options are usable. It is + even possible to change the input file through this interface. * Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts (i.e., as used in CJK-LaTeX), color specials, and inclusion of @@ -51,11 +51,10 @@ * and more... - Installation ============ -Read `INSTALL', included in the distribution. +Read 'INSTALL', included in the distribution. Usage ===== @@ -64,9 +63,9 @@ dvipng foo -where `foo.dvi' is the output of TeX that you want to convert to PNG -format. If there are four pages in `foo.dvi', those pages will be -output as `foo1.png', `foo2.png', `foo3.png', and `foo4.png', +where 'foo.dvi' is the output of TeX that you want to convert to PNG +format. If there are four pages in 'foo.dvi', those pages will be +output as 'foo1.png', 'foo2.png', 'foo3.png', and 'foo4.png', respectively. Many options are available (see the info manual). For a brief @@ -77,11 +76,12 @@ Availability ============ -The dvipng package is available at Savannah, the GNU project site. Since -dvipng is not part of the GNU project, although released under the GNU -GPL, the web address is `http://savannah.nongnu.org/projects/dvipng'. -Instructions for anonymous CVS access can be found at -`http://savannah.nongnu.org/cvs/?group=dvipng'. +The dvipng package is available at Savannah, the GNU project site. +Since dvipng is not part of the GNU project, although released under the +GNU GPL, the web address is +. Instructions for +anonymous CVS access can be found at +. Contacts ======== @@ -89,12 +89,12 @@ Bug reports should be sent to . Questions, suggestions for new features, pleas for help, and/or -praise should go to . For more information on this -mailing list, send a message with just the word `help' as subject or +praise should go to . For more information on this +mailing list, send a message with just the word 'help' as subject or body to or look at -`http://lists.nongnu.org/mailman/listinfo/dvipng'. +. - Offers to support further development will be appreciated. For + Offers to support further development will be appreciated. For developer access, ask on . Copying @@ -102,9 +102,9 @@ This program is released under the GNU Lesser General Public License version 3, see the COPYING file in the dvipng distribution or -`http://www.gnu.org/licenses/'. +. - Copyright (C) 2002-2009 Jan-AAke Larsson + Copyright (C) 2002-2014 Jan-AAke Larsson Todo ==== @@ -114,15 +114,13 @@ * Add more color models for xcolor compatibility - * Fix T1lib and PK rendering so it is on par with Freetype. - * Enable a named pipe as DVI * Further speed improvements. * Other output specials and source specials. - * Clean internal structures. Overhaul file handling. + * Clean internal structures. Overhaul file handling. * Fix the SELFAUTO stuff at runtime rather than at build time diff -Nru dvipng-1.14/readme.texi dvipng-1.15/readme.texi --- dvipng-1.14/readme.texi 2009-02-23 13:48:50.000000000 +0000 +++ dvipng-1.15/readme.texi 2015-03-02 19:33:56.000000000 +0000 @@ -12,7 +12,7 @@ @c ----------------------- This program makes PNG and/or GIF graphics from DVI files as obtained -from @TeX{} and its relatives. +from @TeX{} and its relatives. If GIF support is enabled, GIF output is chosen by using the @samp{dvigif} binary or with the @samp{--gif} option. @@ -24,7 +24,7 @@ regenerate many images again and again. The primary target is the @previewlatex{} (X)Emacs package, a package to preview formulas from within (X)Emacs. Yes, you get to see your formulas in the (X)Emacs -buffer, see @url{http://www.gnu.org/software/auctex/preview-latex.html}. +buffer, see @url{http://www.gnu.org/software/auctex/preview-latex.html}. Another example is WeBWorK, an internet-based method for delivering homework problems to students over the internet, giving students @@ -47,28 +47,28 @@ The benefits of @samp{dvipng}/@samp{dvigif} include @itemize @bullet -@item +@item Speed. It is a very fast bitmap-rendering code for DVI files, which makes it suitable for generating large amounts of images on-the-fly, as needed in @previewlatex{}, WeBWorK and others. -@item +@item It does not read the postamble, so it can be started before @TeX{} finishes. There is a @samp{--follow} switch that makes dvipng wait at end-of-file for further output, unless it finds the POST marker that indicates the end of the DVI. -@item +@item Interactive query of options. dvipng can read options interactively through stdin, and all options are usable. It is even possible to change the input file through this interface. -@item +@item Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts (i.e., as used in CJK-@LaTeX{}), color specials, and inclusion of PostScript, PNG, JPEG or GIF images. -@item +@item and more... @end itemize @@ -105,7 +105,7 @@ dvipng is not part of the GNU project, although released under the GNU GPL, the web address is @url{http://savannah.nongnu.org/projects/dvipng}. Instructions for -anonymous CVS access can be found at +anonymous CVS access can be found at @url{http://savannah.nongnu.org/cvs/?group=dvipng}. @section Contacts @@ -127,7 +127,7 @@ version 3, see the COPYING file in the dvipng distribution or @url{http://www.gnu.org/licenses/}. -Copyright @copyright{} 2002-2009 Jan-@AA{}ke Larsson +Copyright @copyright{} 2002-2014 Jan-@AA{}ke Larsson @section Todo @@ -139,18 +139,15 @@ Add more color models for xcolor compatibility @item -Fix T1lib and PK rendering so it is on par with Freetype. - -@item Enable a named pipe as DVI -@item +@item Further speed improvements. -@item +@item Other output specials and source specials. -@item +@item Clean internal structures. Overhaul file handling. @item diff -Nru dvipng-1.14/RELEASE dvipng-1.15/RELEASE --- dvipng-1.14/RELEASE 2010-12-14 21:33:28.000000000 +0000 +++ dvipng-1.15/RELEASE 2015-03-02 19:33:56.000000000 +0000 @@ -1,15 +1,14 @@ -Release notes for version 1.14 of the dvipng package: +Release notes for version 1.15 of the dvipng package: This program makes PNG graphics from DVI files as obtained from TeX and its relatives. -This release changes raw PostScript processing to avoid the -non-rendering PostScript specials created by hyperref. A command-line -switch to turn off raw PostScript rendering has been added. Finally, a -few bugs has been fixed, such as correct decoding of the -T switch, a -CRLF bug when reading configuration files in Windows, and a few bugs -associated to subprocesses. +This is a bugfix release that removes the unnecessarily long delay in --follow +mode and a few segfaults on out-of-memory or missing standard-latex files, and +adds some documentation improvements. It also removes support for libt1, which +is reportedly not developed anymore, and not needed since Freetype does a much +better job. Report any bugs you find, see README for instructions. diff -Nru dvipng-1.14/set.c dvipng-1.15/set.c --- dvipng-1.14/set.c 2010-03-17 13:02:35.000000000 +0000 +++ dvipng-1.15/set.c 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -26,8 +26,8 @@ #include #ifndef HAVE_GDIMAGECREATETRUECOLOR -#define gdImageColorAllocateAlpha(i,r,g,b,a) gdImageColorAllocate(i,r,g,b) -#define gdImageColorResolveAlpha(i,r,g,b,a) gdImageColorResolve(i,r,g,b) +#define gdImageColorAllocateAlpha(i,r,g,b,a) gdImageColorAllocate(i,r,g,b) +#define gdImageColorResolveAlpha(i,r,g,b,a) gdImageColorResolve(i,r,g,b) #define gdImageAlpha(i,c) 0 #define gdAlphaMax 127 #endif @@ -35,36 +35,38 @@ #define gdImagePngEx(i,f,z) gdImagePng(i,f) #endif -/* Persistent color cache. Index is ink thickness, +/* Persistent color cache. Index is ink thickness, 0=no ink, 127=total coverage */ static int ColorCache[gdAlphaMax+1]; void CreateImage(pixels x_width,pixels y_width) { - if (page_imagep) + if (page_imagep) gdImageDestroy(page_imagep); if (x_width <= 0) x_width=1; if (y_width <= 0) y_width=1; #ifdef HAVE_GDIMAGECREATETRUECOLOR /* GIFs are 256-color */ if ((option_flags & FORCE_TRUECOLOR - || page_flags & PAGE_TRUECOLOR) + || page_flags & PAGE_TRUECOLOR) && ~option_flags & GIF_OUTPUT - && ~option_flags & FORCE_PALETTE) + && ~option_flags & FORCE_PALETTE) page_imagep=gdImageCreateTrueColor(x_width,y_width); else #endif page_imagep=gdImageCreate(x_width,y_width); /* Set bg color. GIFs cannot handle an alpha channel, resort to transparent color index, set in WriteImage */ - ColorCache[0] + if (!page_imagep) + Fatal("cannot allocate GD image for DVI"); + ColorCache[0] = gdImageColorAllocateAlpha(page_imagep, cstack[0].red, cstack[0].green, cstack[0].blue, - (option_flags & BG_TRANSPARENT_ALPHA + (option_flags & BG_TRANSPARENT_ALPHA && ~option_flags & GIF_OUTPUT) ? 127 : 0); - ColorCache[gdAlphaMax]=-1; + ColorCache[gdAlphaMax]=-1; #ifdef HAVE_GDIMAGECREATETRUECOLOR /* Alpha blending in libgd is only performed for truecolor images. We need it for palette images also. Turn libgd alpha blending off @@ -73,9 +75,9 @@ gdImageAlphaBlending(page_imagep, 0); if (option_flags & BG_TRANSPARENT_ALPHA) gdImageSaveAlpha(page_imagep, 1); - if (page_imagep->trueColor) + if (page_imagep->trueColor) /* Truecolor: there is no background color index, fill image instead. */ - gdImageFilledRectangle(page_imagep, 0, 0, + gdImageFilledRectangle(page_imagep, 0, 0, x_width-1, y_width-1, ColorCache[0]); #endif } @@ -88,7 +90,7 @@ int x,y; for( y=y1; y<=y2; y++) { for( x=x1; x<=x2; x++) { - if (gdImageGetPixel(imagep, x, y)==color1) + if (gdImageGetPixel(imagep, x, y)==color1) gdImageSetPixel(imagep, x, y, color2); } } @@ -111,7 +113,7 @@ x_width=gdImageSX(page_imagep); y_width=gdImageSY(page_imagep); - + /* Set ANOTHER bg color, transparent this time */ /* No semi-transparency here, given the motivation for this code * (box cursor visibility in Emacs) */ @@ -119,13 +121,13 @@ Transparent = gdImageColorAllocate(page_imagep, bordercolor.red, bordercolor.green, - bordercolor.blue); + bordercolor.blue); else Transparent = gdImageColorAllocate(page_imagep, gdImageRed(page_imagep,ColorCache[0]), gdImageGreen(page_imagep,ColorCache[0]), - gdImageBlue(page_imagep,ColorCache[0])); - gdImageColorTransparent(page_imagep,Transparent); + gdImageBlue(page_imagep,ColorCache[0])); + gdImageColorTransparent(page_imagep,Transparent); ChangeColor(page_imagep,0,0,x_width-1,borderwidth-1, ColorCache[0],Transparent); ChangeColor(page_imagep,0,0,borderwidth-1,y_width-1, @@ -139,11 +141,12 @@ if ((pos=strchr(pngname,'%')) != NULL) { if (strchr(++pos,'%')) Fatal("too many %%s in output file name"); - if (*pos == 'd' + if (*pos == 'd' || (*pos=='0' && pos[1]>='1' && pos[1]<='9' && pos[2]=='d')) { - /* %d -> pagenumber, so add 9 string positions + /* %d -> pagenumber, so add 9 string positions since pagenumber max +-2^31 or +-2*10^9 */ - freeme = malloc(strlen(pngname)+9); + if ((freeme = malloc(strlen(pngname)+9))==NULL) + Fatal("cannot allocate memory for output file name"); sprintf(freeme,pngname,pagenum); pngname = freeme; } else { @@ -151,7 +154,7 @@ } } #ifdef HAVE_GDIMAGEGIF - if (option_flags & GIF_OUTPUT && (pos=strrchr(pngname,'.')) != NULL + if (option_flags & GIF_OUTPUT && (pos=strrchr(pngname,'.')) != NULL && strcmp(pos,".png")==0) { *(pos+1)='g'; *(pos+2)='i'; @@ -161,7 +164,7 @@ if ((outfp = fopen(pngname,"wb")) == NULL) Fatal("cannot open output file %s",pngname); #ifdef HAVE_GDIMAGEGIF - if (option_flags & GIF_OUTPUT) + if (option_flags & GIF_OUTPUT) gdImageGif(page_imagep,outfp); else #endif @@ -192,7 +195,7 @@ void Gamma(double gamma) { int i=0; - + while (i<=gdAlphaMax) { gammatable[i]=gdAlphaMax- (int)(pow((gdAlphaMax-i)/((double)gdAlphaMax),gamma)*gdAlphaMax); @@ -214,7 +217,7 @@ /* Initialize persistent color cache. Perhaps this should be in color.c? */ pixelcolor=gdImageColorResolve(page_imagep, - cstack[csp].red, + cstack[csp].red, cstack[csp].green, cstack[csp].blue); if (ColorCache[gdAlphaMax]!=pixelcolor) { @@ -269,7 +272,7 @@ if ((height>0) && (width>0)) { /* This code produces too dark rules. But what the hell. Grey * rules look fuzzy. */ - Color = gdImageColorResolve(page_imagep, + Color = gdImageColorResolve(page_imagep, cstack[csp].red, cstack[csp].green, cstack[csp].blue); diff -Nru dvipng-1.14/sfd.c dvipng-1.15/sfd.c --- dvipng-1.14/sfd.c 2010-09-22 13:13:33.000000000 +0000 +++ dvipng-1.15/sfd.c 2015-03-02 19:33:56.000000000 +0000 @@ -25,13 +25,13 @@ #include "dvipng.h" struct subfont* subfontp=NULL; -static struct subfont* ReadSubfont(char* sfdname, char *infix) +static struct subfont* ReadSubfont(char* sfdname, char *infix) { char *pos,*max,*sfdfile=NULL; struct subfont* sfdp=NULL; struct filemmap fmmap; boolean mmapfailed; - + /* OK, find subfont and look for correct infix */ #ifdef HAVE_KPSE_ENC_FORMATS sfdfile=kpse_find_file(sfdname,kpse_sfd_format,false); @@ -52,7 +52,7 @@ while(poscharindex[codepoint]=number; - DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); + DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); number++; codepoint++; } default: if (codepoint<256) sfdp->charindex[codepoint]=number; - DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); + DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); } while(postfmname,*sfdwant=fontname, @@ -124,7 +124,7 @@ sfdwant++; } /* Find delimiter */ - if (*sfdspec!='@') + if (*sfdspec!='@') return(NULL); sfdspec++; postfix=sfdspec; @@ -133,7 +133,8 @@ if (*postfix!='@') return(NULL); /* Extract subfont name */ - sfdname=malloc(postfix-sfdspec+1); + if ((sfdname=malloc(postfix-sfdspec+1))==NULL) + Fatal("cannot allocate memory for subfont name"); strncpy(sfdname,sfdspec,postfix-sfdspec); sfdname[postfix-sfdspec]='\0'; /* Check postfix */ @@ -141,12 +142,13 @@ if (strcmp(sfdwant+strlen(sfdwant)-strlen(postfix),postfix)!=0) return(NULL); /* Extract infix */ - infix=malloc(strlen(sfdwant)-strlen(postfix)+1); + if ((infix=malloc(strlen(sfdwant)-strlen(postfix)+1))==NULL) + Fatal("cannot allocate memory for subfont infix"); strncpy(infix,sfdwant,strlen(sfdwant)-strlen(postfix)); infix[strlen(sfdwant)-strlen(postfix)]='\0'; - DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT %s %s %s",fontname,sfdname,infix)); + DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT %s %s %s",fontname,sfdname,infix)); /* Find subfont */ - while(temp!=NULL + while(temp!=NULL && (strcmp(sfdname,temp->name)!=0 || strcmp(infix,temp->infix)!=0)) temp=temp->next; if (temp==NULL) { @@ -176,4 +178,3 @@ temp=subfontp; } } - diff -Nru dvipng-1.14/special.c dvipng-1.15/special.c --- dvipng-1.14/special.c 2010-12-06 10:14:22.000000000 +0000 +++ dvipng-1.15/special.c 2015-03-02 19:33:55.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -26,7 +26,7 @@ #ifndef MIKTEX #ifndef WIN32 -#include +#include #else /* WIN32 */ #include #include @@ -38,7 +38,7 @@ #define SKIPSPACES(s) while(s && *s==' ' && *s!='\0') s++ -/* PostScript can come as a string (headers and raw specials) or +/* PostScript can come as a string (headers and raw specials) or a memory-mapped file (headers and included EPS figures). */ struct pscode { @@ -127,7 +127,7 @@ DEBUG_PRINT(DEBUG_GS,("\n PS FILE:\t%s",pscodep->filename)); position=(unsigned char*)pscodep->fmmap.data; - while(position + while(position < (unsigned char*)pscodep->fmmap.data + pscodep->fmmap.size) { putc(*position,psstream); position++; @@ -151,7 +151,7 @@ #define READ_END 0 #define WRITE_END 1 FILE *psstream=NULL, *pngstream=NULL; - char resolution[STRSIZE]; + char resolution[STRSIZE]; /* char devicesize[STRSIZE]; */ gdImagePtr psimage=NULL; #ifndef MIKTEX @@ -178,23 +178,23 @@ /* Future extension for \rotatebox status=sprintf(devicesize, "-g%dx%d", //(int)((sin(atan(1.0))+1)* - (urx - llx)*hresolution/72,//), + (urx - llx)*hresolution/72,//), //(int)((sin(atan(1.0))+1)* (ury - lly)*vresolution/72);//); */ DEBUG_PRINT(DEBUG_GS, ("\n GS CALL:\t%s %s %s %s %s %s %s %s %s %s %s",/* %s", */ GS_PATH, device, resolution, /*devicesize,*/ - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", (option_flags & NO_GSSAFER) ? "": "- ")); #ifndef MIKTEX if (pipe(pspipe) || pipe(pngpipe)) return(NULL); #ifndef WIN32 /* We have fork: execute gs in child */ pid = fork(); - if (pid == 0) { /* Child, execute gs. */ + if (pid == 0) { /* Child, execute gs. */ close(pspipe[WRITE_END]); dup2(pspipe[READ_END], STDIN_FILENO); close(pspipe[READ_END]); @@ -202,25 +202,25 @@ dup2(pngpipe[WRITE_END], STDOUT_FILENO); close(pngpipe[WRITE_END]); execlp(GS_PATH, GS_PATH, device, resolution, /*devicesize,*/ - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", (option_flags & NO_GSSAFER) ? NULL: "-", NULL); _exit (EXIT_FAILURE); } #else /* WIN32 */ /* No fork but spawn: execute gs in present process environment. - Save fileno's, attach pipes to this process' stdin and stdout. */ + Save fileno's, attach pipes to this process' stdin and stdout. */ savestdin = _dup(fileno(stdin)); _dup2(pspipe[READ_END], fileno(stdin)); savestdout = _dup(fileno(stdout)); _dup2(pngpipe[WRITE_END], fileno(stdout)); if ((hchild= (HANDLE)spawnlp(_P_NOWAIT, GS_PATH, GS_PATH, device, resolution, - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", (option_flags & NO_GSSAFER) ? NULL : "-", NULL))==0) return NULL; #endif /* WIN32 */ @@ -228,16 +228,16 @@ close(pngpipe[WRITE_END]); #else /* MIKTEX */ /* No fork but miktex_start_process3: execute gs using that. - Attach file descriptors to that process' stdin and stdout. */ + Attach file descriptors to that process' stdin and stdout. */ if (! miktex_find_miktex_executable("mgs.exe", szGsPath)) { Warning("Ghostscript could not be found"); return(NULL); } snprintf(szCommandLine,2048,"\"%s\" %s %s %s %s %s %s %s %s %s %s",/* %s",*/ szGsPath, device, resolution, /*devicesize,*/ - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", (option_flags & NO_GSSAFER) ? "": "-"); if (! miktex_start_process_3(szCommandLine, &pi, INVALID_HANDLE_VALUE, &hPsStream, &hPngStream, &hStdErr, 0)) { @@ -249,7 +249,7 @@ pngpipe[READ_END] = _open_osfhandle((intptr_t)hPngStream, _O_RDONLY); #endif /* MIKTEX */ if (pspipe[WRITE_END] >= 0) { - if ((psstream=fdopen(pspipe[WRITE_END],"wb")) == NULL) + if ((psstream=fdopen(pspipe[WRITE_END],"wb")) == NULL) close(pspipe[WRITE_END]); else { writepscode(psstream,psheaderp); @@ -270,7 +270,7 @@ } } if (pngpipe[READ_END] >= 0) { - if((pngstream=fdopen(pngpipe[READ_END],"rb")) == NULL) + if((pngstream=fdopen(pngpipe[READ_END],"rb")) == NULL) close(pngpipe[READ_END]); else { psimage = gdImageCreateFromPng(pngstream); @@ -312,7 +312,7 @@ gdImagePtr scaledimage=psimage; /* Rescale unless correct size */ if (psimage!=NULL - && gdImageSX(psimage)!=pngwidth + && gdImageSX(psimage)!=pngwidth && gdImageSY(psimage)!=pngheight) { DEBUG_PRINT(DEBUG_DVI, ("\n RESCALE INCLUDED BITMAP \t(%d,%d) -> (%d,%d)", @@ -347,7 +347,7 @@ newpsheader("header=special.pro"); } if (strcmp(special+strlen(special)-4,".xcp")==0 - && strncmp(special,"header=",7)==0) + && strncmp(special,"header=",7)==0) InitXColorPrologue(special+7); if (strncmp(special,"! /pgfH",7)==0) newpsheader("! TeXDict begin"); @@ -380,16 +380,23 @@ /**************************** SetSpecial ***************************/ /*********************************************************************/ -void SetSpecial(char * special, int32_t hh, int32_t vv) +void SetSpecial(char *start, char *end, int32_t hh, int32_t vv) /* interpret a \special command, made up of keyword=value pairs, * or !header or ps:raw_PostScript */ { + char *buffer,*special; + + if ((buffer=malloc(end-start+1))==NULL) + Fatal("Cannot allocate space for special"); + special=memcpy(buffer,start,end-start); + special[end-start]='\0'; DEBUG_PRINT(DEBUG_DVI,(" '%s'",special)); SKIPSPACES(special); /********************** Color specials ***********************/ if (strncmp(special,"background ",11)==0) { background(special+11); + free(buffer); return; } if (strncmp(special,"color ",6)==0) { @@ -400,9 +407,10 @@ } else { if (strcmp(special,"pop")==0) popcolor(); - else + else resetcolorstack(special); } + free(buffer); return; } @@ -430,7 +438,7 @@ *special='\0'; special++; } - + /* Retrieve parameters */ SKIPSPACES(special); while(special && *special) { @@ -451,7 +459,7 @@ while (*special && *special!=' ') special++; SKIPSPACES(special); } - + /* Calculate resolution, and use our base resolution as a fallback. */ /* The factor 10 is magic, the dvips graphicx driver needs this. */ hresolution = ((dpi*rwi+urx-llx-1)/(urx - llx)+9)/10; @@ -459,18 +467,18 @@ if (vresolution==0) vresolution = hresolution; if (hresolution==0) hresolution = vresolution; if (hresolution==0) hresolution = vresolution = dpi; - + /* Convert from postscript 72 dpi resolution to our given resolution */ pngwidth = (dpi*rwi+719)/720; /* +719: round up */ pngheight = (dpi*rhi+719)/720; - if (pngwidth==0) + if (pngwidth==0) pngwidth = ((dpi*rhi*(urx-llx)+ury-lly-1)/(ury-lly)+719)/720; - if (pngheight==0) + if (pngheight==0) pngheight = ((dpi*rwi*(ury-lly)+urx-llx-1)/(urx-llx)+719)/720; if (pngheight==0) { pngwidth = (dpi*(urx-llx)+71)/72; pngheight = (dpi*(ury-lly)+71)/72; - } + } if (page_imagep != NULL) { /* Draw into image */ struct pscode image; gdImagePtr psimage=NULL; @@ -484,8 +492,9 @@ Warning("Image file %s unusable, image will be left blank", image.filename); page_flags |= PAGE_GAVE_WARN; + free(buffer); return; - } + } Message(BE_NONQUIET," <%s",psname); switch ((unsigned char)*image.fmmap.data) { case 0x89: /* PNG magic: "\211PNG\r\n\032\n" */ @@ -542,7 +551,7 @@ DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), ("\n GS RENDER \t%s -> pngalpha ",image.filename)); if (!clip) { - /* Render across the whole image */ + /* Render across the whole image */ tllx=llx-(hh+1)*72/hresolution; tlly=lly-(gdImageSY(page_imagep)-vv-1)*72/vresolution; turx=llx+(gdImageSX(page_imagep)-hh)*72/hresolution; @@ -555,8 +564,8 @@ DEBUG_PRINT((DEBUG_DVI | DEBUG_GS),(", CLIPPED TO BBOX")); #endif } - psimage = ps2png(&image, "-sDEVICE=pngalpha", - hresolution, vresolution, + psimage = ps2png(&image, "-sDEVICE=pngalpha", + hresolution, vresolution, tllx, tlly, turx, tury, 255,255,255); if (psimage==NULL) @@ -569,7 +578,7 @@ DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), ("\n GS RENDER \t%s -> png16m", image.filename)); psimage = ps2png(&image, "-sDEVICE=png16m", - hresolution, vresolution, + hresolution, vresolution, llx, lly, urx, ury, cstack[0].red,cstack[0].green,cstack[0].blue); clip=true; @@ -598,7 +607,7 @@ Warning("Using libgd < 2.0.12, opaque image inclusion"); page_flags |= PAGE_GAVE_WARN; #endif - gdImageCopy(page_imagep, psimage, + gdImageCopy(page_imagep, psimage, hh, vv-gdImageSY(psimage)+1, 0,0, gdImageSX(psimage),gdImageSY(psimage)); @@ -609,7 +618,7 @@ } else { Warning("Unable to load %s, image will be left blank",image.filename); page_flags |= PAGE_GAVE_WARN; - } + } free(image.filename); Message(BE_NONQUIET,">"); } else { /* Don't draw */ @@ -623,50 +632,55 @@ max(x_max,hh+pngwidth); max(y_max,vv+1); } + free(buffer); return; } /******************* Raw PostScript ********************/ - if (strncmp(special,"!/preview@version(",18)==0) { + if (strncmp(special,"!/preview@version(",18)==0) { int length=0; special+=18; - while (special[length]!='\0' && special[length]!=')') + while (special[length]!='\0' && special[length]!=')') length++; - if (page_imagep==NULL) + if (page_imagep==NULL) Message(BE_NONQUIET," (preview-latex version %.*s)",length,special); + free(buffer); return; } /* preview-latex' tightpage option */ - if (strncmp(special,"!/preview@tightpage",19)==0) { + if (strncmp(special,"!/preview@tightpage",19)==0) { special+=19; SKIPSPACES(special); if (strncmp(special,"true",4)==0) { - if (page_imagep==NULL) + if (page_imagep==NULL) Message(BE_NONQUIET," (preview-latex tightpage option detected, will use its bounding box)"); dvi->flags |= DVI_PREVIEW_LATEX_TIGHTPAGE; } + free(buffer); return; } - if (strncmp(special,"!userdict",9)==0 + if (strncmp(special,"!userdict",9)==0 && strstr(special+10,"7{currentfile token not{stop}if 65781.76 div")!=NULL) { - if (page_imagep==NULL && ~dvi->flags & DVI_PREVIEW_LATEX_TIGHTPAGE) + if (page_imagep==NULL && ~dvi->flags & DVI_PREVIEW_LATEX_TIGHTPAGE) Message(BE_NONQUIET," (preview-latex <= 0.9.1 tightpage option detected, will use its bounding box)"); dvi->flags |= DVI_PREVIEW_LATEX_TIGHTPAGE; + free(buffer); return; } /* preview-latex' dvips bop-hook redefinition */ - if (strncmp(special,"!userdict",9)==0 + if (strncmp(special,"!userdict",9)==0 && strstr(special+10,"preview-bop-")!=NULL) { dvi->flags |= DVI_PREVIEW_BOP_HOOK; - if (page_imagep==NULL) + if (page_imagep==NULL) Message(BE_VERBOSE," (preview-latex beginning-of-page-hook detected)"); + free(buffer); return; } - if (dvi->flags & DVI_PREVIEW_BOP_HOOK && ~page_flags & PAGE_PREVIEW_BOP + if (dvi->flags & DVI_PREVIEW_BOP_HOOK && ~page_flags & PAGE_PREVIEW_BOP && strncmp(special,"ps::",4)==0) { /* Hokay, decode bounding box */ dviunits adj_llx,adj_lly,adj_urx,adj_ury,ht,dp,wd; @@ -679,21 +693,22 @@ wd = strtol(special,&special,10); page_flags |= PAGE_PREVIEW_BOP; if (wd>0) { - x_offset_tightpage = + x_offset_tightpage = (-adj_llx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; x_width_tightpage = x_offset_tightpage +(wd+adj_urx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; } else { - x_offset_tightpage = + x_offset_tightpage = (-wd+adj_urx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; x_width_tightpage = x_offset_tightpage +(-adj_llx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; } /* y-offset = height - 1 */ - y_offset_tightpage = + y_offset_tightpage = (((ht>0)?ht:0)+adj_ury+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor-1; y_width_tightpage = y_offset_tightpage+1 +(((dp>0)?dp:0)-adj_lly+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + free(buffer); return; } @@ -701,7 +716,8 @@ if (option_flags & NO_RAW_PS) { Warning("Raw PostScript rendering disallowed by --norawps" ); page_flags |= PAGE_GAVE_WARN; - return; + free(buffer); + return; } if (page_imagep != NULL) { /* Draw into image */ static struct pscode *pscodep=NULL; @@ -711,8 +727,8 @@ gdImagePtr psimage=NULL; char *txt; const char *specialend=special+strlen(special); - const char *newspecial=NULL; - + const char *newspecial=NULL; + /* hyperref non-rendering PostScript specials. */ if (strcmp(specialend-11,"pdfmark end")==0 || strcmp(specialend-7,"H.A end")==0 @@ -722,9 +738,10 @@ || strcmp(specialend-7,"H.S end")==0 || strcmp(specialend-7,"H.V end")==0 || strncmp(special,"ps:SDict begin /product",23)==0) - if (pscodep==NULL) + if (pscodep==NULL) { + free(buffer); return; - else + } else newspecial=""; /* pgf PostScript specials. */ else if (strcmp(special,"ps:: pgfo")==0) @@ -766,6 +783,7 @@ Fatal("cannot allocate space for raw PostScript special"); strcpy(txt,newspecial); PSCodeInit(tmp,txt); + free(buffer); return; } DEBUG_PRINT(DEBUG_DVI,("\n LAST PS SPECIAL ")); @@ -784,9 +802,9 @@ libgd 2.0.12 upwards */ #ifdef HAVE_GDIMAGEPNGEX if (page_imagep->trueColor) { - /* Render across the whole image */ - psimage = ps2png(pscodep, "-sDEVICE=pngalpha", - dpi,dpi, + /* Render across the whole image */ + psimage = ps2png(pscodep, "-sDEVICE=pngalpha", + dpi,dpi, -(hh+1)*72/dpi, -(gdImageSY(page_imagep)-vv-1)*72/dpi, (gdImageSX(page_imagep)-hh)*72/dpi, @@ -794,7 +812,7 @@ 255,255,255); if (psimage!=NULL) { gdImageAlphaBlending(page_imagep,1); - gdImageCopy(page_imagep, psimage, + gdImageCopy(page_imagep, psimage, 0,0,0,0, gdImageSX(psimage),gdImageSY(psimage)); gdImageAlphaBlending(page_imagep,0); @@ -817,21 +835,24 @@ pscodep=NULL; if (newspecial != NULL) free(special); - if (psimage==NULL) + if (psimage==NULL) page_flags |= PAGE_GAVE_WARN; Message(BE_NONQUIET,">"); } else { /* Don't draw */ page_flags |= PAGE_TRUECOLOR; } + free(buffer); return; } if (strncmp(special,"papersize=",10)==0) { /* papersize spec, ignored */ + free(buffer); return; } if (special[0]=='!' || strncmp(special,"header=",7)==0) { /* PS header */ newpsheader(special); + free(buffer); return; } @@ -839,6 +860,7 @@ if ( page_imagep != NULL ) Message(BE_NONQUIET," at (%ld,%ld) source \\special{%s}", hh, vv, special); + free(buffer); return; } if ( page_imagep != NULL ) { @@ -846,5 +868,5 @@ hh, vv, special); page_flags |= PAGE_GAVE_WARN; } + free(buffer); } - diff -Nru dvipng-1.14/t1.c dvipng-1.15/t1.c --- dvipng-1.14/t1.c 2010-02-11 14:09:10.000000000 +0000 +++ dvipng-1.15/t1.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,192 +0,0 @@ -/* t1.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2009 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -void LoadT1(int32_t c, struct char_entry * ptr) -{ - GLYPH *glyph; - int original_width,original_height; - int i,j,k,width,height; - unsigned short shrunk_width,shrunk_height; - short xoffset,yoffset; - unsigned short i_offset,j_offset; - - DEBUG_PRINT(DEBUG_T1,("\n LOAD T1 CHAR\t%d",c)); - if ((glyph= - T1_SetChar(currentfont->T1id, c, - (float)currentfont->dpi*currentfont->d/65536/72.27, - currentfont->psfontmap==NULL ? NULL : currentfont->psfontmap->t1_transformp)) - ==NULL) - Fatal("cannot load T1 char %d",c); - - DEBUG_PRINT(DEBUG_T1,(" (%d)",ptr->tfmw)); - - original_width = glyph->metrics.rightSideBearing - - glyph->metrics.leftSideBearing; - original_height = glyph->metrics.ascent - glyph->metrics.descent; - DEBUG_PRINT(DEBUG_T1,(" %dx%d",original_width,original_height)); - - if (original_width > 0x7fff || original_height > 0x7fff) - Fatal("character %d too large in file %s", c, currentfont->name); - - /* - * Hotspot issues: Shrinking to the topleft corner rather than the - hotspot will displace glyphs a fraction of a pixel. We deal with - this in as follows: The glyph is shrunk to its hotspot by - offsetting the bitmap somewhat to put the hotspot in the lower - left corner of a "shrink square". Shrinking to the topleft corner - will then act as shrinking to the hotspot. This may enlarge the - bitmap somewhat, of course. (Also remember that the below - calculation of i/j_offset is in integer arithmetics.) - - There will still be a displacement from rounding the dvi - position, but vertically it will be equal for all glyphs on a - line, so we displace a whole line vertically by fractions of a - pixel. This is acceptible, IMHO. Sometime there will be support - for subpixel positioning, horizontally. Will do for now, I - suppose. - */ - xoffset = -glyph->metrics.leftSideBearing; - /* printf("xoffset: %d\n",xoffset); */ - i_offset = ( shrinkfactor - xoffset % shrinkfactor ) % shrinkfactor; - width = original_width+i_offset; - ptr->xOffset = xoffset+i_offset; - - yoffset = glyph->metrics.ascent-1; - /* printf("yoffset: %d\n",yoffset); */ - j_offset = ( shrinkfactor - (yoffset-(shrinkfactor-1)) % shrinkfactor ) - % shrinkfactor; - height = original_height+j_offset; - ptr->yOffset = yoffset+j_offset; - - DEBUG_PRINT(DEBUG_T1,(" (%dx%d)",width,height)); - /* - Extra marginal so that we do not crop the image when shrinking. - */ - shrunk_width = (width + shrinkfactor - 1) / shrinkfactor; - shrunk_height = (height + shrinkfactor - 1) / shrinkfactor; - ptr->w = shrunk_width; - ptr->h = shrunk_height; - - /* printf("(%d,%d) ",ptr->w,ptr->h); */ - DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); - - /* - Shrink raster while doing antialiasing. - */ - if ((ptr->data = calloc(shrunk_width*shrunk_height,sizeof(char))) == NULL) - Fatal("unable to malloc image space for char %c", (char)c); - for (j = 0; j < original_height; j++) { - for (i = 0; i < (original_width+7)/8 ; i++) { - for (k = 0; k < 8 ; k++) { - DEBUG_PRINT(DEBUG_GLYPH, - ("%c", - (glyph->bits[i+j*((original_width+7)/8)] & (1<data[(i*8+k+i_offset)/shrinkfactor - +(j+j_offset)/shrinkfactor*shrunk_width] += - (glyph->bits[i+j*((original_width+7)/8)] & (1<data[i+j*shrunk_width] = ptr->data[i+j*shrunk_width] - *255/shrinkfactor/shrinkfactor; - DEBUG_PRINT(DEBUG_GLYPH,("%3u ",ptr->data[i+j*shrunk_width])); - } - DEBUG_PRINT(DEBUG_GLYPH,("|\n")); - } -} - -bool InitT1(struct font_entry * tfontp) -{ - if (libt1==NULL) { - if ((libt1=T1_InitLib( NO_LOGFILE | IGNORE_CONFIGFILE - | IGNORE_FONTDATABASE | T1_NO_AFM)) == NULL) { - Warning("an error occured during t1lib initialisation, disabling it"); - option_flags &= ~USE_LIBT1; - return(false); - } -# ifdef DEBUG - else - DEBUG_PRINT(DEBUG_T1,("\n T1LIB VERSION: %s", T1_GetLibIdent())); -# endif - } - - DEBUG_PRINT((DEBUG_DVI|DEBUG_T1),("\n OPEN T1 FONT:\t'%s'", tfontp->name)); - tfontp->T1id = T1_AddFont( tfontp->name ); - if (tfontp->T1id < 0) { - Warning("t1lib could not open font file %s", tfontp->name); - return(false); - } - if (T1_LoadFont(tfontp->T1id)) { - Warning("t1lib could not load font file %s", tfontp->name); - return(false); - } - Message(BE_VERBOSE,"<%s>", tfontp->name); - if (tfontp->psfontmap!=NULL && tfontp->psfontmap->encoding != NULL) { - DEBUG_PRINT(DEBUG_T1,("\n USE ENCODING:\t'%s'", tfontp->psfontmap->encoding->name)); - if (T1_ReencodeFont(tfontp->T1id,tfontp->psfontmap->encoding->charname)) { - Warning("unable to use font encoding '%s' for %s", - tfontp->psfontmap->encoding->name,tfontp->name); - return(false); - } - } - tfontp->type = FONT_TYPE_T1; - return(true); -} - - -static void UnLoadT1(struct char_entry *ptr) -{ - if (ptr->data!=NULL) - free(ptr->data); - ptr->data=NULL; -} - - -void DoneT1(struct font_entry *tfontp) -{ - int c=0; - - int error = T1_DeleteFont( tfontp->T1id ); - if (error) - Warning("font file %s could not be closed", tfontp->name); - while(cchr[c]!=NULL) { - UnLoadT1((struct char_entry*)tfontp->chr[c]); - free(tfontp->chr[c]); - tfontp->chr[c]=NULL; - } - c++; - } - if (tfontp->name!=NULL) - free(tfontp->name); - tfontp->name=NULL; -} - - diff -Nru dvipng-1.14/tfm.c dvipng-1.15/tfm.c --- dvipng-1.14/tfm.c 2009-03-26 22:14:01.000000000 +0000 +++ dvipng-1.15/tfm.c 2015-03-02 19:33:56.000000000 +0000 @@ -27,8 +27,8 @@ bool ReadTFM(struct font_entry * tfontp, char* tfmname) { struct filemmap fmmap; - struct char_entry *tcharptr; - unsigned char *position; + struct char_entry *tcharptr; + unsigned char *position; int lh,bc,ec,nw, c; dviunits* width; @@ -41,35 +41,38 @@ ec = UNumRead(position+6,2); nw = UNumRead(position+8,2); DEBUG_PRINT(DEBUG_TFM,(" %d %d %d %d",lh,bc,ec,nw)); - width=malloc(nw*sizeof(dviunits)); - c=0; - position=position+24+(lh+ec-bc+1)*4; - while( c < nw ) { - width[c] = SNumRead(position,4); - c++; - position += 4; + if (nw>0) { + if ((width=malloc(nw*sizeof(dviunits)))==NULL) + Fatal("cannot allocate memory for TFM widths"); + c=0; + position=position+24+(lh+ec-bc+1)*4; + while( c < nw ) { + width[c] = SNumRead(position,4); + c++; + position += 4; + } + /* Read char widths */ + c=bc; + position=(unsigned char*)fmmap.data+24+lh*4; + while(c <= ec) { + DEBUG_PRINT(DEBUG_TFM,("\n@%ld TFM METRICS:\t", + (long)position - (long)fmmap.data)); + if ((tcharptr=malloc(sizeof(struct char_entry)))==NULL) + Fatal("cannot allocate memory for TFM char entry"); + tcharptr->data=NULL; + tcharptr->tfmw=width[*position]; + DEBUG_PRINT(DEBUG_TFM,("%d [%d] %d",c,*position,tcharptr->tfmw)); + tcharptr->tfmw = (dviunits) + ((int64_t) tcharptr->tfmw * tfontp->s / (1 << 20)); + DEBUG_PRINT(DEBUG_TFM,(" (%d)",tcharptr->tfmw)); + if (c >= NFNTCHARS) /* Only positive for now */ + Fatal("tfm file %s exceeds char numbering limit",tfmname); + tfontp->chr[c] = tcharptr; + c++; + position += 4; + } + free(width); } - - /* Read char widths */ - c=bc; - position=(unsigned char*)fmmap.data+24+lh*4; - while(c <= ec) { - DEBUG_PRINT(DEBUG_TFM,("\n@%ld TFM METRICS:\t", - (long)position - (long)fmmap.data)); - tcharptr=xmalloc(sizeof(struct char_entry)); - tcharptr->data=NULL; - tcharptr->tfmw=width[*position]; - DEBUG_PRINT(DEBUG_TFM,("%d [%d] %d",c,*position,tcharptr->tfmw)); - tcharptr->tfmw = (dviunits) - ((int64_t) tcharptr->tfmw * tfontp->s / (1 << 20)); - DEBUG_PRINT(DEBUG_TFM,(" (%d)",tcharptr->tfmw)); - if (c >= NFNTCHARS) /* Only positive for now */ - Fatal("tfm file %s exceeds char numbering limit",tfmname); - tfontp->chr[c] = tcharptr; - c++; - position += 4; - } - free(width); UnMmapFile(&fmmap); return(true); } diff -Nru dvipng-1.14/vf.c dvipng-1.15/vf.c --- dvipng-1.14/vf.c 2010-03-17 13:02:35.000000000 +0000 +++ dvipng-1.15/vf.c 2015-03-02 19:33:56.000000000 +0000 @@ -18,7 +18,7 @@ License along with this program. If not, see . - Copyright (C) 2002-2010 Jan-Åke Larsson + Copyright (C) 2002-2015 Jan-Åke Larsson ************************************************************************/ @@ -27,7 +27,7 @@ #define VF_ID 202 #define LONG_CHAR 242 -int32_t SetVF(struct char_entry* ptr) +int32_t SetVF(struct char_entry* ptr) { struct font_entry* currentvf; unsigned char *command,*end; @@ -40,7 +40,7 @@ DEBUG_PRINT(DEBUG_DVI,("\n VF MACRO:\t%s ", dvi_commands[*command])); DrawCommand(command,currentvf); command += CommandLength(command); - } + } EndVFMacro(); currentfont=currentvf; return(ptr->tfmw); @@ -52,21 +52,21 @@ { unsigned char* position; int length; - struct char_entry *tcharptr; + struct char_entry *tcharptr; uint32_t c=0; struct font_num *tfontnump; /* temporary font_num pointer */ - + DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n OPEN FONT:\t'%s'", tfontp->name)); Message(BE_VERBOSE,"<%s>", tfontp->name); if (MmapFile(tfontp->name,&(tfontp->fmmap))) Fatal("font file %s unusable", tfontp->name); position=(unsigned char*)tfontp->fmmap.data; - if (*(position) != PRE) + if (*(position) != PRE) Fatal("unknown font format in file %s",tfontp->name); - if (*(position+1) != VF_ID) + if (*(position+1) != VF_ID) Fatal( "wrong version %d of vf file %s (should be 202)", (int)*(position+1),tfontp->name); - DEBUG_PRINT(DEBUG_VF,("\n VF_PRE:\t'%.*s'", + DEBUG_PRINT(DEBUG_VF,("\n VF_PRE:\t'%.*s'", (int)*(position+2), position+3)); position = position+3 + *(position+2); c=UNumRead(position, 4); @@ -79,10 +79,10 @@ /* Read font definitions */ position += 8; while(*position >= FNT_DEF1 && *position <= FNT_DEF4) { - DEBUG_PRINT(DEBUG_VF,("\n @%ld VF:\t%s", - (long)position - (long)tfontp->fmmap.data, + DEBUG_PRINT(DEBUG_VF,("\n @%ld VF:\t%s", + (long)position - (long)tfontp->fmmap.data, dvi_commands[*position])); - FontDef(position,tfontp); + FontDef(position,tfontp); length = dvi_commandlength[*position]; position += length + *(position + length-1) + *(position+length-2); } @@ -92,12 +92,12 @@ tfontnump = tfontnump->next; } tfontp->defaultfont=tfontnump->k; - /* Read char definitions */ while(*position < FNT_DEF1) { - DEBUG_PRINT(DEBUG_VF,("\n@%ld VF CHAR:\t", + DEBUG_PRINT(DEBUG_VF,("\n@%ld VF CHAR:\t", (long)position - (long)tfontp->fmmap.data)); - tcharptr=xmalloc(sizeof(struct char_entry)); + if ((tcharptr=malloc(sizeof(struct char_entry)))==NULL) + Fatal("cannot allocate memory for VF char entry"); switch (*position) { case LONG_CHAR: tcharptr->length = UNumRead(position+1,4); @@ -112,7 +112,7 @@ position += 5; } DEBUG_PRINT(DEBUG_VF,("%d %d %d",tcharptr->length,c,tcharptr->tfmw)); - tcharptr->tfmw = (int32_t) + tcharptr->tfmw = (int32_t) ((int64_t) tcharptr->tfmw * tfontp->s / (1 << 20)); DEBUG_PRINT(DEBUG_VF,(" (%d)",tcharptr->tfmw)); if (c >= NFNTCHARS) /* Only positive for now */