Permalink
Browse files

Revert "Revert "Merge pull request #258 from JoesCat/master""

This reverts commit 9363792.
  • Loading branch information...
1 parent 48fb439 commit 7824d4731cfe3e2b0288e3df82b956e099760d5c @JoesCat JoesCat committed Feb 2, 2013
View
@@ -4,6 +4,7 @@ George Williams
Aktado <aktado@users.sourceforge.jp>
Arthaey Angosii
Alexey Kryukov - nowakowskittfinstr.c
+Alexandre Prokoudine
Barry Schwartz
Baruch Even
Ben Martin - hotkeys.c, hotkeys.h
@@ -13,6 +14,7 @@ Dave Levine
Dong Yang
Georg Duffner
J. Jansen - gv - ANALYZE_MAP.COM
+Jason Pagura
Johannes Plass - gv = ANALYZE_MAP.COM
Jonathan Hanna
Jonathan Hue
@@ -26,9 +28,14 @@ Matthew Skala
Max Rabkin - excepthook.py
Michal Mazurek
Michal Nowakowski - nowakowskittfinstr.c
+Qmpel
+R.L. Horn
Scott Pakin - Packaging
+serval2412
+Steve White - ASMO 708 codepage, & more
Timothy O. Theisen - gv = ANALYZE_MAP.COM
Tom Harvey - fontforge.1
+Ville Skytta
Werner Lemberg
yannis
View
@@ -5,8 +5,6 @@ libgunicode_OBJECTS = ArabicForms.obj,alphabet.obj,backtrns.obj,char.obj,\
cjk.obj,memory.obj,ucharmap.obj,unialt.obj,ustring.obj,\
utype.obj,usprintf.obj,gwwiconv.obj
-CFLAGS=/incl=([-.inc])/name=(as_is,short)/nowarn/define=("HAVE_CONFIG_H=1")
-
all : [-.libs]libgunicode.olb
write sys$output "unicode finished"
View
@@ -24,10 +24,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <config.h> /* FF config file */
#include <gwwiconv.h>
#include <stddef.h>
#include <ustring.h>
View
@@ -321,6 +321,11 @@ AC_CHECK_FUNCS([strtol strtoul tzset uname])
AC_CHECK_FUNC([snprintf],[:],[AC_DEFINE([_NO_SNPRINTF],1,[Define if not using snprintf.])])
AC_CHECK_FUNC([tzset],[:],[AC_DEFINE([_NO_TZSET],1,[Define if not using tzset.])])
+#--------------------------------------------------------------------------
+# Put ifdef wrapper around the new config.h so we don't repeatedly call it.
+AH_TOP([#ifndef _FF_CONFIG_H])
+AH_TOP([#define _FF_CONFIG_H 1])
+AH_BOTTOM([#endif])
#--------------------------------------------------------------------------
AM_CONDITIONAL([GRAPHICAL_USER_INTERFACE],[test x"${i_do_have_gui}" = xyes])
View
@@ -205,7 +205,7 @@ AM_CPPFLAGS = "-I$(top_builddir)/inc" "-I$(top_srcdir)/inc" \
# optimization turns out to have disastrous effects. Compile it
# without optimization.
splinerefigure.lo: $(srcdir)/splinerefigure.c $(srcdir)/splinefont.h
- $(LIBTOOL) --mode=compile $(CC) -g -DHAVE_CONFIG_H -c -o \
+ $(LIBTOOL) --mode=compile $(CC) -g -D_FF_CONFIG_H -c -o \
splinerefigure.lo $(AM_CPPFLAGS) $(srcdir)/splinerefigure.c
#--------------------------------------------------------------------------
View
@@ -1,8 +1,6 @@
# Makefile for OpenVMS
# Date : 16 February 2011
-CFLAGS=/nowarn/incl=([],[-.inc])/name=(as_is,short)/define=("HAVE_CONFIG_H=1")
-
fontforge_LIBOBJECTS = asmfpst.obj,autohint.obj,autosave.obj,autotrace.obj,autowidth.obj,\
bezctx_ff.obj,bitmapchar.obj,bitmapcontrol.obj,bvedit.obj,clipnoui.obj,crctab.obj,\
cvexport.obj,cvimages.obj,cvundoes.obj,dumpbdf.obj,dumppfa.obj,effects.obj,encoding.obj
View
@@ -1,7 +1,3 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <basics.h>
#include <string.h>
#include "flaglist.h"
View
@@ -5614,6 +5614,8 @@ return;
}
}
free(coords);
+ } else {
+ curScript->baseline_pos = gcalloc(curBase->baseline_cnt,sizeof(int16));
}
lastLang = NULL;
if ( defminmax!=0 )
View
@@ -26,10 +26,7 @@
*/
/* Python Interface to FontForge */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <config.h> /* FF config file */
#ifndef _NO_PYTHON
#include "Python.h"
View
@@ -26,9 +26,7 @@
*/
/* Python Interface to FontForge */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <config.h> /* FF config file */
#ifndef _NO_PYTHON
#include "Python.h"
View
@@ -25,9 +25,7 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include <config.h> /* FF config file */
#ifndef _NO_PYTHON
# include "Python.h"
@@ -376,11 +374,16 @@ static void PListOutputBoolean(FILE *plist, char *key, int value) {
}
static void PListOutputDate(FILE *plist, char *key, time_t timestamp) {
+/* openTypeHeadCreated = string format as \"YYYY/MM/DD HH:MM:SS\". */
+/* \"YYYY/MM/DD\" is year/month/day. The month is in the range 1-12 and */
+/* the day is in the range 1-end of month. */
+/* \"HH:MM:SS\" is hour:minute:second. The hour is in the range 0:23. */
+/* Minutes and seconds are in the range 0-59. */
struct tm *tm = gmtime(&timestamp);
fprintf( plist, "\t<key>%s</key>\n", key );
fprintf( plist, "\t<string>%4d/%02d/%02d %02d:%02d:%02d</string>\n",
- tm->tm_year+1900, tm->tm_mon,
+ tm->tm_year+1900, tm->tm_mon+1,
tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec );
}
@@ -484,7 +487,7 @@ static int UFOOutputMetaInfo(char *basedir,SplineFont *sf) {
if ( plist==NULL )
return( false );
- PListOutputString(plist,"creator","net.SourceForge.FontForge");
+ PListOutputString(plist,"creator","net.GitHub.FontForge");
#ifdef Version_1
PListOutputInteger(plist,"formatVersion",1);
#else
View
@@ -16,8 +16,6 @@ libgdraw_OBJECTS = choosericons.obj,drawboxborder.obj,\
libgdraw_OBJECTS1=gdrawable.obj,gxcdraw.obj
-CFLAGS=/nowarn/incl=([-.inc])/name=(as_is,short)/define=("HAVE_CONFIG_H=1")
-
all : [-.libs]libgdraw.olb
write sys$output "gdraw finished"
View
@@ -57,9 +57,8 @@ capable of using composite.
#ifdef __VMS
#include <vms_x_fix.h>
#endif
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+
+#include <config.h> /* FF config file */
#ifndef X_DISPLAY_MISSING
# include <X11/X.h>
View
@@ -2,9 +2,7 @@
* DO NOT EDIT THIS FILE - it is generated by Glade.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h> /* FF config file */
#include <sys/types.h>
#include <sys/stat.h>
View
@@ -26,9 +26,7 @@
*/
/* Python Interface to FontForge GTK+ */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h> /* FF config file */
#ifndef _NO_PYTHON
#include "Python.h"
View
@@ -3,9 +3,7 @@
*/
/* Bleah. I'll modify it if I want to */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h> /* FF config file */
#include <sys/types.h>
#include <sys/stat.h>
View
@@ -3,9 +3,7 @@
*/
/* I can if I want to */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h> /* FF config file */
#include <gtk/gtk.h>
View
@@ -9,8 +9,6 @@ libgutil_OBJECTS =divisors.obj,dynamic.obj,fsys.obj,gimage.obj,gimageread.obj\
gimagewritexbm.obj,gwwintl.obj,gio.obj,giofile.obj,gioftp.obj,giohosts.obj,\
giomime.obj,giothread.obj,giotrans.obj,gcol.obj
-CFLAGS=/nowarn/incl=([-.inc])/name=(as_is,short)/define=("HAVE_CONFIG_H=1")
-
all : [-.libs]libgutil.olb
write sys$output "gutil finished"
View
@@ -27,18 +27,18 @@
#include "gimage.h"
GImage *GImageCreate(enum image_type type, int32 width, int32 height) {
+/* Prepare to get a bitmap image. Cleanup and return NULL if not enough memory */
GImage *gi;
struct _GImage *base;
if ( type<it_mono || type>it_rgba )
-return( NULL );
+ return( NULL );
+
+ gi = (GImage *) calloc(1,sizeof(GImage));
+ base = (struct _GImage *) malloc(sizeof(struct _GImage));
+ if ( gi==NULL || base==NULL )
+ goto errorGImageCreate;
- gi = (GImage *) gcalloc(1,sizeof(GImage));
- base = (struct _GImage *) galloc(sizeof(struct _GImage));
- if ( gi==NULL || base==NULL ) {
- free(gi); free(base);
-return( NULL );
- }
gi->u.image = base;
base->image_type = type;
base->width = width;
@@ -47,17 +47,22 @@ return( NULL );
base->data = NULL;
base->clut = NULL;
base->trans = COLOR_UNKNOWN;
- base->data = (uint8 *) galloc(height*base->bytes_per_line);
- if ( base->data==NULL ) {
- free(base);
- free(gi);
-return( NULL );
- }
+ if ( (base->data = (uint8 *) malloc(height*base->bytes_per_line))==NULL )
+ goto errorGImageCreate;
if ( type==it_index ) {
- base->clut = (GClut *) gcalloc(1,sizeof(GClut));
+ if ( (base->clut = (GClut *) calloc(1,sizeof(GClut)))==NULL ) {
+ free(base->data);
+ goto errorGImageCreate;
+ }
base->clut->trans_index = COLOR_UNKNOWN;
}
-return( gi );
+ return( gi );
+
+errorGImageCreate:
+ free(base);
+ free(gi);
+ NoMoreMemMessage();
+ return( NULL );
}
@@ -66,24 +71,31 @@ GImage *_GImage_Create(enum image_type type, int32 width, int32 height) {
struct _GImage *base;
if ( type<it_mono || type>it_rgba )
-return( NULL );
+ return( NULL );
+
+ gi = (GImage *) calloc(1,sizeof(GImage));
+ base = (struct _GImage *) malloc(sizeof(struct _GImage));
+ if ( gi==NULL || base==NULL )
+ goto error_GImage_Create;
- gi = (GImage *) gcalloc(1,sizeof(GImage));
- base = (struct _GImage *) galloc(sizeof(struct _GImage));
- if ( gi==NULL || base==NULL ) {
- free(gi); free(base);
-return( NULL );
- }
gi->u.image = base;
base->image_type = type;
base->width = width;
base->height = height;
base->bytes_per_line = (type==it_true || type==it_rgba)?4*width:type==it_index?width:(width+7)/8;
base->data = NULL;
base->clut = NULL;
- if ( type==it_index )
- base->clut = (GClut *) gcalloc(1,sizeof(GClut));
-return( gi );
+ if ( type==it_index ) {
+ if ( (base->clut = (GClut *) calloc(1,sizeof(GClut)))==NULL )
+ goto error_GImage_Create;
+ }
+ return( gi );
+
+error_GImage_Create:
+ free(base);
+ free(gi);
+ NoMoreMemMessage();
+ return( NULL );
}
void GImageDestroy(GImage *gi) {
@@ -105,23 +117,40 @@ void GImageDestroy(GImage *gi) {
}
GImage *GImageCreateAnimation(GImage **images, int n) {
- struct _GImage **imgs = (struct _GImage **) galloc(n*sizeof(struct _GImage *));
- GImage *gi = (GImage *) gcalloc(1,sizeof(GImage));
+/* Create an animation using n "images". Return gi and free "images" if */
+/* okay, else return NULL and keep "images" if memory error occurred, */
+ GImage *gi;
+ struct _GImage **imgs;
int i;
+ /* Check if "images" are okay to copy before creating an animation. */
+ /* We expect to find single images (not an array). Type must match. */
+ for ( i=0; i<n; ++i ) {
+ if ( images[i]->list_len!=0 || \
+ images[i]->u.image->image_type!=images[0]->u.image->image_type ) {
+ fprintf( stderr, "Images are not compatible to make an Animation\n" );
+ return( NULL );
+ }
+ }
+
+ /* First, create enough memory space to hold the complete animation */
+ gi = (GImage *) calloc(1,sizeof(GImage));
+ imgs = (struct _GImage **) malloc(n*sizeof(struct _GImage *));
+ if ( gi==NULL || imgs==NULL ) {
+ free(gi);
+ free(imgs);
+ NoMoreMemMessage();
+ return( NULL );
+ }
+
+ /* Copy images[i] pointer into 'gi', then release each "images[i]". */
gi->list_len = n;
gi->u.images = imgs;
for ( i=0; i<n; ++i ) {
- if ( images[i]->list_len!=0 ) {
- free(gi);
-return( NULL );
- }
- if ( images[i]->u.image->image_type!=images[0]->u.image->image_type )
-return( NULL );
imgs[i] = images[i]->u.image;
free(images[i]);
}
-return( gi );
+ return( gi );
}
/* -1 => add it at the end */
@@ -131,7 +160,11 @@ GImage *GImageAddImageBefore(GImage *dest, GImage *src, int pos) {
enum image_type it;
n = (src->list_len==0?1:src->list_len) + (dest->list_len==0?1:dest->list_len);
- imgs = (struct _GImage **) galloc(n*sizeof(struct _GImage *));
+ imgs = (struct _GImage **) malloc(n*sizeof(struct _GImage *));
+ if ( imgs==NULL ) {
+ NoMoreMemMessage();
+ return( NULL );
+ }
i = 0;
if ( dest->list_len==0 ) {
Oops, something went wrong.

0 comments on commit 7824d47

Please sign in to comment.