summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-11-14 00:48:08 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-11-14 00:48:08 +0000
commit64322869cd45fa0029198b6ef544363a0cf49eb6 (patch)
treefaa34b755a1bd7b9b5ca4a66d204deebf841d119 /Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge
parent6d37525a79984eea934633c34944113831e3fecb (diff)
web2c/luatexdir: Sync with the upstream trunk.
git-svn-id: svn://tug.org/texlive/trunk@38844 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge')
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c3
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c14
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c18
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c13
-rw-r--r--Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c1
5 files changed, 41 insertions, 8 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
index 24798ad09ee..aa0ed46aeb8 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/fontviewbase.c
@@ -112,6 +112,9 @@ static void FontViewBase_Free(FontViewBase *fv) {
int i;
FontViewBase *prev;
+ if (fv->cidmaster)
+ EncMapFree(fv->cidmaster->map);
+
if ( fv->nextsame==NULL && fv->sf->fv==fv ) {
EncMapFree(fv->map);
SplineFontFree(fv->cidmaster?fv->cidmaster:fv->sf);
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
index 66128685dcc..7dd59529e7f 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/macenc.c
@@ -1144,8 +1144,10 @@ return( NULL );
inlen = strlen(in);
outlen = (inlen+1)*4;
out = (char *) (ret = galloc(outlen+2));
- if(iconv(toutf8,&in,&inlen,&out,&outlen)==-1)
-return( NULL );
+ if(iconv(toutf8,&in,&inlen,&out,&outlen)==-1){
+ if (ret) free(ret) ;
+ if (toutf8) iconv_close(toutf8);
+return( NULL );}
out[0] = '\0';
iconv_close(toutf8);
#ifdef UNICHAR_16
@@ -1153,12 +1155,14 @@ return( NULL );
#else
toutf8 = iconv_open("UTF-8","UCS4");
#endif
- if ( toutf8==(iconv_t) -1 || toutf8==NULL )
-return( NULL );
+ if ( toutf8==(iconv_t) -1 || toutf8==NULL ){
+ if (ret) free(ret);
+ if (toutf8) iconv_close(toutf8);
+return( NULL );}
in = (char *) strdup(ret);
inlen = strlen(in);
outlen = (inlen+1)*4;
- out = (char *) (ret = galloc(outlen+2));
+ out = (char *) (ret = grealloc(ret,outlen+2));
if(iconv(toutf8,&in,&inlen,&out,&outlen)==-1)
return( NULL );
out[0] = '\0';
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
index 0a79633f11e..7586416fb16 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/parsettf.c
@@ -478,7 +478,12 @@ return( NULL );
char *cstr = galloc(inlen);
ICONV_CONST char *in = cstr;
char *out;
- str = galloc(outlen+2);
+#ifdef UNICHAR_16
+ str = galloc(outlen+2);
+#else
+ str = galloc(outlen+sizeof(unichar_t));
+#endif
+ /*str = galloc(outlen+2);*/
out = (char *) str;
iconv(enc->tounicode,&in,&inlen,&out,&outlen);
out[0] = '\0'; out[1] = '\0';
@@ -4256,6 +4261,7 @@ static void ApplyVariationSequenceSubtable(FILE *ttf,uint32 vs_map,
}
}
}
+ free(vs_data);
}
static enum uni_interp amscheck(struct ttfinfo *info, EncMap *map) {
@@ -5062,6 +5068,8 @@ static void readttfpostnames(FILE *ttf,struct ttfinfo *info) {
nm[j] = getc(ttf);
nm[j] = '\0';
if ( indexes[i]<info->glyph_cnt && info->chars[indexes[i]]!=NULL ) {
+ if (info->chars[indexes[i]]->name)
+ free( info->chars[indexes[i]]->name );
info->chars[indexes[i]]->name = nm;
#if 0 /* Too many fonts have badly named glyphs */
if ( info->chars[indexes[i]]->unicodeenc==-1 )
@@ -5917,6 +5925,12 @@ static SplineFont *SFFillFromTTF(struct ttfinfo *info) {
SFRelativeWinAsDs(sf);
free(info->savetab);
+ /*if (info->chars) {
+ int i;
+ for(i=0; info->chars[i]; i++)
+ if (info->chars[i]->name)
+ free(info->chars[i]->name);
+ }*/
sf->loadvalidation_state =
(info->bad_ps_fontname ?lvs_bad_ps_fontname:0) |
(info->bad_glyph_data ?lvs_bad_glyph_table:0) |
@@ -6062,6 +6076,8 @@ static SplineFont *SFFillFromTTFInfo(struct ttfinfo *info) {
sf->pfminfo = info->pfminfo ;
free(info->savetab);
+ if (info->chosenname)
+ free(info->chosenname);
if ( sf->copyright==NULL )
sf->copyright = info->copyright;
else
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
index a3b610a7174..84e062c013e 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splinefont.c
@@ -496,7 +496,7 @@ return( _ReadSplineFont(NULL,filename,openflags));
SplineFont *ReadSplineFontInfo(char *filename,enum openflags openflags) {
SplineFont *sf, *sf_ptr;
- char **fontlist;
+ char **fontlist;
char *pt =NULL, *strippedname=filename, *paren=NULL, *rparen=NULL, *fullname=filename;
FILE *foo = NULL;
int checked = 0;
@@ -533,8 +533,11 @@ return( NULL );
sf = SFReadTTFInfo(fullname,0,openflags);
checked = 't';
} else if ((ch1=='t' && ch2=='t' && ch3=='c' && ch4=='f')) {
- /* read all fonts in a collection */
+ char **old_fontlist;
+ int i;
+ /* read all fonts in a collection */
fontlist = NamesReadTTF(fullname);
+ old_fontlist = fontlist;
if (fontlist) {
while (*fontlist != NULL) {
snprintf(s,511, "%s(%s)", fullname,*fontlist);
@@ -544,6 +547,12 @@ return( NULL );
sf = sf_ptr;
fontlist++;
}
+ /* fontlist is (g)allocated */
+ fontlist = old_fontlist;
+ for(i=0; fontlist[i]; i++)
+ free(fontlist[i]);
+ free(fontlist);
+ old_fontlist = NULL;
}
} else if ( strmatch(fullname+strlen(strippedname)-4, ".bin")==0 ||
strmatch(fullname+strlen(strippedname)-4, ".hqx")==0 ||
diff --git a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
index a3eb2203bf1..f68ddc81d39 100644
--- a/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
+++ b/Build/source/texk/web2c/luatexdir/luafontloader/fontforge/fontforge/splineutil.c
@@ -4313,6 +4313,7 @@ return;
for ( i=0; i < sf->layer_cnt; ++i )
free (sf->layers[i].name);
free(sf->layers);
+ free(sf->MATH);
free(sf);
}